tint/intrinsics: Texture queries now return unsigned integer / vectors
To match the spec.
Also add a bunch of missing texture test cases to
src/tint/ast/builtin_texture_helper_test.cc. Fix all the tests that were
broken because these were not being exercised.
Fixed: tint:1526
Change-Id: I207b51d307bbdc054b595e0e0e0fd3330607e171
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/106681
Reviewed-by: Dan Sinclair <dsinclair@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/docs/tint/origin-trial-changes.md b/docs/tint/origin-trial-changes.md
index e118024..09fe4e1 100644
--- a/docs/tint/origin-trial-changes.md
+++ b/docs/tint/origin-trial-changes.md
@@ -2,6 +2,10 @@
## Changes for M109
+### Breaking changes
+
+* `textureDimensions()`, `textureNumLayers()` and `textureNumLevels()` now return unsigned integers / vectors. [tint:1526](crbug.com/tint/1526)
+
### New features
* Uniformity analysis failures are warnings again [tint:1728](crbug.com/tint/1728)
diff --git a/src/dawn/tests/end2end/StorageTextureTests.cpp b/src/dawn/tests/end2end/StorageTextureTests.cpp
index b2cc1e0..4e1fb27 100644
--- a/src/dawn/tests/end2end/StorageTextureTests.cpp
+++ b/src/dawn/tests/end2end/StorageTextureTests.cpp
@@ -310,23 +310,23 @@
auto texelType = "vec4<" + componentFmt + ">";
std::string sliceCount;
std::string textureStore;
- std::string textureSize = "textureDimensions(storageImage0).xy";
+ std::string textureSize = "vec2<i32>(textureDimensions(storageImage0).xy)";
switch (dimension) {
case wgpu::TextureViewDimension::e1D:
sliceCount = "1";
textureStore = "textureStore(storageImage0, x, expected)";
- textureSize = "vec2<i32>(textureDimensions(storageImage0), 1)";
+ textureSize = "vec2<i32>(i32(textureDimensions(storageImage0)), 1)";
break;
case wgpu::TextureViewDimension::e2D:
sliceCount = "1";
textureStore = "textureStore(storageImage0, vec2<i32>(x, y), expected)";
break;
case wgpu::TextureViewDimension::e2DArray:
- sliceCount = "textureNumLayers(storageImage0)";
+ sliceCount = "i32(textureNumLayers(storageImage0))";
textureStore = "textureStore(storageImage0, vec2<i32>(x, y), slice, expected)";
break;
case wgpu::TextureViewDimension::e3D:
- sliceCount = "textureDimensions(storageImage0).z";
+ sliceCount = "i32(textureDimensions(storageImage0).z)";
textureStore = "textureStore(storageImage0, vec3<i32>(x, y, slice), expected)";
break;
default:
diff --git a/src/dawn/tests/perf_tests/SubresourceTrackingPerf.cpp b/src/dawn/tests/perf_tests/SubresourceTrackingPerf.cpp
index 2fe41ac..88a5acf 100644
--- a/src/dawn/tests/perf_tests/SubresourceTrackingPerf.cpp
+++ b/src/dawn/tests/perf_tests/SubresourceTrackingPerf.cpp
@@ -75,7 +75,7 @@
pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"(
@group(0) @binding(0) var materials : texture_2d<f32>;
@fragment fn main() -> @location(0) vec4<f32> {
- let foo : vec2<i32> = textureDimensions(materials);
+ _ = materials;
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
}
)");
diff --git a/src/tint/ast/builtin_texture_helper_test.cc b/src/tint/ast/builtin_texture_helper_test.cc
index b21fae4..d2ea48d 100644
--- a/src/tint/ast/builtin_texture_helper_test.cc
+++ b/src/tint/ast/builtin_texture_helper_test.cc
@@ -183,7 +183,7 @@
return {
{
ValidTextureOverload::kDimensions1d,
- "textureDimensions(t : texture_1d<f32>) -> i32",
+ "textureDimensions(t : texture_1d<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k1d,
@@ -193,7 +193,7 @@
},
{
ValidTextureOverload::kDimensions2d,
- "textureDimensions(t : texture_2d<f32>) -> vec2<i32>",
+ "textureDimensions(t : texture_2d<f32>) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -204,7 +204,7 @@
{
ValidTextureOverload::kDimensions2dLevel,
"textureDimensions(t : texture_2d<f32>,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -214,7 +214,7 @@
},
{
ValidTextureOverload::kDimensions2dArray,
- "textureDimensions(t : texture_2d_array<f32>) -> vec2<i32>",
+ "textureDimensions(t : texture_2d_array<f32>) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -225,7 +225,7 @@
{
ValidTextureOverload::kDimensions2dArrayLevel,
"textureDimensions(t : texture_2d_array<f32>,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -235,7 +235,7 @@
},
{
ValidTextureOverload::kDimensions3d,
- "textureDimensions(t : texture_3d<f32>) -> vec3<i32>",
+ "textureDimensions(t : texture_3d<f32>) -> vec3<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k3d,
@@ -246,7 +246,7 @@
{
ValidTextureOverload::kDimensions3dLevel,
"textureDimensions(t : texture_3d<f32>,\n"
- " level : i32) -> vec3<i32>",
+ " level : i32) -> vec3<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k3d,
@@ -256,7 +256,7 @@
},
{
ValidTextureOverload::kDimensionsCube,
- "textureDimensions(t : texture_cube<f32>) -> vec2<i32>",
+ "textureDimensions(t : texture_cube<f32>) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -267,7 +267,7 @@
{
ValidTextureOverload::kDimensionsCubeLevel,
"textureDimensions(t : texture_cube<f32>,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -277,7 +277,7 @@
},
{
ValidTextureOverload::kDimensionsCubeArray,
- "textureDimensions(t : texture_cube_array<f32>) -> vec2<i32>",
+ "textureDimensions(t : texture_cube_array<f32>) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -288,7 +288,7 @@
{
ValidTextureOverload::kDimensionsCubeArrayLevel,
"textureDimensions(t : texture_cube_array<f32>,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -298,7 +298,7 @@
},
{
ValidTextureOverload::kDimensionsMultisampled2d,
- "textureDimensions(t : texture_multisampled_2d<f32>)-> vec2<i32>",
+ "textureDimensions(t : texture_multisampled_2d<f32>)-> vec2<u32>",
TextureKind::kMultisampled,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -308,7 +308,7 @@
},
{
ValidTextureOverload::kDimensionsDepth2d,
- "textureDimensions(t : texture_depth_2d) -> vec2<i32>",
+ "textureDimensions(t : texture_depth_2d) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -319,7 +319,7 @@
{
ValidTextureOverload::kDimensionsDepth2dLevel,
"textureDimensions(t : texture_depth_2d,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -329,7 +329,7 @@
},
{
ValidTextureOverload::kDimensionsDepth2dArray,
- "textureDimensions(t : texture_depth_2d_array) -> vec2<i32>",
+ "textureDimensions(t : texture_depth_2d_array) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -340,7 +340,7 @@
{
ValidTextureOverload::kDimensionsDepth2dArrayLevel,
"textureDimensions(t : texture_depth_2d_array,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -350,7 +350,7 @@
},
{
ValidTextureOverload::kDimensionsDepthCube,
- "textureDimensions(t : texture_depth_cube) -> vec2<i32>",
+ "textureDimensions(t : texture_depth_cube) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -361,7 +361,7 @@
{
ValidTextureOverload::kDimensionsDepthCubeLevel,
"textureDimensions(t : texture_depth_cube,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -371,7 +371,7 @@
},
{
ValidTextureOverload::kDimensionsDepthCubeArray,
- "textureDimensions(t : texture_depth_cube_array) -> vec2<i32>",
+ "textureDimensions(t : texture_depth_cube_array) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -382,7 +382,7 @@
{
ValidTextureOverload::kDimensionsDepthCubeArrayLevel,
"textureDimensions(t : texture_depth_cube_array,\n"
- " level : i32) -> vec2<i32>",
+ " level : i32) -> vec2<u32>",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -392,7 +392,7 @@
},
{
ValidTextureOverload::kDimensionsDepthMultisampled2d,
- "textureDimensions(t : texture_depth_multisampled_2d) -> vec2<i32>",
+ "textureDimensions(t : texture_depth_multisampled_2d) -> vec2<u32>",
TextureKind::kDepthMultisampled,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -402,7 +402,7 @@
},
{
ValidTextureOverload::kDimensionsStorageWO1d,
- "textureDimensions(t : texture_storage_1d<rgba32float>) -> i32",
+ "textureDimensions(t : texture_storage_1d<rgba32float>) -> u32",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
ast::TextureDimension::k1d,
@@ -412,8 +412,7 @@
},
{
ValidTextureOverload::kDimensionsStorageWO2d,
- "textureDimensions(t : texture_storage_2d<rgba32float>) -> "
- "vec2<i32>",
+ "textureDimensions(t : texture_storage_2d<rgba32float>) -> vec2<u32>",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
ast::TextureDimension::k2d,
@@ -423,8 +422,7 @@
},
{
ValidTextureOverload::kDimensionsStorageWO2dArray,
- "textureDimensions(t : texture_storage_2d_array<rgba32float>) -> "
- "vec2<i32>",
+ "textureDimensions(t : texture_storage_2d_array<rgba32float>) -> vec2<u32>",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
ast::TextureDimension::k2dArray,
@@ -434,8 +432,7 @@
},
{
ValidTextureOverload::kDimensionsStorageWO3d,
- "textureDimensions(t : texture_storage_3d<rgba32float>) -> "
- "vec3<i32>",
+ "textureDimensions(t : texture_storage_3d<rgba32float>) -> vec3<u32>",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
ast::TextureDimension::k3d,
@@ -788,7 +785,7 @@
},
{
ValidTextureOverload::kNumLayers2dArray,
- "textureNumLayers(t : texture_2d_array<f32>) -> i32",
+ "textureNumLayers(t : texture_2d_array<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -798,7 +795,7 @@
},
{
ValidTextureOverload::kNumLayersCubeArray,
- "textureNumLayers(t : texture_cube_array<f32>) -> i32",
+ "textureNumLayers(t : texture_cube_array<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -808,7 +805,7 @@
},
{
ValidTextureOverload::kNumLayersDepth2dArray,
- "textureNumLayers(t : texture_depth_2d_array) -> i32",
+ "textureNumLayers(t : texture_depth_2d_array) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -818,7 +815,7 @@
},
{
ValidTextureOverload::kNumLayersDepthCubeArray,
- "textureNumLayers(t : texture_depth_cube_array) -> i32",
+ "textureNumLayers(t : texture_depth_cube_array) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -828,7 +825,7 @@
},
{
ValidTextureOverload::kNumLayersStorageWO2dArray,
- "textureNumLayers(t : texture_storage_2d_array<rgba32float>) -> i32",
+ "textureNumLayers(t : texture_storage_2d_array<rgba32float>) -> u32",
ast::Access::kWrite,
ast::TexelFormat::kRgba32Float,
ast::TextureDimension::k2dArray,
@@ -838,7 +835,7 @@
},
{
ValidTextureOverload::kNumLevels2d,
- "textureNumLevels(t : texture_2d<f32>) -> i32",
+ "textureNumLevels(t : texture_2d<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -848,7 +845,7 @@
},
{
ValidTextureOverload::kNumLevels2dArray,
- "textureNumLevels(t : texture_2d_array<f32>) -> i32",
+ "textureNumLevels(t : texture_2d_array<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -858,7 +855,7 @@
},
{
ValidTextureOverload::kNumLevels3d,
- "textureNumLevels(t : texture_3d<f32>) -> i32",
+ "textureNumLevels(t : texture_3d<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::k3d,
@@ -868,7 +865,7 @@
},
{
ValidTextureOverload::kNumLevelsCube,
- "textureNumLevels(t : texture_cube<f32>) -> i32",
+ "textureNumLevels(t : texture_cube<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -878,7 +875,7 @@
},
{
ValidTextureOverload::kNumLevelsCubeArray,
- "textureNumLevels(t : texture_cube_array<f32>) -> i32",
+ "textureNumLevels(t : texture_cube_array<f32>) -> u32",
TextureKind::kRegular,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -888,7 +885,7 @@
},
{
ValidTextureOverload::kNumLevelsDepth2d,
- "textureNumLevels(t : texture_depth_2d) -> i32",
+ "textureNumLevels(t : texture_depth_2d) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -898,7 +895,7 @@
},
{
ValidTextureOverload::kNumLevelsDepth2dArray,
- "textureNumLevels(t : texture_depth_2d_array) -> i32",
+ "textureNumLevels(t : texture_depth_2d_array) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2dArray,
@@ -908,7 +905,7 @@
},
{
ValidTextureOverload::kNumLevelsDepthCube,
- "textureNumLevels(t : texture_depth_cube) -> i32",
+ "textureNumLevels(t : texture_depth_cube) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCube,
@@ -918,7 +915,7 @@
},
{
ValidTextureOverload::kNumLevelsDepthCubeArray,
- "textureNumLevels(t : texture_depth_cube_array) -> i32",
+ "textureNumLevels(t : texture_depth_cube_array) -> u32",
TextureKind::kDepth,
ast::SamplerKind::kSampler,
ast::TextureDimension::kCubeArray,
@@ -928,7 +925,7 @@
},
{
ValidTextureOverload::kNumSamplesMultisampled2d,
- "textureNumSamples(t : texture_multisampled_2d<f32>) -> i32",
+ "textureNumSamples(t : texture_multisampled_2d<f32>) -> u32",
TextureKind::kMultisampled,
ast::SamplerKind::kSampler,
ast::TextureDimension::k2d,
@@ -937,6 +934,16 @@
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
+ ValidTextureOverload::kNumSamplesDepthMultisampled2d,
+ "textureNumSamples(t : texture_depth_multisampled_2d<f32>) -> u32",
+ TextureKind::kMultisampled,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureNumSamples",
+ [](ProgramBuilder* b) { return b->ExprList("texture"); },
+ },
+ {
ValidTextureOverload::kSample1dF32,
"textureSample(t : texture_1d<f32>,\n"
" s : sampler,\n"
@@ -1919,6 +1926,124 @@
},
},
{
+ ValidTextureOverload::kSampleCompareLevelDepth2dF32,
+ "textureSampleCompareLevel(t : texture_depth_2d,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec2<f32>,\n"
+ " depth_ref : f32) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec2<f32>(1_f, 2_f), // coords
+ 3_f); // depth_ref
+ },
+ },
+ {
+ ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32,
+ "textureSampleCompareLevel(t : texture_depth_2d,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec2<f32>,\n"
+ " depth_ref : f32,\n"
+ " offset : vec2<i32>) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec2<f32>(1_f, 2_f), // coords
+ 3_f, // depth_ref
+ b->vec2<i32>(4_i, 5_i)); // offset
+ },
+ },
+ {
+ ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32,
+ "textureSampleCompareLevel(t : texture_depth_2d_array,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec2<f32>,\n"
+ " array_index : i32,\n"
+ " depth_ref : f32) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::k2dArray,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec2<f32>(1_f, 2_f), // coords
+ 3_i, // array_index
+ 4_f); // depth_ref
+ },
+ },
+ {
+ ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32,
+ "textureSampleCompareLevel(t : texture_depth_2d_array,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec2<f32>,\n"
+ " array_index : i32,\n"
+ " depth_ref : f32,\n"
+ " offset : vec2<i32>) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::k2dArray,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec2<f32>(1_f, 2_f), // coords
+ 3_i, // array_index
+ 4_f, // depth_ref
+ b->vec2<i32>(5_i, 6_i)); // offset
+ },
+ },
+ {
+ ValidTextureOverload::kSampleCompareLevelDepthCubeF32,
+ "textureSampleCompareLevel(t : texture_depth_cube,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec3<f32>,\n"
+ " depth_ref : f32) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::kCube,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec3<f32>(1_f, 2_f, 3_f), // coords
+ 4_f); // depth_ref
+ },
+ },
+ {
+ ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32,
+ "textureSampleCompareLevel(t : texture_depth_cube_array,\n"
+ " s : sampler_comparison,\n"
+ " coords : vec3<f32>,\n"
+ " array_index : i32,\n"
+ " depth_ref : f32) -> f32",
+ TextureKind::kDepth,
+ ast::SamplerKind::kComparisonSampler,
+ ast::TextureDimension::kCubeArray,
+ TextureDataType::kF32,
+ "textureSampleCompareLevel",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ "sampler", // s
+ b->vec3<f32>(1_f, 2_f, 3_f), // coords
+ 4_i, // array_index
+ 5_f); // depth_ref
+ },
+ },
+ {
ValidTextureOverload::kLoad1dLevelF32,
"textureLoad(t : texture_1d<f32>,\n"
" coords : u32,\n"
@@ -2182,6 +2307,21 @@
},
},
{
+ ValidTextureOverload::kLoadDepthMultisampled2dF32,
+ "textureLoad(t : texture_depth_multisampled_2d,\n"
+ " coords : vec2<u32>,\n"
+ " sample_index : u32) -> f32",
+ TextureKind::kDepthMultisampled,
+ ast::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<u32>(1_u, 2_u), // coords
+ 3_u); // sample_index
+ },
+ },
+ {
ValidTextureOverload::kStoreWO1dRgba32float,
"textureStore(t : texture_storage_1d<rgba32float>,\n"
" coords : i32,\n"
diff --git a/src/tint/inspector/inspector_test.cc b/src/tint/inspector/inspector_test.cc
index 1daec37..6f3aa93 100644
--- a/src/tint/inspector/inspector_test.cc
+++ b/src/tint/inspector/inspector_test.cc
@@ -1618,7 +1618,7 @@
auto* st_type = MakeStorageTextureTypes(ast::TextureDimension::k2d, ast::TexelFormat::kR32Uint);
AddStorageTexture("st_var", st_type, 4, 0);
- MakeStorageTextureBodyFunction("st_func", "st_var", ty.vec2<i32>(), utils::Empty);
+ MakeStorageTextureBodyFunction("st_func", "st_var", ty.vec2<u32>(), utils::Empty);
MakeCallerBodyFunction("ep_func",
utils::Vector{
@@ -2789,14 +2789,14 @@
const ast::Type* dim_type = nullptr;
switch (dim) {
case ast::TextureDimension::k1d:
- dim_type = ty.i32();
+ dim_type = ty.u32();
break;
case ast::TextureDimension::k2d:
case ast::TextureDimension::k2dArray:
- dim_type = ty.vec2<i32>();
+ dim_type = ty.vec2<u32>();
break;
case ast::TextureDimension::k3d:
- dim_type = ty.vec3<i32>();
+ dim_type = ty.vec3<u32>();
break;
default:
break;
diff --git a/src/tint/intrinsics.def b/src/tint/intrinsics.def
index fcde841..676675f 100644
--- a/src/tint/intrinsics.def
+++ b/src/tint/intrinsics.def
@@ -554,33 +554,33 @@
fn unpack4x8unorm(u32) -> vec4<f32>
@stage("compute") fn workgroupBarrier()
-fn textureDimensions<T: fiu32>(texture: texture_1d<T>) -> i32
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_1d<T>, level: C) -> i32
-fn textureDimensions<T: fiu32>(texture: texture_2d<T>) -> vec2<i32>
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_2d<T>, level: C) -> vec2<i32>
-fn textureDimensions<T: fiu32>(texture: texture_2d_array<T>) -> vec2<i32>
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_2d_array<T>, level: C) -> vec2<i32>
-fn textureDimensions<T: fiu32>(texture: texture_3d<T>) -> vec3<i32>
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_3d<T>, level: C) -> vec3<i32>
-fn textureDimensions<T: fiu32>(texture: texture_cube<T>) -> vec2<i32>
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_cube<T>, level: C) -> vec2<i32>
-fn textureDimensions<T: fiu32>(texture: texture_cube_array<T>) -> vec2<i32>
-fn textureDimensions<T: fiu32, C: iu32>(texture: texture_cube_array<T>, level: C) -> vec2<i32>
-fn textureDimensions<T: fiu32>(texture: texture_multisampled_2d<T>) -> vec2<i32>
-fn textureDimensions(texture: texture_depth_2d) -> vec2<i32>
-fn textureDimensions<C: iu32>(texture: texture_depth_2d, level: C) -> vec2<i32>
-fn textureDimensions(texture: texture_depth_2d_array) -> vec2<i32>
-fn textureDimensions<C: iu32>(texture: texture_depth_2d_array, level: C) -> vec2<i32>
-fn textureDimensions(texture: texture_depth_cube) -> vec2<i32>
-fn textureDimensions<C: iu32>(texture: texture_depth_cube, level: C) -> vec2<i32>
-fn textureDimensions(texture: texture_depth_cube_array) -> vec2<i32>
-fn textureDimensions<C: iu32>(texture: texture_depth_cube_array, level: C) -> vec2<i32>
-fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32>
-fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_1d<F, A>) -> i32
-fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_2d<F, A>) -> vec2<i32>
-fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_2d_array<F, A>) -> vec2<i32>
-fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_3d<F, A>) -> vec3<i32>
-fn textureDimensions(texture: texture_external) -> vec2<i32>
+fn textureDimensions<T: fiu32>(texture: texture_1d<T>) -> u32
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_1d<T>, level: C) -> u32
+fn textureDimensions<T: fiu32>(texture: texture_2d<T>) -> vec2<u32>
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_2d<T>, level: C) -> vec2<u32>
+fn textureDimensions<T: fiu32>(texture: texture_2d_array<T>) -> vec2<u32>
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_2d_array<T>, level: C) -> vec2<u32>
+fn textureDimensions<T: fiu32>(texture: texture_3d<T>) -> vec3<u32>
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_3d<T>, level: C) -> vec3<u32>
+fn textureDimensions<T: fiu32>(texture: texture_cube<T>) -> vec2<u32>
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_cube<T>, level: C) -> vec2<u32>
+fn textureDimensions<T: fiu32>(texture: texture_cube_array<T>) -> vec2<u32>
+fn textureDimensions<T: fiu32, C: iu32>(texture: texture_cube_array<T>, level: C) -> vec2<u32>
+fn textureDimensions<T: fiu32>(texture: texture_multisampled_2d<T>) -> vec2<u32>
+fn textureDimensions(texture: texture_depth_2d) -> vec2<u32>
+fn textureDimensions<C: iu32>(texture: texture_depth_2d, level: C) -> vec2<u32>
+fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
+fn textureDimensions<C: iu32>(texture: texture_depth_2d_array, level: C) -> vec2<u32>
+fn textureDimensions(texture: texture_depth_cube) -> vec2<u32>
+fn textureDimensions<C: iu32>(texture: texture_depth_cube, level: C) -> vec2<u32>
+fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
+fn textureDimensions<C: iu32>(texture: texture_depth_cube_array, level: C) -> vec2<u32>
+fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
+fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_1d<F, A>) -> u32
+fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_2d<F, A>) -> vec2<u32>
+fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_2d_array<F, A>) -> vec2<u32>
+fn textureDimensions<F: texel_format, A: write>(texture: texture_storage_3d<F, A>) -> vec3<u32>
+fn textureDimensions(texture: texture_external) -> vec2<u32>
fn textureGather<T: fiu32, C: iu32>(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>) -> vec4<T>
fn textureGather<T: fiu32, C: iu32>(@const component: C, texture: texture_2d<T>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<T>
fn textureGather<T: fiu32, C: iu32>(@const component: C, texture: texture_2d_array<T>, sampler: sampler, coords: vec2<f32>, array_index: C) -> vec4<T>
@@ -599,23 +599,23 @@
fn textureGatherCompare<C: iu32>(texture: texture_depth_2d_array, sampler: sampler_comparison, coords: vec2<f32>, array_index: C, depth_ref: f32, @const offset: vec2<i32>) -> vec4<f32>
fn textureGatherCompare(texture: texture_depth_cube, sampler: sampler_comparison, coords: vec3<f32>, depth_ref: f32) -> vec4<f32>
fn textureGatherCompare<C: iu32>(texture: texture_depth_cube_array, sampler: sampler_comparison, coords: vec3<f32>, array_index: C, depth_ref: f32) -> vec4<f32>
-fn textureNumLayers<T: fiu32>(texture: texture_2d_array<T>) -> i32
-fn textureNumLayers<T: fiu32>(texture: texture_cube_array<T>) -> i32
-fn textureNumLayers(texture: texture_depth_2d_array) -> i32
-fn textureNumLayers(texture: texture_depth_cube_array) -> i32
-fn textureNumLayers<F: texel_format, A: write>(texture: texture_storage_2d_array<F, A>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_1d<T>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_2d<T>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_2d_array<T>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_3d<T>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_cube<T>) -> i32
-fn textureNumLevels<T: fiu32>(texture: texture_cube_array<T>) -> i32
-fn textureNumLevels(texture: texture_depth_2d) -> i32
-fn textureNumLevels(texture: texture_depth_2d_array) -> i32
-fn textureNumLevels(texture: texture_depth_cube) -> i32
-fn textureNumLevels(texture: texture_depth_cube_array) -> i32
-fn textureNumSamples<T: fiu32>(texture: texture_multisampled_2d<T>) -> i32
-fn textureNumSamples(texture: texture_depth_multisampled_2d) -> i32
+fn textureNumLayers<T: fiu32>(texture: texture_2d_array<T>) -> u32
+fn textureNumLayers<T: fiu32>(texture: texture_cube_array<T>) -> u32
+fn textureNumLayers(texture: texture_depth_2d_array) -> u32
+fn textureNumLayers(texture: texture_depth_cube_array) -> u32
+fn textureNumLayers<F: texel_format, A: write>(texture: texture_storage_2d_array<F, A>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_1d<T>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_2d<T>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_2d_array<T>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_3d<T>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_cube<T>) -> u32
+fn textureNumLevels<T: fiu32>(texture: texture_cube_array<T>) -> u32
+fn textureNumLevels(texture: texture_depth_2d) -> u32
+fn textureNumLevels(texture: texture_depth_2d_array) -> u32
+fn textureNumLevels(texture: texture_depth_cube) -> u32
+fn textureNumLevels(texture: texture_depth_cube_array) -> u32
+fn textureNumSamples<T: fiu32>(texture: texture_multisampled_2d<T>) -> u32
+fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32
@stage("fragment") fn textureSample(texture: texture_1d<f32>, sampler: sampler, coords: f32) -> vec4<f32>
@stage("fragment") fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>) -> vec4<f32>
@stage("fragment") fn textureSample(texture: texture_2d<f32>, sampler: sampler, coords: vec2<f32>, @const offset: vec2<i32>) -> vec4<f32>
diff --git a/src/tint/reader/spirv/function.cc b/src/tint/reader/spirv/function.cc
index e6c73fe..4c71607 100644
--- a/src/tint/reader/spirv/function.cc
+++ b/src/tint/reader/spirv/function.cc
@@ -5709,7 +5709,7 @@
Source{}, builder_.Symbols().Register("textureDimensions"));
ExpressionList dims_args{GetImageExpression(inst)};
if (opcode == SpvOpImageQuerySizeLod) {
- dims_args.Push(ToI32(MakeOperand(inst, 1)).expr);
+ dims_args.Push(MakeOperand(inst, 1).expr);
}
const ast::Expression* dims_call =
create<ast::CallExpression>(Source{}, dims_ident, dims_args);
@@ -5724,18 +5724,29 @@
if (ast::IsTextureArray(dims)) {
auto* layers_ident = create<ast::IdentifierExpression>(
Source{}, builder_.Symbols().Register("textureNumLayers"));
- exprs.Push(create<ast::CallExpression>(Source{}, layers_ident,
- utils::Vector{GetImageExpression(inst)}));
+ auto num_layers = create<ast::CallExpression>(
+ Source{}, layers_ident, utils::Vector{GetImageExpression(inst)});
+ exprs.Push(num_layers);
}
auto* result_type = parser_impl_.ConvertType(inst.type_id());
+ auto* unsigned_type = ty_.AsUnsigned(result_type);
TypedExpression expr = {
- result_type,
- builder_.Construct(Source{}, result_type->Build(builder_), std::move(exprs))};
+ unsigned_type,
+ // If `exprs` holds multiple expressions, then these are the calls to
+ // textureDimensions() and textureNumLayers(), and these need to be placed into a
+ // vector initializer - otherwise, just emit the single expression to omit an
+ // unnecessary cast.
+ (exprs.Length() > 1)
+ ? builder_.Construct(Source{}, unsigned_type->Build(builder_), std::move(exprs))
+ : exprs[0],
+ };
+
+ expr = ToSignedIfUnsigned(expr);
+
return EmitConstDefOrWriteToHoistedVar(inst, expr);
}
case SpvOpImageQueryLod:
- return Fail() << "WGSL does not support querying the level of detail of "
- "an image: "
+ return Fail() << "WGSL does not support querying the level of detail of an image: "
<< inst.PrettyPrint();
case SpvOpImageQueryLevels:
case SpvOpImageQuerySamples: {
@@ -5746,9 +5757,10 @@
const ast::Expression* ast_expr = create<ast::CallExpression>(
Source{}, levels_ident, utils::Vector{GetImageExpression(inst)});
auto* result_type = parser_impl_.ConvertType(inst.type_id());
- // The SPIR-V result type must be integer scalar. The WGSL bulitin
- // returns i32. If they aren't the same then convert the result.
- if (!result_type->Is<I32>()) {
+ // The SPIR-V result type must be integer scalar.
+ // The WGSL bulitin returns u32.
+ // If they aren't the same then convert the result.
+ if (!result_type->Is<U32>()) {
ast_expr = builder_.Construct(Source{}, result_type->Build(builder_),
utils::Vector{ast_expr});
}
diff --git a/src/tint/reader/spirv/function.h b/src/tint/reader/spirv/function.h
index fb4dfcf..755ecc9 100644
--- a/src/tint/reader/spirv/function.h
+++ b/src/tint/reader/spirv/function.h
@@ -956,17 +956,15 @@
ExpressionList MakeCoordinateOperandsForImageAccess(
const spvtools::opt::Instruction& image_access);
- /// Returns the given value as an I32. If it's already an I32 then this
- /// return the given value. Otherwise, wrap the value in a TypeInitializer
- /// expression.
+ /// Returns the given value as an i32. If it's already an i32 then simply returns @p value.
+ /// Otherwise, wrap the value in a TypeInitializer expression.
/// @param value the value to pass through or convert
- /// @returns the value as an I32 value.
+ /// @returns the value as an i32 value.
TypedExpression ToI32(TypedExpression value);
- /// Returns the given value as a signed integer type of the same shape
- /// if the value is unsigned scalar or vector, by wrapping the value
- /// with a TypeInitializer expression. Returns the value itself if the
- /// value otherwise.
+ /// Returns the given value as a signed integer type of the same shape if the value is unsigned
+ /// scalar or vector, by wrapping the value with a TypeInitializer expression. Returns the
+ /// value itself if the value was already signed.
/// @param value the value to pass through or convert
/// @returns the value itself, or converted to signed integral
TypedExpression ToSignedIfUnsigned(TypedExpression value);
diff --git a/src/tint/reader/spirv/parser_impl_handle_test.cc b/src/tint/reader/spirv/parser_impl_handle_test.cc
index f7879f6..4e02d9b 100644
--- a/src/tint/reader/spirv/parser_impl_handle_test.cc
+++ b/src/tint/reader/spirv/parser_impl_handle_test.cc
@@ -2842,7 +2842,7 @@
"%99 = OpImageQuerySize %v3int %im \n"
"%98 = OpImageRead %v4float %im %vi123\n",
R"(@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- R"(let x_99 : vec3<i32> = vec3<i32>(textureDimensions(x_20), textureNumLayers(x_20));)"}
+ R"(let x_99 : vec3<i32> = vec3<i32>(vec3<u32>(textureDimensions(x_20), textureNumLayers(x_20)));)"}
// 3D array storage image doesn't exist.
// Multisampled array
@@ -2898,7 +2898,7 @@
// 2D array
{"%float 2D 0 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n",
R"(@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- R"(let x_99 : vec3<i32> = vec3<i32>(textureDimensions(x_20, i1), textureNumLayers(x_20));)"},
+ R"(let x_99 : vec3<i32> = vec3<i32>(vec3<u32>(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"},
// There is no 3D array
@@ -2909,12 +2909,12 @@
// https://github.com/gpuweb/gpuweb/issues/1345
{"%float Cube 0 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n",
R"(@group(2) @binding(1) var x_20 : texture_cube_array<f32>;)",
- R"(let x_99 : vec3<i32> = vec3<i32>(textureDimensions(x_20, i1).xy, textureNumLayers(x_20));)"},
+ R"(let x_99 : vec3<i32> = vec3<i32>(vec3<u32>(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"},
// Depth 2D array
{"%float 2D 1 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_2d_array;)",
- R"(let x_99 : vec3<i32> = vec3<i32>(textureDimensions(x_20, i1), textureNumLayers(x_20));)"},
+ R"(let x_99 : vec3<i32> = vec3<i32>(vec3<u32>(textureDimensions(x_20, i1), textureNumLayers(x_20)));)"},
// Depth Cube Array
//
@@ -2923,19 +2923,17 @@
// https://github.com/gpuweb/gpuweb/issues/1345
{"%float Cube 1 1 0 1 Unknown", "%99 = OpImageQuerySizeLod %v3int %im %i1\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_cube_array;)",
- R"(let x_99 : vec3<i32> = vec3<i32>(textureDimensions(x_20, i1).xy, textureNumLayers(x_20));)"}}));
+ R"(let x_99 : vec3<i32> = vec3<i32>(vec3<u32>(textureDimensions(x_20, i1).xy, textureNumLayers(x_20)));)"}}));
INSTANTIATE_TEST_SUITE_P(
- // When the level-of-detail value is given as an unsigned
- // integer, we must convert it before using it as an argument
- // to textureDimensions.
+ // textureDimensions accepts both signed and unsigned the level-of-detail values.
ImageQuerySizeLod_NonArrayed_SignedResult_UnsignedLevel,
SpvParserHandleTest_SampledImageAccessTest,
::testing::ValuesIn(std::vector<ImageAccessCase>{
{"%float 1D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %int %im %u1\n",
R"(@group(2) @binding(1) var x_20 : texture_1d<f32>;)",
- R"(let x_99 : i32 = i32(textureDimensions(x_20, i32(u1)));)"}}));
+ R"(let x_99 : i32 = i32(textureDimensions(x_20, u1));)"}}));
INSTANTIATE_TEST_SUITE_P(
// When SPIR-V wants the result type to be unsigned, we have to
@@ -2948,7 +2946,7 @@
{"%float 1D 0 0 0 1 Unknown", "%99 = OpImageQuerySizeLod %uint %im %i1\n",
R"(@group(2) @binding(1) var x_20 : texture_1d<f32>;)",
- R"(let x_99 : u32 = u32(textureDimensions(x_20, i1));)"}}));
+ R"(let x_99 : i32 = i32(textureDimensions(x_20, i1));)"}}));
INSTANTIATE_TEST_SUITE_P(ImageQueryLevels_SignedResult,
SpvParserHandleTest_SampledImageAccessTest,
@@ -2961,47 +2959,47 @@
// 2D
{"%float 2D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// 2D array
{"%float 2D 0 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_2d_array<f32>;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// 3D
{"%float 3D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_3d<f32>;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// Cube
{"%float Cube 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_cube<f32>;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// Cube array
{"%float Cube 0 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_cube_array<f32>;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// depth 2d
{"%float 2D 1 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_2d;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// depth 2d array
{"%float 2D 1 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_2d_array;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// depth cube
{"%float Cube 1 0 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_cube;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"},
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"},
// depth cube array
{"%float Cube 1 1 0 1 Unknown", "%99 = OpImageQueryLevels %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_depth_cube_array;)",
- R"(let x_99 : i32 = textureNumLevels(x_20);)"}}));
+ R"(let x_99 : i32 = i32(textureNumLevels(x_20));)"}}));
INSTANTIATE_TEST_SUITE_P(
// Spot check that a type conversion is inserted when SPIR-V asks for
@@ -3011,7 +3009,7 @@
::testing::ValuesIn(std::vector<ImageAccessCase>{
{"%float 2D 0 0 0 1 Unknown", "%99 = OpImageQueryLevels %uint %im\n",
R"(@group(2) @binding(1) var x_20 : texture_2d<f32>;)",
- R"(let x_99 : u32 = u32(textureNumLevels(x_20));)"}}));
+ R"(let x_99 : u32 = textureNumLevels(x_20);)"}}));
INSTANTIATE_TEST_SUITE_P(ImageQuerySamples_SignedResult,
SpvParserHandleTest_SampledImageAccessTest,
@@ -3019,21 +3017,21 @@
// Multsample 2D
{"%float 2D 0 0 1 1 Unknown", "%99 = OpImageQuerySamples %int %im\n",
R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d<f32>;)",
- R"(let x_99 : i32 = textureNumSamples(x_20);)"} // namespace
+ R"(let x_99 : i32 = i32(textureNumSamples(x_20));)"}
// Multisample 2D array
// Not in WebGPU
}));
INSTANTIATE_TEST_SUITE_P(
- // Translation must inject a type coersion from signed to unsigned.
+ // Translation must inject a type coersion from unsigned to signed.
ImageQuerySamples_UnsignedResult,
SpvParserHandleTest_SampledImageAccessTest,
::testing::ValuesIn(std::vector<ImageAccessCase>{
- // Multsample 2D
+ // Multisample 2D
{"%float 2D 0 0 1 1 Unknown", "%99 = OpImageQuerySamples %uint %im\n",
R"(@group(2) @binding(1) var x_20 : texture_multisampled_2d<f32>;)",
- R"(let x_99 : u32 = u32(textureNumSamples(x_20));)"}
+ R"(let x_99 : u32 = textureNumSamples(x_20);)"}
// Multisample 2D array
// Not in WebGPU
diff --git a/src/tint/reader/spirv/parser_type.cc b/src/tint/reader/spirv/parser_type.cc
index ff4b96e..04036f2 100644
--- a/src/tint/reader/spirv/parser_type.cc
+++ b/src/tint/reader/spirv/parser_type.cc
@@ -444,6 +444,20 @@
return state->i32_;
}
+const Type* TypeManager::AsUnsigned(const Type* ty) {
+ return Switch(
+ ty, //
+ [&](const spirv::I32*) { return U32(); }, //
+ [&](const spirv::U32*) { return ty; }, //
+ [&](const spirv::Vector* vec) {
+ return Switch(
+ vec->type, //
+ [&](const spirv::I32*) { return Vector(U32(), vec->size); }, //
+ [&](const spirv::U32*) { return ty; } //
+ );
+ });
+}
+
const spirv::Pointer* TypeManager::Pointer(const Type* el,
ast::AddressSpace address_space,
ast::Access access) {
diff --git a/src/tint/reader/spirv/parser_type.h b/src/tint/reader/spirv/parser_type.h
index 48b6f3f..43c311c 100644
--- a/src/tint/reader/spirv/parser_type.h
+++ b/src/tint/reader/spirv/parser_type.h
@@ -539,6 +539,11 @@
const spirv::F32* F32();
/// @return a I32 type. Repeated calls will return the same pointer.
const spirv::I32* I32();
+ /// @param ty the input type.
+ /// @returns the equivalent unsigned integer scalar or vector if @p ty is a scalar or vector,
+ /// otherwise nullptr.
+ const Type* AsUnsigned(const Type* ty);
+
/// @param ty the store type
/// @param address_space the pointer address space
/// @param access the declared access mode
diff --git a/src/tint/resolver/builtin_test.cc b/src/tint/resolver/builtin_test.cc
index 79eb075..7c15767 100644
--- a/src/tint/resolver/builtin_test.cc
+++ b/src/tint/resolver/builtin_test.cc
@@ -2416,17 +2416,17 @@
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
case ValidTextureOverload::kSampleCompareLevelDepth2dF32:
- return R"(textureSampleCompare(texture, sampler, coords, depth_ref))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, depth_ref))";
case ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32:
- return R"(textureSampleCompare(texture, sampler, coords, depth_ref, offset))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, depth_ref, offset))";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32:
- return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, array_index, depth_ref))";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32:
- return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref, offset))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, array_index, depth_ref, offset))";
case ValidTextureOverload::kSampleCompareLevelDepthCubeF32:
- return R"(textureSampleCompare(texture, sampler, coords, depth_ref))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, depth_ref))";
case ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32:
- return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
+ return R"(textureSampleCompareLevel(texture, sampler, coords, array_index, depth_ref))";
case ValidTextureOverload::kLoad1dLevelF32:
case ValidTextureOverload::kLoad1dLevelU32:
case ValidTextureOverload::kLoad1dLevelI32:
@@ -2478,7 +2478,7 @@
default:
FAIL() << "invalid texture dimensions: " << param.texture_dimension;
case ast::TextureDimension::k1d:
- EXPECT_TRUE(TypeOf(call)->Is<sem::I32>());
+ EXPECT_TRUE(TypeOf(call)->Is<sem::U32>());
break;
case ast::TextureDimension::k2d:
case ast::TextureDimension::k2dArray:
@@ -2487,23 +2487,23 @@
auto* vec = As<sem::Vector>(TypeOf(call));
ASSERT_NE(vec, nullptr);
EXPECT_EQ(vec->Width(), 2u);
- EXPECT_TRUE(vec->type()->Is<sem::I32>());
+ EXPECT_TRUE(vec->type()->Is<sem::U32>());
break;
}
case ast::TextureDimension::k3d: {
auto* vec = As<sem::Vector>(TypeOf(call));
ASSERT_NE(vec, nullptr);
EXPECT_EQ(vec->Width(), 3u);
- EXPECT_TRUE(vec->type()->Is<sem::I32>());
+ EXPECT_TRUE(vec->type()->Is<sem::U32>());
break;
}
}
} else if (std::string(param.function) == "textureNumLayers") {
- EXPECT_TRUE(TypeOf(call)->Is<sem::I32>());
+ EXPECT_TRUE(TypeOf(call)->Is<sem::U32>());
} else if (std::string(param.function) == "textureNumLevels") {
- EXPECT_TRUE(TypeOf(call)->Is<sem::I32>());
+ EXPECT_TRUE(TypeOf(call)->Is<sem::U32>());
} else if (std::string(param.function) == "textureNumSamples") {
- EXPECT_TRUE(TypeOf(call)->Is<sem::I32>());
+ EXPECT_TRUE(TypeOf(call)->Is<sem::U32>());
} else if (std::string(param.function) == "textureStore") {
EXPECT_TRUE(TypeOf(call)->Is<sem::Void>());
} else if (std::string(param.function) == "textureGather") {
diff --git a/src/tint/resolver/intrinsic_table.inl b/src/tint/resolver/intrinsic_table.inl
index c59280a..7f9f3ba 100644
--- a/src/tint/resolver/intrinsic_table.inl
+++ b/src/tint/resolver/intrinsic_table.inl
@@ -8276,7 +8276,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[839],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8288,7 +8288,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[623],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8300,7 +8300,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[838],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8312,7 +8312,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[627],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8324,7 +8324,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[837],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8336,7 +8336,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[631],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8348,7 +8348,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[836],
- /* return matcher indices */ &kMatcherIndices[108],
+ /* return matcher indices */ &kMatcherIndices[114],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8360,7 +8360,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[635],
- /* return matcher indices */ &kMatcherIndices[108],
+ /* return matcher indices */ &kMatcherIndices[114],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8372,7 +8372,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[835],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8384,7 +8384,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[639],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8396,7 +8396,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[834],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8408,7 +8408,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[643],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8420,7 +8420,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[833],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8432,7 +8432,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[832],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8444,7 +8444,7 @@
/* template types */ &kTemplateTypes[1],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[687],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8456,7 +8456,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[831],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8468,7 +8468,7 @@
/* template types */ &kTemplateTypes[1],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[653],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8480,7 +8480,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[830],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8492,7 +8492,7 @@
/* template types */ &kTemplateTypes[1],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[657],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8504,7 +8504,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[829],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8516,7 +8516,7 @@
/* template types */ &kTemplateTypes[1],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[605],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8528,7 +8528,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[828],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8540,7 +8540,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[827],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8552,7 +8552,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[826],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8564,7 +8564,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[825],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8576,7 +8576,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[824],
- /* return matcher indices */ &kMatcherIndices[108],
+ /* return matcher indices */ &kMatcherIndices[114],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -8588,7 +8588,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[823],
- /* return matcher indices */ &kMatcherIndices[126],
+ /* return matcher indices */ &kMatcherIndices[124],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9560,7 +9560,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[817],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9572,7 +9572,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[816],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9584,7 +9584,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[815],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9596,7 +9596,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[814],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9608,7 +9608,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[813],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9620,7 +9620,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[812],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9632,7 +9632,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[811],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9644,7 +9644,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[810],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9656,7 +9656,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[809],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -9668,7 +9668,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[808],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -11180,7 +11180,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[822],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -11192,7 +11192,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[821],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -11204,7 +11204,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[820],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -11216,7 +11216,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[819],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -11228,7 +11228,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[3],
/* parameters */ &kParameters[818],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -12932,7 +12932,7 @@
/* template types */ &kTemplateTypes[0],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[988],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -12944,7 +12944,7 @@
/* template types */ &kTemplateTypes[28],
/* template numbers */ &kTemplateNumbers[10],
/* parameters */ &kParameters[807],
- /* return matcher indices */ &kMatcherIndices[34],
+ /* return matcher indices */ &kMatcherIndices[35],
/* flags */ OverloadFlags(OverloadFlag::kIsBuiltin, OverloadFlag::kSupportsVertexPipeline, OverloadFlag::kSupportsFragmentPipeline, OverloadFlag::kSupportsComputePipeline),
/* const eval */ nullptr,
},
@@ -14499,33 +14499,33 @@
},
{
/* [85] */
- /* fn textureDimensions<T : fiu32>(texture: texture_1d<T>) -> i32 */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_1d<T>, level: C) -> i32 */
- /* fn textureDimensions<T : fiu32>(texture: texture_2d<T>) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_2d<T>, level: C) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_2d_array<T>) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_2d_array<T>, level: C) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_3d<T>) -> vec3<i32> */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_3d<T>, level: C) -> vec3<i32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_cube<T>) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_cube<T>, level: C) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_cube_array<T>) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_cube_array<T>, level: C) -> vec2<i32> */
- /* fn textureDimensions<T : fiu32>(texture: texture_multisampled_2d<T>) -> vec2<i32> */
- /* fn textureDimensions(texture: texture_depth_2d) -> vec2<i32> */
- /* fn textureDimensions<C : iu32>(texture: texture_depth_2d, level: C) -> vec2<i32> */
- /* fn textureDimensions(texture: texture_depth_2d_array) -> vec2<i32> */
- /* fn textureDimensions<C : iu32>(texture: texture_depth_2d_array, level: C) -> vec2<i32> */
- /* fn textureDimensions(texture: texture_depth_cube) -> vec2<i32> */
- /* fn textureDimensions<C : iu32>(texture: texture_depth_cube, level: C) -> vec2<i32> */
- /* fn textureDimensions(texture: texture_depth_cube_array) -> vec2<i32> */
- /* fn textureDimensions<C : iu32>(texture: texture_depth_cube_array, level: C) -> vec2<i32> */
- /* fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32> */
- /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_1d<F, A>) -> i32 */
- /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_2d<F, A>) -> vec2<i32> */
- /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_2d_array<F, A>) -> vec2<i32> */
- /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_3d<F, A>) -> vec3<i32> */
- /* fn textureDimensions(texture: texture_external) -> vec2<i32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_1d<T>) -> u32 */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_1d<T>, level: C) -> u32 */
+ /* fn textureDimensions<T : fiu32>(texture: texture_2d<T>) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_2d<T>, level: C) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_2d_array<T>) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_2d_array<T>, level: C) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_3d<T>) -> vec3<u32> */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_3d<T>, level: C) -> vec3<u32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_cube<T>) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_cube<T>, level: C) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_cube_array<T>) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32, C : iu32>(texture: texture_cube_array<T>, level: C) -> vec2<u32> */
+ /* fn textureDimensions<T : fiu32>(texture: texture_multisampled_2d<T>) -> vec2<u32> */
+ /* fn textureDimensions(texture: texture_depth_2d) -> vec2<u32> */
+ /* fn textureDimensions<C : iu32>(texture: texture_depth_2d, level: C) -> vec2<u32> */
+ /* fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32> */
+ /* fn textureDimensions<C : iu32>(texture: texture_depth_2d_array, level: C) -> vec2<u32> */
+ /* fn textureDimensions(texture: texture_depth_cube) -> vec2<u32> */
+ /* fn textureDimensions<C : iu32>(texture: texture_depth_cube, level: C) -> vec2<u32> */
+ /* fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32> */
+ /* fn textureDimensions<C : iu32>(texture: texture_depth_cube_array, level: C) -> vec2<u32> */
+ /* fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32> */
+ /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_1d<F, A>) -> u32 */
+ /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_2d<F, A>) -> vec2<u32> */
+ /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_2d_array<F, A>) -> vec2<u32> */
+ /* fn textureDimensions<F : texel_format, A : write>(texture: texture_storage_3d<F, A>) -> vec3<u32> */
+ /* fn textureDimensions(texture: texture_external) -> vec2<u32> */
/* num overloads */ 27,
/* overloads */ &kOverloads[0],
},
@@ -14559,33 +14559,33 @@
},
{
/* [88] */
- /* fn textureNumLayers<T : fiu32>(texture: texture_2d_array<T>) -> i32 */
- /* fn textureNumLayers<T : fiu32>(texture: texture_cube_array<T>) -> i32 */
- /* fn textureNumLayers(texture: texture_depth_2d_array) -> i32 */
- /* fn textureNumLayers(texture: texture_depth_cube_array) -> i32 */
- /* fn textureNumLayers<F : texel_format, A : write>(texture: texture_storage_2d_array<F, A>) -> i32 */
+ /* fn textureNumLayers<T : fiu32>(texture: texture_2d_array<T>) -> u32 */
+ /* fn textureNumLayers<T : fiu32>(texture: texture_cube_array<T>) -> u32 */
+ /* fn textureNumLayers(texture: texture_depth_2d_array) -> u32 */
+ /* fn textureNumLayers(texture: texture_depth_cube_array) -> u32 */
+ /* fn textureNumLayers<F : texel_format, A : write>(texture: texture_storage_2d_array<F, A>) -> u32 */
/* num overloads */ 5,
/* overloads */ &kOverloads[242],
},
{
/* [89] */
- /* fn textureNumLevels<T : fiu32>(texture: texture_1d<T>) -> i32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_2d<T>) -> i32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_2d_array<T>) -> i32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_3d<T>) -> i32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_cube<T>) -> i32 */
- /* fn textureNumLevels<T : fiu32>(texture: texture_cube_array<T>) -> i32 */
- /* fn textureNumLevels(texture: texture_depth_2d) -> i32 */
- /* fn textureNumLevels(texture: texture_depth_2d_array) -> i32 */
- /* fn textureNumLevels(texture: texture_depth_cube) -> i32 */
- /* fn textureNumLevels(texture: texture_depth_cube_array) -> i32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_1d<T>) -> u32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_2d<T>) -> u32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_2d_array<T>) -> u32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_3d<T>) -> u32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_cube<T>) -> u32 */
+ /* fn textureNumLevels<T : fiu32>(texture: texture_cube_array<T>) -> u32 */
+ /* fn textureNumLevels(texture: texture_depth_2d) -> u32 */
+ /* fn textureNumLevels(texture: texture_depth_2d_array) -> u32 */
+ /* fn textureNumLevels(texture: texture_depth_cube) -> u32 */
+ /* fn textureNumLevels(texture: texture_depth_cube_array) -> u32 */
/* num overloads */ 10,
/* overloads */ &kOverloads[107],
},
{
/* [90] */
- /* fn textureNumSamples<T : fiu32>(texture: texture_multisampled_2d<T>) -> i32 */
- /* fn textureNumSamples(texture: texture_depth_multisampled_2d) -> i32 */
+ /* fn textureNumSamples<T : fiu32>(texture: texture_multisampled_2d<T>) -> u32 */
+ /* fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32 */
/* num overloads */ 2,
/* overloads */ &kOverloads[388],
},
diff --git a/src/tint/resolver/intrinsic_table_test.cc b/src/tint/resolver/intrinsic_table_test.cc
index 05b34cc..223b180 100644
--- a/src/tint/resolver/intrinsic_table_test.cc
+++ b/src/tint/resolver/intrinsic_table_test.cc
@@ -596,33 +596,33 @@
R"(error: no matching call to textureDimensions(bool, bool)
27 candidate functions:
- textureDimensions(texture: texture_1d<T>, level: C) -> i32 where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_2d<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_2d_array<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_3d<T>, level: C) -> vec3<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_cube<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_cube_array<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_depth_2d, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_2d_array, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_cube, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_cube_array, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_1d<T>) -> i32 where: T is f32, i32 or u32
- textureDimensions(texture: texture_2d<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_2d_array<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_3d<T>) -> vec3<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_cube<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_cube_array<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_multisampled_2d<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_depth_2d) -> vec2<i32>
- textureDimensions(texture: texture_depth_2d_array) -> vec2<i32>
- textureDimensions(texture: texture_depth_cube) -> vec2<i32>
- textureDimensions(texture: texture_depth_cube_array) -> vec2<i32>
- textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32>
- textureDimensions(texture: texture_storage_1d<F, A>) -> i32 where: A is write
- textureDimensions(texture: texture_storage_2d<F, A>) -> vec2<i32> where: A is write
- textureDimensions(texture: texture_storage_2d_array<F, A>) -> vec2<i32> where: A is write
- textureDimensions(texture: texture_storage_3d<F, A>) -> vec3<i32> where: A is write
- textureDimensions(texture: texture_external) -> vec2<i32>
+ textureDimensions(texture: texture_1d<T>, level: C) -> u32 where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_2d<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_2d_array<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_3d<T>, level: C) -> vec3<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_cube<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_cube_array<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_depth_2d, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_2d_array, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_cube, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_cube_array, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_1d<T>) -> u32 where: T is f32, i32 or u32
+ textureDimensions(texture: texture_2d<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_2d_array<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_3d<T>) -> vec3<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_cube<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_cube_array<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_multisampled_2d<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_depth_2d) -> vec2<u32>
+ textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
+ textureDimensions(texture: texture_depth_cube) -> vec2<u32>
+ textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
+ textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
+ textureDimensions(texture: texture_storage_1d<F, A>) -> u32 where: A is write
+ textureDimensions(texture: texture_storage_2d<F, A>) -> vec2<u32> where: A is write
+ textureDimensions(texture: texture_storage_2d_array<F, A>) -> vec2<u32> where: A is write
+ textureDimensions(texture: texture_storage_3d<F, A>) -> vec3<u32> where: A is write
+ textureDimensions(texture: texture_external) -> vec2<u32>
)");
}
@@ -635,33 +635,33 @@
R"(error: no matching call to textureDimensions(texture_depth_2d, bool)
27 candidate functions:
- textureDimensions(texture: texture_depth_2d, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_1d<T>, level: C) -> i32 where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_2d<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_2d_array<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_3d<T>, level: C) -> vec3<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_cube<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_cube_array<T>, level: C) -> vec2<i32> where: T is f32, i32 or u32, C is i32 or u32
- textureDimensions(texture: texture_depth_2d_array, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_cube, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_cube_array, level: C) -> vec2<i32> where: C is i32 or u32
- textureDimensions(texture: texture_depth_2d) -> vec2<i32>
- textureDimensions(texture: texture_1d<T>) -> i32 where: T is f32, i32 or u32
- textureDimensions(texture: texture_2d<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_2d_array<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_3d<T>) -> vec3<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_cube<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_cube_array<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_multisampled_2d<T>) -> vec2<i32> where: T is f32, i32 or u32
- textureDimensions(texture: texture_depth_2d_array) -> vec2<i32>
- textureDimensions(texture: texture_depth_cube) -> vec2<i32>
- textureDimensions(texture: texture_depth_cube_array) -> vec2<i32>
- textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32>
- textureDimensions(texture: texture_storage_1d<F, A>) -> i32 where: A is write
- textureDimensions(texture: texture_storage_2d<F, A>) -> vec2<i32> where: A is write
- textureDimensions(texture: texture_storage_2d_array<F, A>) -> vec2<i32> where: A is write
- textureDimensions(texture: texture_storage_3d<F, A>) -> vec3<i32> where: A is write
- textureDimensions(texture: texture_external) -> vec2<i32>
+ textureDimensions(texture: texture_depth_2d, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_1d<T>, level: C) -> u32 where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_2d<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_2d_array<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_3d<T>, level: C) -> vec3<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_cube<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_cube_array<T>, level: C) -> vec2<u32> where: T is f32, i32 or u32, C is i32 or u32
+ textureDimensions(texture: texture_depth_2d_array, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_cube, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_cube_array, level: C) -> vec2<u32> where: C is i32 or u32
+ textureDimensions(texture: texture_depth_2d) -> vec2<u32>
+ textureDimensions(texture: texture_1d<T>) -> u32 where: T is f32, i32 or u32
+ textureDimensions(texture: texture_2d<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_2d_array<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_3d<T>) -> vec3<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_cube<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_cube_array<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_multisampled_2d<T>) -> vec2<u32> where: T is f32, i32 or u32
+ textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
+ textureDimensions(texture: texture_depth_cube) -> vec2<u32>
+ textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
+ textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
+ textureDimensions(texture: texture_storage_1d<F, A>) -> u32 where: A is write
+ textureDimensions(texture: texture_storage_2d<F, A>) -> vec2<u32> where: A is write
+ textureDimensions(texture: texture_storage_2d_array<F, A>) -> vec2<u32> where: A is write
+ textureDimensions(texture: texture_storage_3d<F, A>) -> vec3<u32> where: A is write
+ textureDimensions(texture: texture_external) -> vec2<u32>
)");
}
diff --git a/src/tint/transform/multiplanar_external_texture_test.cc b/src/tint/transform/multiplanar_external_texture_test.cc
index 49e26df..dacbb1e 100644
--- a/src/tint/transform/multiplanar_external_texture_test.cc
+++ b/src/tint/transform/multiplanar_external_texture_test.cc
@@ -138,7 +138,7 @@
@fragment
fn main(@builtin(position) coord : vec4<f32>) -> @location(0) vec4<f32> {
- var dim : vec2<i32>;
+ var dim : vec2<u32>;
dim = textureDimensions(ext_tex);
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
@@ -173,7 +173,7 @@
@fragment
fn main(@builtin(position) coord : vec4<f32>) -> @location(0) vec4<f32> {
- var dim : vec2<i32>;
+ var dim : vec2<u32>;
dim = textureDimensions(ext_tex);
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
@@ -191,7 +191,7 @@
auto* src = R"(
@fragment
fn main(@builtin(position) coord : vec4<f32>) -> @location(0) vec4<f32> {
- var dim : vec2<i32>;
+ var dim : vec2<u32>;
dim = textureDimensions(ext_tex);
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
@@ -226,7 +226,7 @@
@fragment
fn main(@builtin(position) coord : vec4<f32>) -> @location(0) vec4<f32> {
- var dim : vec2<i32>;
+ var dim : vec2<u32>;
dim = textureDimensions(ext_tex);
return vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
@@ -2006,7 +2006,7 @@
// even if there's no external texture declared at module scope.
TEST_F(MultiplanarExternalTextureTest, ExternalTexturePassedAsParamWithoutGlobalDecl) {
auto* src = R"(
-fn f(ext_tex : texture_external) -> vec2<i32> {
+fn f(ext_tex : texture_external) -> vec2<u32> {
return textureDimensions(ext_tex);
}
)";
@@ -2032,7 +2032,7 @@
gamutConversionMatrix : mat3x3<f32>,
}
-fn f(ext_tex : texture_2d<f32>, ext_tex_plane_1 : texture_2d<f32>, ext_tex_params : ExternalTextureParams) -> vec2<i32> {
+fn f(ext_tex : texture_2d<f32>, ext_tex_plane_1 : texture_2d<f32>, ext_tex_params : ExternalTextureParams) -> vec2<u32> {
return textureDimensions(ext_tex);
}
)";
diff --git a/src/tint/writer/glsl/generator_impl.cc b/src/tint/writer/glsl/generator_impl.cc
index b2652e2..ab78722 100644
--- a/src/tint/writer/glsl/generator_impl.cc
+++ b/src/tint/writer/glsl/generator_impl.cc
@@ -1345,6 +1345,16 @@
}
};
+ auto emit_unsigned_int_type = [&](const sem::Type* ty) {
+ uint32_t width = 0;
+ sem::Type::ElementOf(ty, &width);
+ if (width > 1) {
+ out << "uvec" << width;
+ } else {
+ out << "uint";
+ }
+ };
+
auto emit_expr_as_signed = [&](const ast::Expression* e) {
auto* ty = TypeOf(e)->UnwrapRef();
if (!ty->is_unsigned_scalar_or_vector()) {
@@ -1357,6 +1367,12 @@
switch (builtin->Type()) {
case sem::BuiltinType::kTextureDimensions: {
+ // textureDimensions() returns an unsigned scalar / vector in WGSL.
+ // textureSize() / imageSize() returns a signed scalar / vector in GLSL.
+ // Cast.
+ emit_unsigned_int_type(call->Type());
+ ScopedParen sp(out);
+
if (texture_type->Is<sem::StorageTexture>()) {
out << "imageSize(";
} else {
@@ -1390,6 +1406,12 @@
return true;
}
case sem::BuiltinType::kTextureNumLayers: {
+ // textureNumLayers() returns an unsigned scalar in WGSL.
+ // textureSize() / imageSize() returns a signed scalar / vector in GLSL.
+ // Cast.
+ out << "uint";
+ ScopedParen sp(out);
+
if (texture_type->Is<sem::StorageTexture>()) {
out << "imageSize(";
} else {
@@ -1418,6 +1440,12 @@
return true;
}
case sem::BuiltinType::kTextureNumLevels: {
+ // textureNumLevels() returns an unsigned scalar in WGSL.
+ // textureQueryLevels() returns a signed scalar in GLSL.
+ // Cast.
+ out << "uint";
+ ScopedParen sp(out);
+
out << "textureQueryLevels(";
if (!EmitExpression(out, texture)) {
return false;
@@ -1426,6 +1454,12 @@
return true;
}
case sem::BuiltinType::kTextureNumSamples: {
+ // textureNumSamples() returns an unsigned scalar in WGSL.
+ // textureSamples() returns a signed scalar in GLSL.
+ // Cast.
+ out << "uint";
+ ScopedParen sp(out);
+
out << "textureSamples(";
if (!EmitExpression(out, texture)) {
return false;
diff --git a/src/tint/writer/glsl/generator_impl_builtin_texture_test.cc b/src/tint/writer/glsl/generator_impl_builtin_texture_test.cc
index 3a39762..8fc9844 100644
--- a/src/tint/writer/glsl/generator_impl_builtin_texture_test.cc
+++ b/src/tint/writer/glsl/generator_impl_builtin_texture_test.cc
@@ -219,15 +219,15 @@
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture(tint_symbol_sampler, vec4(1.0f, 2.0f, 3.0f, float(4)), 5.0f);)";
case ValidTextureOverload::kSampleCompareLevelDepth2dF32:
- return R"(yyytexture(tint_symbol_sampler, vec2(1.0f, 2.0f), 3.0f);)";
+ return R"(texture(tint_symbol_sampler, vec3(1.0f, 2.0f, 3.0f));)";
case ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32:
- return R"(yyytextureOffset(tint_symbol_sampler, vec2(1.0f, 2.0f), 3.0f, ivec2(4, 5));)";
+ return R"(textureOffset(tint_symbol_sampler, vec3(1.0f, 2.0f, 3.0f), ivec2(4, 5));)";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32:
- return R"(texture(tint_symbol_sampler, vec4(1.0f, 2.0f, float(4)), 3.0f);)";
+ return R"(texture(tint_symbol_sampler, vec4(1.0f, 2.0f, float(3), 4.0f));)";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32:
- return R"(textureOffset(tint_symbol_sampler, vec3(1.0f, 2.0f, float(4)), 3.0f, ivec2(5, 6));)";
+ return R"(textureOffset(tint_symbol_sampler, vec4(1.0f, 2.0f, float(3), 4.0f), ivec2(5, 6));)";
case ValidTextureOverload::kSampleCompareLevelDepthCubeF32:
- return R"(texture(tint_symbol_sampler, vec3(1.0f, 2.0f, 3.0f), 4.0f);)";
+ return R"(texture(tint_symbol_sampler, vec4(1.0f, 2.0f, 3.0f, 4.0f));)";
case ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32:
return R"(texture(tint_symbol_sampler, vec4(1.0f, 2.0f, 3.0f, float(4)), 5.0f);)";
case ValidTextureOverload::kLoad1dLevelF32:
@@ -248,7 +248,6 @@
case ValidTextureOverload::kLoad2dArrayLevelI32:
case ValidTextureOverload::kLoad3dLevelI32:
return R"(texelFetch(tint_symbol_2, ivec3(uvec3(1u, 2u, 3u)), int(4u));)";
- case ValidTextureOverload::kLoadDepthMultisampled2dF32:
case ValidTextureOverload::kLoadMultisampled2dF32:
case ValidTextureOverload::kLoadMultisampled2dU32:
return R"(texelFetch(tint_symbol_2, ivec2(1, 2), 3);)";
@@ -258,6 +257,8 @@
return R"(texelFetch(tint_symbol_2, ivec2(1, 2), 3);)";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(texelFetch(tint_symbol_2, ivec3(uvec3(1u, 2u, 3u)), int(4u));)";
+ case ValidTextureOverload::kLoadDepthMultisampled2dF32:
+ return R"(texelFetch(tint_symbol_2, ivec2(uvec2(1u, 2u)), int(3u)).x;)";
case ValidTextureOverload::kStoreWO1dRgba32float:
return R"(imageStore(tint_symbol, 1, vec4(2.0f, 3.0f, 4.0f, 5.0f));)";
case ValidTextureOverload::kStoreWO2dRgba32float:
diff --git a/src/tint/writer/hlsl/generator_impl_builtin_texture_test.cc b/src/tint/writer/hlsl/generator_impl_builtin_texture_test.cc
index 5b15c02..4b15133 100644
--- a/src/tint/writer/hlsl/generator_impl_builtin_texture_test.cc
+++ b/src/tint/writer/hlsl/generator_impl_builtin_texture_test.cc
@@ -315,9 +315,9 @@
case ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32:
return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float2(1.0f, 2.0f), 3.0f, int2(4, 5));)";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32:
- return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float3(1.0f, 2.0f, float(4)), 3.0f);)";
+ return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float3(1.0f, 2.0f, float(3)), 4.0f);)";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32:
- return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float3(1.0f, 2.0f, float(4)), 3.0f, int2(5, 6));)";
+ return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float3(1.0f, 2.0f, float(3)), 4.0f, int2(5, 6));)";
case ValidTextureOverload::kSampleCompareLevelDepthCubeF32:
return R"(tint_symbol.SampleCmpLevelZero(tint_symbol_1, float3(1.0f, 2.0f, 3.0f), 4.0f);)";
case ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32:
@@ -340,7 +340,6 @@
case ValidTextureOverload::kLoad2dArrayLevelI32:
case ValidTextureOverload::kLoad3dLevelI32:
return R"(tint_symbol.Load(uint4(1u, 2u, 3u, 4u));)";
- case ValidTextureOverload::kLoadDepthMultisampled2dF32:
case ValidTextureOverload::kLoadMultisampled2dF32:
case ValidTextureOverload::kLoadMultisampled2dU32:
return R"(tint_symbol.Load(int2(1, 2), 3);)";
@@ -350,6 +349,8 @@
return R"(tint_symbol.Load(int3(1, 2, 3)).x;)";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(tint_symbol.Load(uint4(1u, 2u, 3u, 4u)).x;)";
+ case ValidTextureOverload::kLoadDepthMultisampled2dF32:
+ return R"(tint_symbol.Load(uint3(1u, 2u, uint(0)), 3u).x;)";
case ValidTextureOverload::kStoreWO1dRgba32float:
return R"(tint_symbol[1] = float4(2.0f, 3.0f, 4.0f, 5.0f);)";
case ValidTextureOverload::kStoreWO2dRgba32float:
diff --git a/src/tint/writer/msl/generator_impl.cc b/src/tint/writer/msl/generator_impl.cc
index 28478b8..0bc8c39 100644
--- a/src/tint/writer/msl/generator_impl.cc
+++ b/src/tint/writer/msl/generator_impl.cc
@@ -1092,9 +1092,7 @@
};
if (dims.size() == 1) {
- out << "int(";
get_dim(dims[0]);
- out << ")";
} else {
EmitType(out, TypeOf(expr)->UnwrapRef(), "");
out << "(";
@@ -1109,27 +1107,24 @@
return true;
}
case sem::BuiltinType::kTextureNumLayers: {
- out << "int(";
if (!texture_expr()) {
return false;
}
- out << ".get_array_size())";
+ out << ".get_array_size()";
return true;
}
case sem::BuiltinType::kTextureNumLevels: {
- out << "int(";
if (!texture_expr()) {
return false;
}
- out << ".get_num_mip_levels())";
+ out << ".get_num_mip_levels()";
return true;
}
case sem::BuiltinType::kTextureNumSamples: {
- out << "int(";
if (!texture_expr()) {
return false;
}
- out << ".get_num_samples())";
+ out << ".get_num_samples()";
return true;
}
default:
diff --git a/src/tint/writer/msl/generator_impl_builtin_texture_test.cc b/src/tint/writer/msl/generator_impl_builtin_texture_test.cc
index 65fbfda..ef5b427 100644
--- a/src/tint/writer/msl/generator_impl_builtin_texture_test.cc
+++ b/src/tint/writer/msl/generator_impl_builtin_texture_test.cc
@@ -24,7 +24,7 @@
switch (overload) {
case ValidTextureOverload::kDimensions1d:
case ValidTextureOverload::kDimensionsStorageWO1d:
- return R"(int(texture.get_width(0)))";
+ return R"(texture.get_width(0))";
case ValidTextureOverload::kDimensions2d:
case ValidTextureOverload::kDimensions2dArray:
case ValidTextureOverload::kDimensionsCube:
@@ -37,10 +37,10 @@
case ValidTextureOverload::kDimensionsDepthMultisampled2d:
case ValidTextureOverload::kDimensionsStorageWO2d:
case ValidTextureOverload::kDimensionsStorageWO2dArray:
- return R"(int2(texture.get_width(), texture.get_height()))";
+ return R"(uint2(texture.get_width(), texture.get_height()))";
case ValidTextureOverload::kDimensions3d:
case ValidTextureOverload::kDimensionsStorageWO3d:
- return R"(int3(texture.get_width(), texture.get_height(), texture.get_depth()))";
+ return R"(uint3(texture.get_width(), texture.get_height(), texture.get_depth()))";
case ValidTextureOverload::kDimensions2dLevel:
case ValidTextureOverload::kDimensionsCubeLevel:
case ValidTextureOverload::kDimensionsCubeArrayLevel:
@@ -49,9 +49,9 @@
case ValidTextureOverload::kDimensionsDepth2dArrayLevel:
case ValidTextureOverload::kDimensionsDepthCubeLevel:
case ValidTextureOverload::kDimensionsDepthCubeArrayLevel:
- return R"(int2(texture.get_width(1), texture.get_height(1)))";
+ return R"(uint2(texture.get_width(1), texture.get_height(1)))";
case ValidTextureOverload::kDimensions3dLevel:
- return R"(int3(texture.get_width(1), texture.get_height(1), texture.get_depth(1)))";
+ return R"(uint3(texture.get_width(1), texture.get_height(1), texture.get_depth(1)))";
case ValidTextureOverload::kGather2dF32:
return R"(texture.gather(sampler, float2(1.0f, 2.0f), int2(0), component::x))";
case ValidTextureOverload::kGather2dOffsetF32:
@@ -93,7 +93,7 @@
case ValidTextureOverload::kNumLayersDepth2dArray:
case ValidTextureOverload::kNumLayersDepthCubeArray:
case ValidTextureOverload::kNumLayersStorageWO2dArray:
- return R"(int(texture.get_array_size()))";
+ return R"(texture.get_array_size())";
case ValidTextureOverload::kNumLevels2d:
case ValidTextureOverload::kNumLevels2dArray:
case ValidTextureOverload::kNumLevels3d:
@@ -103,10 +103,10 @@
case ValidTextureOverload::kNumLevelsDepth2dArray:
case ValidTextureOverload::kNumLevelsDepthCube:
case ValidTextureOverload::kNumLevelsDepthCubeArray:
- return R"(int(texture.get_num_mip_levels()))";
+ return R"(texture.get_num_mip_levels())";
case ValidTextureOverload::kNumSamplesDepthMultisampled2d:
case ValidTextureOverload::kNumSamplesMultisampled2d:
- return R"(int(texture.get_num_samples()))";
+ return R"(texture.get_num_samples())";
case ValidTextureOverload::kSample1dF32:
return R"(texture.sample(sampler, 1.0f))";
case ValidTextureOverload::kSample2dF32:
@@ -210,17 +210,17 @@
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture.sample_compare(sampler, float3(1.0f, 2.0f, 3.0f), 4, 5.0f))";
case ValidTextureOverload::kSampleCompareLevelDepth2dF32:
- return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3.0f))";
+ return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3.0f, level(0)))";
case ValidTextureOverload::kSampleCompareLevelDepth2dOffsetF32:
- return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3.0f, int2(4, 5)))";
+ return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3.0f, level(0), int2(4, 5)))";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayF32:
- return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 4, 3.0f))";
+ return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3, 4.0f, level(0)))";
case ValidTextureOverload::kSampleCompareLevelDepth2dArrayOffsetF32:
- return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 4, 3.0f, int2(5, 6)))";
+ return R"(texture.sample_compare(sampler, float2(1.0f, 2.0f), 3, 4.0f, level(0), int2(5, 6)))";
case ValidTextureOverload::kSampleCompareLevelDepthCubeF32:
- return R"(texture.sample_compare(sampler, float3(1.0f, 2.0f, 3.0f), 4.0f))";
+ return R"(texture.sample_compare(sampler, float3(1.0f, 2.0f, 3.0f), 4.0f, level(0)))";
case ValidTextureOverload::kSampleCompareLevelDepthCubeArrayF32:
- return R"(texture.sample_compare(sampler, float3(1.0f, 2.0f, 3.0f), 4, 5.0f))";
+ return R"(texture.sample_compare(sampler, float3(1.0f, 2.0f, 3.0f), 4, 5.0f, level(0)))";
case ValidTextureOverload::kLoad1dLevelF32:
return R"(texture.read(uint(1u), 0))";
case ValidTextureOverload::kLoad1dLevelU32:
@@ -250,10 +250,11 @@
case ValidTextureOverload::kLoadMultisampled2dI32:
return R"(texture.read(uint2(uint2(1u, 2u)), 3u))";
case ValidTextureOverload::kLoadDepth2dLevelF32:
- case ValidTextureOverload::kLoadDepthMultisampled2dF32:
return R"(texture.read(uint2(int2(1, 2)), 3))";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(texture.read(uint2(uint2(1u, 2u)), 3u, 4u))";
+ case ValidTextureOverload::kLoadDepthMultisampled2dF32:
+ return R"(texture.read(uint2(uint2(1u, 2u)), 3u))";
case ValidTextureOverload::kStoreWO1dRgba32float:
return R"(texture.write(float4(2.0f, 3.0f, 4.0f, 5.0f), uint(1)))";
case ValidTextureOverload::kStoreWO2dRgba32float:
diff --git a/src/tint/writer/spirv/builder_builtin_texture_test.cc b/src/tint/writer/spirv/builder_builtin_texture_test.cc
index 5b64039..793371b 100644
--- a/src/tint/writer/spirv/builder_builtin_texture_test.cc
+++ b/src/tint/writer/spirv/builder_builtin_texture_test.cc
@@ -42,12 +42,13 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
-%11 = OpConstant %9 0
+%9 = OpTypeInt 32 0
+%11 = OpTypeInt 32 1
+%12 = OpConstant %11 0
)",
R"(
%10 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %10 %11
+%8 = OpImageQuerySizeLod %9 %10 %12
)",
R"(
OpCapability Sampled1D
@@ -63,13 +64,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 0
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 0
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -84,13 +86,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 1
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 1
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -105,14 +108,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 0
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 0
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -128,14 +132,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 1
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 1
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -151,13 +156,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 3
-%12 = OpConstant %10 0
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 0
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -172,13 +178,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 3
-%12 = OpConstant %10 1
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 1
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -193,13 +200,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 0
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 0
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -214,13 +222,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 1
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 1
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -235,14 +244,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 0
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 0
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -259,14 +269,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 1
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 1
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -283,7 +294,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
)",
R"(
@@ -303,13 +314,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 0
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 0
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -324,13 +336,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 1
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 1
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -345,14 +358,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 0
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 0
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -368,14 +382,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 1
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 1
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -391,13 +406,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 0
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 0
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -412,13 +428,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
-%12 = OpConstant %10 1
+%12 = OpTypeInt 32 1
+%13 = OpConstant %12 1
)",
R"(
%11 = OpLoad %3 %1
-%8 = OpImageQuerySizeLod %9 %11 %12
+%8 = OpImageQuerySizeLod %9 %11 %13
)",
R"(
OpCapability ImageQuery
@@ -433,14 +450,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 0
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 0
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -457,14 +475,15 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
-%14 = OpConstant %10 1
+%14 = OpTypeInt 32 1
+%15 = OpConstant %14 1
)",
R"(
%13 = OpLoad %3 %1
-%11 = OpImageQuerySizeLod %12 %13 %14
+%11 = OpImageQuerySizeLod %12 %13 %15
%8 = OpVectorShuffle %9 %11 %11 0 1
)",
R"(
@@ -481,7 +500,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
)",
R"(
@@ -501,7 +520,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -521,7 +540,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
)",
R"(
@@ -541,7 +560,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 2
%12 = OpTypeVector %10 3
)",
@@ -563,7 +582,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%10 = OpTypeInt 32 1
+%10 = OpTypeInt 32 0
%9 = OpTypeVector %10 3
)",
R"(
@@ -1100,13 +1119,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
%11 = OpTypeVector %9 3
-%13 = OpConstant %9 0
+%13 = OpTypeInt 32 1
+%14 = OpConstant %13 0
)",
R"(
%12 = OpLoad %3 %1
-%10 = OpImageQuerySizeLod %11 %12 %13
+%10 = OpImageQuerySizeLod %11 %12 %14
%8 = OpCompositeExtract %9 %10 2
)",
R"(
@@ -1121,13 +1141,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
%11 = OpTypeVector %9 3
-%13 = OpConstant %9 0
+%13 = OpTypeInt 32 1
+%14 = OpConstant %13 0
)",
R"(
%12 = OpLoad %3 %1
-%10 = OpImageQuerySizeLod %11 %12 %13
+%10 = OpImageQuerySizeLod %11 %12 %14
%8 = OpCompositeExtract %9 %10 2
)",
R"(
@@ -1143,13 +1164,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
%11 = OpTypeVector %9 3
-%13 = OpConstant %9 0
+%13 = OpTypeInt 32 1
+%14 = OpConstant %13 0
)",
R"(
%12 = OpLoad %3 %1
-%10 = OpImageQuerySizeLod %11 %12 %13
+%10 = OpImageQuerySizeLod %11 %12 %14
%8 = OpCompositeExtract %9 %10 2
)",
R"(
@@ -1164,13 +1186,14 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
%11 = OpTypeVector %9 3
-%13 = OpConstant %9 0
+%13 = OpTypeInt 32 1
+%14 = OpConstant %13 0
)",
R"(
%12 = OpLoad %3 %1
-%10 = OpImageQuerySizeLod %11 %12 %13
+%10 = OpImageQuerySizeLod %11 %12 %14
%8 = OpCompositeExtract %9 %10 2
)",
R"(
@@ -1186,7 +1209,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
%11 = OpTypeVector %9 3
)",
R"(
@@ -1206,7 +1229,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1224,7 +1247,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1242,7 +1265,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1260,7 +1283,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1278,7 +1301,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1297,7 +1320,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1315,7 +1338,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1333,7 +1356,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1351,7 +1374,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1370,7 +1393,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -1388,7 +1411,7 @@
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
-%9 = OpTypeInt 32 1
+%9 = OpTypeInt 32 0
)",
R"(
%10 = OpLoad %3 %1
@@ -3019,8 +3042,8 @@
%14 = OpConstant %4 1
%15 = OpConstant %4 2
%17 = OpTypeInt 32 1
-%18 = OpConstant %17 4
-%20 = OpConstant %4 3
+%18 = OpConstant %17 3
+%20 = OpConstant %4 4
%21 = OpConstant %4 0
)",
R"(
@@ -3048,8 +3071,8 @@
%14 = OpConstant %4 1
%15 = OpConstant %4 2
%17 = OpTypeInt 32 1
-%18 = OpConstant %17 4
-%20 = OpConstant %4 3
+%18 = OpConstant %17 3
+%20 = OpConstant %4 4
%21 = OpConstant %4 0
%22 = OpTypeVector %17 2
%23 = OpConstant %17 5
@@ -3538,24 +3561,23 @@
return {
R"(
%4 = OpTypeFloat 32
-%3 = OpTypeImage %4 2D 0 1 0 1 Unknown
+%3 = OpTypeImage %4 2D 0 0 1 1 Unknown
%2 = OpTypePointer UniformConstant %3
%1 = OpVariable %2 UniformConstant
%7 = OpTypeSampler
%6 = OpTypePointer UniformConstant %7
%5 = OpVariable %6 UniformConstant
%10 = OpTypeVector %4 4
-%13 = OpTypeInt 32 1
-%12 = OpTypeVector %13 3
+%13 = OpTypeInt 32 0
+%12 = OpTypeVector %13 2
%14 = OpConstant %13 1
%15 = OpConstant %13 2
-%16 = OpConstant %13 3
-%17 = OpConstantComposite %12 %14 %15 %16
-%18 = OpConstant %13 4
+%16 = OpConstantComposite %12 %14 %15
+%17 = OpConstant %13 3
)",
R"(
%11 = OpLoad %3 %1
-%9 = OpImageFetch %10 %11 %17 Sample %18
+%9 = OpImageFetch %10 %11 %16 Sample %17
%8 = OpCompositeExtract %4 %9 0
)",
R"(
diff --git a/test/tint/benchmark/particles.wgsl b/test/tint/benchmark/particles.wgsl
index 48628ff..c87a8ca 100644
--- a/test/tint/benchmark/particles.wgsl
+++ b/test/tint/benchmark/particles.wgsl
@@ -98,7 +98,7 @@
if (particle.lifetime < 0.0) {
// Use the probability map to find where the particle should be spawned.
// Starting with the 1x1 mip level.
- var coord = vec2<i32>(0, 0);
+ var coord = vec2<u32>(0, 0);
for (var level = textureNumLevels(texture) - 1; level > 0; level = level - 1) {
// Load the probability value from the mip-level
// Generate a random number and using the probabilty values, pick the
@@ -112,8 +112,8 @@
let value = vec4<f32>(rand());
let mask = (value >= vec4<f32>(0.0, probabilites.xyz)) & (value < probabilites);
coord = coord * 2;
- coord.x = coord.x + select(0, 1, any(mask.yw)); // x y
- coord.y = coord.y + select(0, 1, any(mask.zw)); // z w
+ coord.x += select(0u, 1u, any(mask.yw)); // x y
+ coord.y += select(0u, 1u, any(mask.zw)); // z w
}
let uv = vec2<f32>(coord) / vec2<f32>(textureDimensions(texture));
particle.position = vec3<f32>((uv - 0.5) * 3.0 * vec2<f32>(1.0, -1.0), 0.0);
diff --git a/test/tint/benchmark/particles.wgsl.expected.glsl b/test/tint/benchmark/particles.wgsl.expected.glsl
index b0a08c1..431b67f 100644
--- a/test/tint/benchmark/particles.wgsl.expected.glsl
+++ b/test/tint/benchmark/particles.wgsl.expected.glsl
@@ -177,21 +177,21 @@
particle.lifetime = (particle.lifetime - sim_params.deltaTime);
particle.color.a = smoothstep(0.0f, 0.5f, particle.lifetime);
if ((particle.lifetime < 0.0f)) {
- ivec2 coord = ivec2(0);
+ uvec2 coord = uvec2(0u);
{
- for(int level = (textureQueryLevels(tint_symbol_6) - 1); (level > 0); level = (level - 1)) {
- vec4 probabilites = texelFetch(tint_symbol_6, coord, level);
+ for(uint level = (uint(textureQueryLevels(tint_symbol_6)) - 1u); (level > 0u); level = (level - 1u)) {
+ vec4 probabilites = texelFetch(tint_symbol_6, ivec2(coord), int(level));
float tint_symbol_5 = rand();
vec4 value = vec4(tint_symbol_5);
bvec4 mask = bvec4(uvec4(greaterThanEqual(value, vec4(0.0f, probabilites.xyz))) & uvec4(lessThan(value, probabilites)));
- coord = (coord * 2);
- coord.x = (coord.x + (any(mask.yw) ? 1 : 0));
- coord.y = (coord.y + (any(mask.zw) ? 1 : 0));
+ coord = (coord * 2u);
+ coord.x = (coord.x + (any(mask.yw) ? 1u : 0u));
+ coord.y = (coord.y + (any(mask.zw) ? 1u : 0u));
}
}
- vec2 uv = (vec2(coord) / vec2(textureSize(tint_symbol_6, 0)));
+ vec2 uv = (vec2(coord) / vec2(uvec2(textureSize(tint_symbol_6, 0))));
particle.position = vec3((((uv - 0.5f) * 3.0f) * vec2(1.0f, -1.0f)), 0.0f);
- particle.color = texelFetch(tint_symbol_6, coord, 0);
+ particle.color = texelFetch(tint_symbol_6, ivec2(coord), int(0u));
float tint_symbol_1 = rand();
particle.velocity.x = ((tint_symbol_1 - 0.5f) * 0.100000001f);
float tint_symbol_2 = rand();
@@ -210,8 +210,8 @@
return;
}
Error parsing GLSL shader:
-ERROR: 0:64: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:64: '' : compilation terminated
+ERROR: 0:64: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:64: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
@@ -323,7 +323,7 @@
layout(rgba8) uniform highp writeonly image2D tex_out;
void export_level(uvec3 coord) {
- if (all(lessThan(coord.xy, uvec2(imageSize(tex_out))))) {
+ if (all(lessThan(coord.xy, uvec2(uvec2(imageSize(tex_out)))))) {
uint dst_offset = (coord.x + (coord.y * ubo.width));
uint src_offset = ((coord.x * 2u) + ((coord.y * 2u) * ubo.width));
float a = buf_in.weights[(src_offset + 0u)];
diff --git a/test/tint/buffer/storage/types/struct.wgsl.expected.glsl b/test/tint/buffer/storage/types/struct.wgsl.expected.glsl
index d33f278..0cf63c6 100644
--- a/test/tint/buffer/storage/types/struct.wgsl.expected.glsl
+++ b/test/tint/buffer/storage/types/struct.wgsl.expected.glsl
@@ -25,7 +25,7 @@
}
Error parsing GLSL shader:
ERROR: 0:16: 'assign' : cannot convert from 'layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer structure{ global highp float f} inner}' to 'layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer structure{ global highp float f} inner}'
-ERROR: 0:16: '' : compilation terminated
+ERROR: 0:16: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/bug/tint/534.wgsl b/test/tint/bug/tint/534.wgsl
index e716f8e..3f8a0dd 100644
--- a/test/tint/bug/tint/534.wgsl
+++ b/test/tint/bug/tint/534.wgsl
@@ -20,9 +20,9 @@
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
- var size : vec2<i32> = textureDimensions(src);
- var dstTexCoord : vec2<i32> = vec2<i32>(GlobalInvocationID.xy);
- var srcTexCoord : vec2<i32> = dstTexCoord;
+ var size = textureDimensions(src);
+ var dstTexCoord = GlobalInvocationID.xy;
+ var srcTexCoord = dstTexCoord;
if (uniforms.dstTextureFlipY == 1u) {
srcTexCoord.y = size.y - dstTexCoord.y - 1;
}
diff --git a/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
index 47d017e..811cc1c 100644
--- a/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/534.wgsl.expected.dxc.hlsl
@@ -20,14 +20,14 @@
void main_inner(uint3 GlobalInvocationID) {
int2 tint_tmp;
src.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 size = tint_tmp;
- int2 dstTexCoord = int2(GlobalInvocationID.xy);
- int2 srcTexCoord = dstTexCoord;
+ uint2 size = tint_tmp;
+ uint2 dstTexCoord = GlobalInvocationID.xy;
+ uint2 srcTexCoord = dstTexCoord;
if ((uniforms[0].x == 1u)) {
- srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
+ srcTexCoord.y = ((size.y - dstTexCoord.y) - 1u);
}
- float4 srcColor = src.Load(int3(srcTexCoord, 0));
- float4 dstColor = tint_symbol.Load(int3(dstTexCoord, 0));
+ float4 srcColor = src.Load(uint3(srcTexCoord, 0u));
+ float4 dstColor = tint_symbol.Load(uint3(dstTexCoord, 0u));
bool success = true;
uint4 srcColorBits = uint4(0u, 0u, 0u, 0u);
uint4 dstColorBits = uint4(dstColor);
diff --git a/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
index 47d017e..811cc1c 100644
--- a/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/534.wgsl.expected.fxc.hlsl
@@ -20,14 +20,14 @@
void main_inner(uint3 GlobalInvocationID) {
int2 tint_tmp;
src.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 size = tint_tmp;
- int2 dstTexCoord = int2(GlobalInvocationID.xy);
- int2 srcTexCoord = dstTexCoord;
+ uint2 size = tint_tmp;
+ uint2 dstTexCoord = GlobalInvocationID.xy;
+ uint2 srcTexCoord = dstTexCoord;
if ((uniforms[0].x == 1u)) {
- srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
+ srcTexCoord.y = ((size.y - dstTexCoord.y) - 1u);
}
- float4 srcColor = src.Load(int3(srcTexCoord, 0));
- float4 dstColor = tint_symbol.Load(int3(dstTexCoord, 0));
+ float4 srcColor = src.Load(uint3(srcTexCoord, 0u));
+ float4 dstColor = tint_symbol.Load(uint3(dstTexCoord, 0u));
bool success = true;
uint4 srcColorBits = uint4(0u, 0u, 0u, 0u);
uint4 dstColorBits = uint4(dstColor);
diff --git a/test/tint/bug/tint/534.wgsl.expected.glsl b/test/tint/bug/tint/534.wgsl.expected.glsl
index 12c0408..a0c2e1f 100644
--- a/test/tint/bug/tint/534.wgsl.expected.glsl
+++ b/test/tint/bug/tint/534.wgsl.expected.glsl
@@ -18,14 +18,14 @@
uniform highp sampler2D src_1;
uniform highp sampler2D dst_1;
void tint_symbol_1(uvec3 GlobalInvocationID) {
- ivec2 size = textureSize(src_1, 0);
- ivec2 dstTexCoord = ivec2(GlobalInvocationID.xy);
- ivec2 srcTexCoord = dstTexCoord;
+ uvec2 size = uvec2(textureSize(src_1, 0));
+ uvec2 dstTexCoord = GlobalInvocationID.xy;
+ uvec2 srcTexCoord = dstTexCoord;
if ((uniforms.dstTextureFlipY == 1u)) {
- srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
+ srcTexCoord.y = ((size.y - dstTexCoord.y) - 1u);
}
- vec4 srcColor = texelFetch(src_1, srcTexCoord, 0);
- vec4 dstColor = texelFetch(dst_1, dstTexCoord, 0);
+ vec4 srcColor = texelFetch(src_1, ivec2(srcTexCoord), int(0u));
+ vec4 dstColor = texelFetch(dst_1, ivec2(dstTexCoord), int(0u));
bool success = true;
uvec4 srcColorBits = uvec4(0u, 0u, 0u, 0u);
uvec4 dstColorBits = uvec4(dstColor);
diff --git a/test/tint/bug/tint/534.wgsl.expected.msl b/test/tint/bug/tint/534.wgsl.expected.msl
index 2323162..04bad3a 100644
--- a/test/tint/bug/tint/534.wgsl.expected.msl
+++ b/test/tint/bug/tint/534.wgsl.expected.msl
@@ -30,14 +30,14 @@
}
void tint_symbol_inner(uint3 GlobalInvocationID, texture2d<float, access::sample> tint_symbol_2, const constant Uniforms* const tint_symbol_3, texture2d<float, access::sample> tint_symbol_4, device OutputBuf* const tint_symbol_5) {
- int2 size = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height());
- int2 dstTexCoord = int2(uint3(GlobalInvocationID).xy);
- int2 srcTexCoord = dstTexCoord;
+ uint2 size = uint2(tint_symbol_2.get_width(), tint_symbol_2.get_height());
+ uint2 dstTexCoord = uint3(GlobalInvocationID).xy;
+ uint2 srcTexCoord = dstTexCoord;
if (((*(tint_symbol_3)).dstTextureFlipY == 1u)) {
- srcTexCoord[1] = as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(size[1]) - as_type<uint>(dstTexCoord[1])))) - as_type<uint>(1)));
+ srcTexCoord[1] = ((size[1] - dstTexCoord[1]) - 1u);
}
- float4 srcColor = tint_symbol_2.read(uint2(srcTexCoord), 0);
- float4 dstColor = tint_symbol_4.read(uint2(dstTexCoord), 0);
+ float4 srcColor = tint_symbol_2.read(uint2(srcTexCoord), 0u);
+ float4 dstColor = tint_symbol_4.read(uint2(dstTexCoord), 0u);
bool success = true;
uint4 srcColorBits = 0u;
uint4 dstColorBits = uint4(dstColor);
diff --git a/test/tint/bug/tint/534.wgsl.expected.spvasm b/test/tint/bug/tint/534.wgsl.expected.spvasm
index 98bd3e7..0839d14 100644
--- a/test/tint/bug/tint/534.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/534.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 138
+; Bound: 133
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
@@ -73,33 +73,29 @@
%uint_1 = OpConstant %uint 1
%void = OpTypeVoid
%22 = OpTypeFunction %void %v3uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %34 = OpConstantNull %v2int
%v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %34 = OpConstantNull %v2uint
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%bool = OpTypeBool
-%_ptr_Function_int = OpTypePointer Function %int
- %int_1 = OpConstant %int 1
+%_ptr_Function_uint = OpTypePointer Function %uint
%v4float = OpTypeVector %float 4
- %62 = OpConstantNull %int
+ %59 = OpConstantNull %uint
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %65 = OpConstantNull %v4float
+ %62 = OpConstantNull %v4float
%true = OpConstantTrue %bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %73 = OpConstantNull %bool
+ %70 = OpConstantNull %bool
%v4uint = OpTypeVector %uint 4
%_ptr_Function_v4uint = OpTypePointer Function %v4uint
- %77 = OpConstantNull %v4uint
- %81 = OpConstantNull %uint
-%_ptr_Function_uint = OpTypePointer Function %uint
+ %74 = OpConstantNull %v4uint
%uint_3 = OpConstant %uint 3
%_ptr_Function_float = OpTypePointer Function %float
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
- %133 = OpTypeFunction %void
+ %128 = OpTypeFunction %void
%ConvertToFp16FloatValue = OpFunction %uint None %17
%fp32 = OpFunctionParameter %float
%20 = OpLabel
@@ -108,124 +104,122 @@
%main_inner = OpFunction %void None %22
%GlobalInvocationID = OpFunctionParameter %v3uint
%26 = OpLabel
- %size = OpVariable %_ptr_Function_v2int Function %34
-%dstTexCoord = OpVariable %_ptr_Function_v2int Function %34
-%srcTexCoord = OpVariable %_ptr_Function_v2int Function %34
- %srcColor = OpVariable %_ptr_Function_v4float Function %65
- %dstColor = OpVariable %_ptr_Function_v4float Function %65
- %success = OpVariable %_ptr_Function_bool Function %73
-%srcColorBits = OpVariable %_ptr_Function_v4uint Function %77
-%dstColorBits = OpVariable %_ptr_Function_v4uint Function %77
- %i = OpVariable %_ptr_Function_uint Function %81
-%outputIndex = OpVariable %_ptr_Function_uint Function %81
- %30 = OpLoad %7 %src
- %27 = OpImageQuerySizeLod %v2int %30 %int_0
+ %size = OpVariable %_ptr_Function_v2uint Function %34
+%dstTexCoord = OpVariable %_ptr_Function_v2uint Function %34
+%srcTexCoord = OpVariable %_ptr_Function_v2uint Function %34
+ %srcColor = OpVariable %_ptr_Function_v4float Function %62
+ %dstColor = OpVariable %_ptr_Function_v4float Function %62
+ %success = OpVariable %_ptr_Function_bool Function %70
+%srcColorBits = OpVariable %_ptr_Function_v4uint Function %74
+%dstColorBits = OpVariable %_ptr_Function_v4uint Function %74
+ %i = OpVariable %_ptr_Function_uint Function %59
+%outputIndex = OpVariable %_ptr_Function_uint Function %59
+ %29 = OpLoad %7 %src
+ %27 = OpImageQuerySizeLod %v2uint %29 %int_0
OpStore %size %27
- %37 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
- %35 = OpBitcast %v2int %37
+ %35 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
OpStore %dstTexCoord %35
- %39 = OpLoad %v2int %dstTexCoord
- OpStore %srcTexCoord %39
- %43 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
- %44 = OpLoad %uint %43
- %45 = OpIEqual %bool %44 %uint_1
- OpSelectionMerge %47 None
- OpBranchConditional %45 %48 %47
- %48 = OpLabel
- %50 = OpAccessChain %_ptr_Function_int %srcTexCoord %uint_1
- %51 = OpAccessChain %_ptr_Function_int %size %uint_1
- %52 = OpLoad %int %51
- %53 = OpAccessChain %_ptr_Function_int %dstTexCoord %uint_1
- %54 = OpLoad %int %53
- %55 = OpISub %int %52 %54
- %57 = OpISub %int %55 %int_1
- OpStore %50 %57
- OpBranch %47
- %47 = OpLabel
- %60 = OpLoad %7 %src
- %61 = OpLoad %v2int %srcTexCoord
- %58 = OpImageFetch %v4float %60 %61 Lod %62
- OpStore %srcColor %58
- %67 = OpLoad %7 %dst
- %68 = OpLoad %v2int %dstTexCoord
- %66 = OpImageFetch %v4float %67 %68 Lod %62
- OpStore %dstColor %66
+ %37 = OpLoad %v2uint %dstTexCoord
+ OpStore %srcTexCoord %37
+ %41 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_0
+ %42 = OpLoad %uint %41
+ %43 = OpIEqual %bool %42 %uint_1
+ OpSelectionMerge %45 None
+ OpBranchConditional %43 %46 %45
+ %46 = OpLabel
+ %48 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
+ %49 = OpAccessChain %_ptr_Function_uint %size %uint_1
+ %50 = OpLoad %uint %49
+ %51 = OpAccessChain %_ptr_Function_uint %dstTexCoord %uint_1
+ %52 = OpLoad %uint %51
+ %53 = OpISub %uint %50 %52
+ %54 = OpISub %uint %53 %uint_1
+ OpStore %48 %54
+ OpBranch %45
+ %45 = OpLabel
+ %57 = OpLoad %7 %src
+ %58 = OpLoad %v2uint %srcTexCoord
+ %55 = OpImageFetch %v4float %57 %58 Lod %59
+ OpStore %srcColor %55
+ %64 = OpLoad %7 %dst
+ %65 = OpLoad %v2uint %dstTexCoord
+ %63 = OpImageFetch %v4float %64 %65 Lod %59
+ OpStore %dstColor %63
OpStore %success %true
- %79 = OpLoad %v4float %dstColor
- %78 = OpConvertFToU %v4uint %79
- OpStore %dstColorBits %78
- OpStore %i %81
- OpBranch %84
- %84 = OpLabel
- OpLoopMerge %85 %86 None
- OpBranch %87
- %87 = OpLabel
- %89 = OpLoad %uint %i
- %91 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
- %92 = OpLoad %uint %91
- %93 = OpULessThan %bool %89 %92
- %88 = OpLogicalNot %bool %93
- OpSelectionMerge %94 None
- OpBranchConditional %88 %95 %94
- %95 = OpLabel
- OpBranch %85
- %94 = OpLabel
- %97 = OpLoad %uint %i
- %99 = OpAccessChain %_ptr_Function_float %srcColor %97
- %100 = OpLoad %float %99
- %96 = OpFunctionCall %uint %ConvertToFp16FloatValue %100
+ %76 = OpLoad %v4float %dstColor
+ %75 = OpConvertFToU %v4uint %76
+ OpStore %dstColorBits %75
+ OpStore %i %59
+ OpBranch %79
+ %79 = OpLabel
+ OpLoopMerge %80 %81 None
+ OpBranch %82
+ %82 = OpLabel
+ %84 = OpLoad %uint %i
+ %86 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3
+ %87 = OpLoad %uint %86
+ %88 = OpULessThan %bool %84 %87
+ %83 = OpLogicalNot %bool %88
+ OpSelectionMerge %89 None
+ OpBranchConditional %83 %90 %89
+ %90 = OpLabel
+ OpBranch %80
+ %89 = OpLabel
+ %92 = OpLoad %uint %i
+ %94 = OpAccessChain %_ptr_Function_float %srcColor %92
+ %95 = OpLoad %float %94
+ %91 = OpFunctionCall %uint %ConvertToFp16FloatValue %95
+ %96 = OpLoad %uint %i
+ %97 = OpAccessChain %_ptr_Function_uint %srcColorBits %96
+ OpStore %97 %91
+ %98 = OpLoad %bool %success
+ OpSelectionMerge %99 None
+ OpBranchConditional %98 %100 %99
+ %100 = OpLabel
%101 = OpLoad %uint %i
%102 = OpAccessChain %_ptr_Function_uint %srcColorBits %101
- OpStore %102 %96
- %103 = OpLoad %bool %success
- OpSelectionMerge %104 None
- OpBranchConditional %103 %105 %104
- %105 = OpLabel
- %106 = OpLoad %uint %i
- %107 = OpAccessChain %_ptr_Function_uint %srcColorBits %106
- %108 = OpLoad %uint %107
+ %103 = OpLoad %uint %102
+ %104 = OpLoad %uint %i
+ %105 = OpAccessChain %_ptr_Function_uint %dstColorBits %104
+ %106 = OpLoad %uint %105
+ %107 = OpIEqual %bool %103 %106
+ OpBranch %99
+ %99 = OpLabel
+ %108 = OpPhi %bool %98 %89 %107 %100
+ OpStore %success %108
+ OpBranch %81
+ %81 = OpLabel
%109 = OpLoad %uint %i
- %110 = OpAccessChain %_ptr_Function_uint %dstColorBits %109
- %111 = OpLoad %uint %110
- %112 = OpIEqual %bool %108 %111
- OpBranch %104
- %104 = OpLabel
- %113 = OpPhi %bool %103 %94 %112 %105
- OpStore %success %113
- OpBranch %86
- %86 = OpLabel
- %114 = OpLoad %uint %i
- %115 = OpIAdd %uint %114 %uint_1
- OpStore %i %115
- OpBranch %84
- %85 = OpLabel
- %116 = OpCompositeExtract %uint %GlobalInvocationID 1
- %118 = OpAccessChain %_ptr_Function_int %size %uint_0
- %119 = OpLoad %int %118
- %117 = OpBitcast %uint %119
- %120 = OpIMul %uint %116 %117
- %121 = OpCompositeExtract %uint %GlobalInvocationID 0
- %122 = OpIAdd %uint %120 %121
- OpStore %outputIndex %122
- %124 = OpLoad %bool %success
- OpSelectionMerge %125 None
- OpBranchConditional %124 %126 %127
- %126 = OpLabel
- %128 = OpLoad %uint %outputIndex
- %130 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %128
- OpStore %130 %uint_1
- OpBranch %125
- %127 = OpLabel
- %131 = OpLoad %uint %outputIndex
- %132 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %131
- OpStore %132 %81
- OpBranch %125
- %125 = OpLabel
+ %110 = OpIAdd %uint %109 %uint_1
+ OpStore %i %110
+ OpBranch %79
+ %80 = OpLabel
+ %111 = OpCompositeExtract %uint %GlobalInvocationID 1
+ %113 = OpAccessChain %_ptr_Function_uint %size %uint_0
+ %114 = OpLoad %uint %113
+ %115 = OpIMul %uint %111 %114
+ %116 = OpCompositeExtract %uint %GlobalInvocationID 0
+ %117 = OpIAdd %uint %115 %116
+ OpStore %outputIndex %117
+ %119 = OpLoad %bool %success
+ OpSelectionMerge %120 None
+ OpBranchConditional %119 %121 %122
+ %121 = OpLabel
+ %123 = OpLoad %uint %outputIndex
+ %125 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %123
+ OpStore %125 %uint_1
+ OpBranch %120
+ %122 = OpLabel
+ %126 = OpLoad %uint %outputIndex
+ %127 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %126
+ OpStore %127 %59
+ OpBranch %120
+ %120 = OpLabel
OpReturn
OpFunctionEnd
- %main = OpFunction %void None %133
- %135 = OpLabel
- %137 = OpLoad %v3uint %GlobalInvocationID_1
- %136 = OpFunctionCall %void %main_inner %137
+ %main = OpFunction %void None %128
+ %130 = OpLabel
+ %132 = OpLoad %v3uint %GlobalInvocationID_1
+ %131 = OpFunctionCall %void %main_inner %132
OpReturn
OpFunctionEnd
diff --git a/test/tint/bug/tint/534.wgsl.expected.wgsl b/test/tint/bug/tint/534.wgsl.expected.wgsl
index 83a4bfd..8fc33d7 100644
--- a/test/tint/bug/tint/534.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/534.wgsl.expected.wgsl
@@ -23,9 +23,9 @@
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
- var size : vec2<i32> = textureDimensions(src);
- var dstTexCoord : vec2<i32> = vec2<i32>(GlobalInvocationID.xy);
- var srcTexCoord : vec2<i32> = dstTexCoord;
+ var size = textureDimensions(src);
+ var dstTexCoord = GlobalInvocationID.xy;
+ var srcTexCoord = dstTexCoord;
if ((uniforms.dstTextureFlipY == 1u)) {
srcTexCoord.y = ((size.y - dstTexCoord.y) - 1);
}
diff --git a/test/tint/bug/tint/749.spvasm.expected.glsl b/test/tint/bug/tint/749.spvasm.expected.glsl
index 149037e..ffd5710 100644
--- a/test/tint/bug/tint/749.spvasm.expected.glsl
+++ b/test/tint/bug/tint/749.spvasm.expected.glsl
@@ -1 +1,1494 @@
-SKIP: triggers crbug.com/tint/98
+SKIP: FAILED
+
+
+struct QuicksortObject {
+ numbers : array<i32, 10u>,
+}
+
+struct buf0 {
+ resolution : vec2<f32>,
+}
+
+var<private> obj : QuicksortObject;
+
+var<private> gl_FragCoord : vec4<f32>;
+
+@group(0) @binding(0) var<uniform> x_188 : buf0;
+
+var<private> x_GLF_color : vec4<f32>;
+
+fn swap_i1_i1_(i : ptr<function, i32>, j : ptr<function, i32>) {
+ var temp : i32;
+ let x_932 : i32 = temp;
+ temp = 0i;
+ temp = x_932;
+ let x_523 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
+ let x_933 : i32 = *(i);
+ *(i) = 0i;
+ *(i) = x_933;
+ let x_28 : i32 = *(i);
+ let x_934 : i32 = *(j);
+ *(j) = 0i;
+ *(j) = x_934;
+ let x_524 : vec3<f32> = vec3<f32>(x_523.y, x_523.x, x_523.y);
+ let x_935 : i32 = temp;
+ temp = 0i;
+ temp = x_935;
+ let x_30 : ptr<private, i32> = &(obj.numbers[x_28]);
+ let x_936 : i32 = *(x_30);
+ *(x_30) = 0i;
+ *(x_30) = x_936;
+ let x_31 : i32 = *(x_30);
+ let x_937 : i32 = temp;
+ temp = 0i;
+ temp = x_937;
+ temp = x_31;
+ let x_938 : i32 = *(j);
+ *(j) = 0i;
+ *(j) = x_938;
+ let x_525 : vec3<f32> = vec3<f32>(x_523.z, vec3<f32>(1.0f, 2.0f, 3.0f).x, x_523.y);
+ let x_939 : i32 = *(i);
+ *(i) = 0i;
+ *(i) = x_939;
+ let x_32 : i32 = *(i);
+ let x_940 : i32 = *(x_30);
+ *(x_30) = 0i;
+ *(x_30) = x_940;
+ let x_33 : i32 = *(j);
+ let x_941 : i32 = *(i);
+ *(i) = 0i;
+ *(i) = x_941;
+ let x_526 : vec3<f32> = vec3<f32>(x_525.x, x_525.z, x_525.z);
+ let x_942 : i32 = *(x_30);
+ *(x_30) = 0i;
+ *(x_30) = x_942;
+ let x_34 : ptr<private, i32> = &(obj.numbers[x_33]);
+ let x_35 : i32 = *(x_34);
+ let x_943 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_943;
+ let x_527 : vec2<f32> = vec2<f32>(x_526.x, x_526.x);
+ let x_36 : ptr<private, i32> = &(obj.numbers[x_32]);
+ let x_528 : vec3<f32> = vec3<f32>(x_524.x, x_524.z, x_524.x);
+ *(x_36) = x_35;
+ let x_944 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_944;
+ let x_529 : vec3<f32> = vec3<f32>(x_526.y, x_526.z, x_526.x);
+ let x_945 : i32 = *(i);
+ *(i) = 0i;
+ *(i) = x_945;
+ let x_37 : i32 = *(j);
+ let x_946 : i32 = temp;
+ temp = 0i;
+ temp = x_946;
+ let x_530 : vec2<f32> = vec2<f32>(x_529.z, x_529.y);
+ let x_947 : i32 = *(x_34);
+ *(x_34) = 0i;
+ *(x_34) = x_947;
+ let x_38 : i32 = temp;
+ let x_948 : i32 = *(j);
+ *(j) = 0i;
+ *(j) = x_948;
+ let x_531 : vec3<f32> = vec3<f32>(x_527.x, x_526.y, x_526.x);
+ let x_949 : i32 = *(x_36);
+ *(x_36) = 0i;
+ *(x_36) = x_949;
+ let x_950 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_950;
+ let x_532 : vec3<f32> = vec3<f32>(x_528.x, x_528.y, x_528.x);
+ let x_951 : i32 = *(x_34);
+ *(x_34) = 0i;
+ *(x_34) = x_951;
+ obj.numbers[x_37] = x_38;
+ return;
+}
+
+fn performPartition_i1_i1_(l : ptr<function, i32>, h : ptr<function, i32>) -> i32 {
+ var param_3 : i32;
+ var i_1 : i32;
+ var j_1 : i32;
+ var param_2 : i32;
+ var param_1 : i32;
+ var param : i32;
+ var pivot : i32;
+ var x_537 : vec2<f32>;
+ var x_538 : vec3<f32>;
+ let x_952 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_952;
+ let x_41 : i32 = *(h);
+ let x_953 : i32 = *(l);
+ *(l) = 0i;
+ *(l) = x_953;
+ let x_42 : ptr<private, i32> = &(obj.numbers[x_41]);
+ let x_954 : i32 = *(x_42);
+ *(x_42) = 0i;
+ *(x_42) = x_954;
+ let x_43 : i32 = *(x_42);
+ let x_955 : i32 = param_3;
+ param_3 = 0i;
+ param_3 = x_955;
+ let x_534 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).z);
+ let x_956 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_956;
+ pivot = x_43;
+ let x_45 : i32 = *(l);
+ let x_957 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_957;
+ let x_958 : i32 = j_1;
+ j_1 = 0i;
+ j_1 = x_958;
+ let x_535 : vec3<f32> = vec3<f32>(x_534.y, x_534.z, x_534.y);
+ let x_959 : i32 = *(l);
+ *(l) = 0i;
+ *(l) = x_959;
+ i_1 = (x_45 - bitcast<i32>(1u));
+ let x_49 : i32 = *(l);
+ let x_536 : vec3<f32> = vec3<f32>(x_534.x, x_534.z, x_535.x);
+ j_1 = 10i;
+ let x_960 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_960;
+ loop {
+ var x_61 : ptr<private, i32>;
+ var x_539 : vec3<f32>;
+ var x_541 : vec3<f32>;
+ let x_961 : i32 = pivot;
+ pivot = 0i;
+ pivot = x_961;
+ let x_962 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_962;
+ let x_55 : i32 = j_1;
+ let x_963 : i32 = pivot;
+ pivot = 0i;
+ pivot = x_963;
+ x_537 = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
+ let x_964 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_964;
+ let x_56 : i32 = *(h);
+ let x_965 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_965;
+ let x_966 : i32 = param;
+ param = 0i;
+ param = x_966;
+ let x_967 : i32 = j_1;
+ j_1 = 0i;
+ j_1 = x_967;
+ x_538 = vec3<f32>(x_534.x, x_537.y, x_534.z);
+ let x_968 : i32 = param;
+ param = 0i;
+ param = x_968;
+ if ((x_55 <= (x_56 - bitcast<i32>(1u)))) {
+ } else {
+ break;
+ }
+ let x_60 : i32 = j_1;
+ let x_969 : i32 = *(x_42);
+ *(x_42) = 0i;
+ *(x_42) = x_969;
+ x_61 = obj.numbers[x_60];
+ let x_970 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_970;
+ x_539 = vec3<f32>(x_537.x, x_535.z, x_537.x);
+ let x_971 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_971;
+ let x_62 : ptr<undefined, i32> = x_61;
+ let x_972 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_972;
+ let x_63 : i32 = pivot;
+ let x_540 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, x_534.z);
+ let x_973 : i32 = i_1;
+ i_1 = 0i;
+ i_1 = x_973;
+ let x_974 : i32 = *(l);
+ *(l) = 0i;
+ *(l) = x_974;
+ x_541 = vec3<f32>(x_534.y, x_534.x, x_534.y);
+ let x_975 : i32 = pivot;
+ pivot = 0i;
+ pivot = x_975;
+ if ((x_62 <= x_63)) {
+ let x_542 : vec3<f32> = vec3<f32>(x_541.z, x_541.x, x_541.x);
+ let x_976 : i32 = param_3;
+ param_3 = 0i;
+ param_3 = x_976;
+ let x_67 : i32 = i_1;
+ let x_977 : i32 = pivot;
+ pivot = 0i;
+ pivot = x_977;
+ let x_543 : vec2<f32> = vec2<f32>(x_539.x, x_541.y);
+ let x_978 : i32 = i_1;
+ i_1 = 0i;
+ i_1 = x_978;
+ let x_979 : i32 = param;
+ param = 0i;
+ param = x_979;
+ i_1 = (x_67 + bitcast<i32>(1u));
+ let x_980 : i32 = *(l);
+ *(l) = 0i;
+ *(l) = x_980;
+ let x_544 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y, x_540.x);
+ let x_70 : i32 = i_1;
+ let x_545 : vec2<f32> = vec2<f32>(x_537.y, x_538.x);
+ let x_981 : i32 = param;
+ param = 0i;
+ param = x_981;
+ param = x_70;
+ let x_982 : i32 = param;
+ param = 0i;
+ param = x_982;
+ let x_546 : vec2<f32> = vec2<f32>(x_545.x, x_545.x);
+ let x_983 : i32 = i_1;
+ i_1 = 0i;
+ i_1 = x_983;
+ let x_72 : i32 = j_1;
+ param_1 = x_72;
+ let x_984 : i32 = param_3;
+ param_3 = 0i;
+ param_3 = x_984;
+ swap_i1_i1_(&(param), &(param_1));
+ let x_985 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_985;
+ }
+ let x_986 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_986;
+
+ continuing {
+ let x_987 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_987;
+ let x_74 : i32 = j_1;
+ let x_988 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_988;
+ let x_547 : vec3<f32> = vec3<f32>(x_539.x, x_541.z, x_541.z);
+ let x_989 : ptr<undefined, i32> = x_61;
+ x_61 = 0i;
+ x_61 = x_989;
+ let x_990 : i32 = param;
+ param = 0i;
+ param = x_990;
+ j_1 = (1i + x_74);
+ let x_991 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_991;
+ let x_548 : vec3<f32> = vec3<f32>(x_541.y, x_541.z, x_541.x);
+ let x_992 : ptr<undefined, i32> = x_61;
+ x_61 = 0i;
+ x_61 = x_992;
+ }
+ }
+ let x_76 : i32 = i_1;
+ let x_993 : i32 = *(x_42);
+ *(x_42) = 0i;
+ *(x_42) = x_993;
+ let x_549 : vec2<f32> = vec2<f32>(x_534.x, x_534.y);
+ let x_994 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_994;
+ let x_995 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_995;
+ i_1 = (1i + x_76);
+ let x_996 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_996;
+ let x_79 : i32 = i_1;
+ let x_997 : i32 = j_1;
+ j_1 = 0i;
+ j_1 = x_997;
+ let x_550 : vec2<f32> = vec2<f32>(x_534.x, x_534.x);
+ let x_998 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_998;
+ param_2 = x_79;
+ let x_551 : vec2<f32> = vec2<f32>(x_534.y, x_536.x);
+ let x_999 : i32 = pivot;
+ pivot = 0i;
+ pivot = x_999;
+ let x_81 : i32 = *(h);
+ let x_552 : vec2<f32> = vec2<f32>(x_550.x, x_549.y);
+ let x_1000 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_1000;
+ param_3 = x_81;
+ let x_1001 : i32 = i_1;
+ i_1 = 0i;
+ i_1 = x_1001;
+ let x_553 : vec2<f32> = vec2<f32>(x_549.y, x_552.x);
+ let x_1002 : i32 = *(h);
+ *(h) = 0i;
+ *(h) = x_1002;
+ swap_i1_i1_(&(param_2), &(param_3));
+ let x_1003 : i32 = *(l);
+ *(l) = 0i;
+ *(l) = x_1003;
+ let x_554 : vec2<f32> = vec2<f32>(x_536.z, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ let x_1004 : i32 = param_1;
+ param_1 = 0i;
+ param_1 = x_1004;
+ let x_83 : i32 = i_1;
+ let x_1005 : i32 = param;
+ param = 0i;
+ param = x_1005;
+ let x_555 : vec2<f32> = vec2<f32>(x_534.y, x_534.x);
+ let x_1006 : i32 = j_1;
+ j_1 = 0i;
+ j_1 = x_1006;
+ return x_83;
+}
+
+fn quicksort_() {
+ var param_4 : i32;
+ var h_1 : i32;
+ var p : i32;
+ var l_1 : i32;
+ var top : i32;
+ var stack : array<i32, 10u>;
+ var param_5 : i32;
+ l_1 = 0i;
+ let x_1007 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1007;
+ h_1 = 9i;
+ let x_1008 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1008;
+ let x_556 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ let x_1009 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1009;
+ top = -1i;
+ let x_1010 : i32 = p;
+ p = 0i;
+ p = x_1010;
+ let x_93 : i32 = top;
+ let x_557 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).x);
+ let x_1011 : i32 = p;
+ p = 0i;
+ p = x_1011;
+ let x_94 : i32 = (x_93 + bitcast<i32>(1u));
+ let x_1012 : i32 = top;
+ top = 0i;
+ top = x_1012;
+ let x_558 : vec2<f32> = vec2<f32>(x_556.y, x_557.y);
+ let x_1013 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1013;
+ top = x_94;
+ let x_1014 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1014;
+ let x_559 : vec3<f32> = vec3<f32>(x_557.y, x_557.x, x_557.x);
+ let x_1015 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1015;
+ let x_95 : i32 = l_1;
+ let x_1016 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_1016;
+ let x_560 : vec3<f32> = vec3<f32>(x_559.y, x_559.x, x_557.x);
+ let x_96 : ptr<function, i32> = &(stack[x_94]);
+ let x_1017 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1017;
+ let x_561 : vec3<f32> = vec3<f32>(x_556.y, x_556.y, x_556.y);
+ let x_1018 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = 0i;
+ *(x_96) = x_95;
+ let x_1019 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1019;
+ let x_97 : i32 = top;
+ let x_1020 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1020;
+ let x_562 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, x_558.y, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ let x_1021 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1021;
+ let x_98 : i32 = (x_97 + 1i);
+ let x_1022 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1022;
+ let x_563 : vec3<f32> = vec3<f32>(x_559.x, x_559.z, x_556.y);
+ top = x_98;
+ let x_1023 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1023;
+ let x_99 : i32 = h_1;
+ let x_1024 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1024;
+ let x_564 : vec3<f32> = vec3<f32>(x_558.x, x_561.x, x_558.y);
+ let x_1025 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1025;
+ let x_100 : ptr<function, i32> = &(stack[x_98]);
+ let x_1026 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1026;
+ let x_565 : vec2<f32> = vec2<f32>(x_564.z, x_564.z);
+ let x_1027 : i32 = p;
+ p = 0i;
+ p = x_1027;
+ *(x_100) = x_99;
+ loop {
+ let x_566 : vec3<f32> = vec3<f32>(x_563.x, x_563.x, x_563.x);
+ let x_1028 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1028;
+ let x_1029 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1029;
+ let x_106 : i32 = top;
+ let x_1030 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1030;
+ let x_567 : vec2<f32> = vec2<f32>(x_558.x, x_564.z);
+ let x_1031 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1031;
+ if ((x_106 >= bitcast<i32>(0u))) {
+ } else {
+ break;
+ }
+ let x_1032 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_1032;
+ let x_568 : vec3<f32> = vec3<f32>(x_559.y, x_559.x, x_563.y);
+ let x_1033 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1033;
+ let x_108 : i32 = top;
+ let x_569 : vec3<f32> = vec3<f32>(x_565.x, x_567.y, x_565.x);
+ let x_1034 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1034;
+ let x_570 : vec2<f32> = vec2<f32>(x_556.x, x_556.x);
+ let x_1035 : i32 = p;
+ p = 0i;
+ p = x_1035;
+ top = (x_108 - bitcast<i32>(1u));
+ let x_1036 : i32 = p;
+ p = 0i;
+ p = x_1036;
+ let x_110 : ptr<function, i32> = &(stack[x_108]);
+ let x_1037 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1037;
+ let x_111 : i32 = *(x_110);
+ let x_1038 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1038;
+ let x_571 : vec3<f32> = vec3<f32>(x_559.y, x_559.x, x_564.y);
+ let x_1039 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1039;
+ h_1 = x_111;
+ let x_1040 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1040;
+ let x_572 : vec2<f32> = vec2<f32>(x_562.y, x_561.y);
+ let x_1041 : i32 = p;
+ p = 0i;
+ p = x_1041;
+ let x_112 : i32 = top;
+ let x_1042 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1042;
+ let x_1043 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1043;
+ let x_573 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).z);
+ top = (x_112 - 1i);
+ let x_1044 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1044;
+ let x_574 : vec3<f32> = vec3<f32>(x_570.y, x_565.x, x_570.y);
+ let x_1045 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1045;
+ let x_114 : ptr<function, i32> = &(stack[x_112]);
+ let x_575 : vec2<f32> = vec2<f32>(x_564.y, x_564.z);
+ let x_1046 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1046;
+ let x_115 : i32 = *(x_114);
+ let x_1047 : i32 = p;
+ p = 0i;
+ p = x_1047;
+ let x_576 : vec3<f32> = vec3<f32>(x_573.y, x_573.y, x_565.x);
+ let x_1048 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1048;
+ l_1 = x_115;
+ let x_1049 : i32 = top;
+ top = 0i;
+ top = x_1049;
+ let x_118 : i32 = l_1;
+ param_4 = x_118;
+ let x_1050 : i32 = *(x_110);
+ *(x_110) = 0i;
+ *(x_110) = x_1050;
+ let x_577 : vec2<f32> = vec2<f32>(x_569.y, x_569.z);
+ let x_120 : i32 = h_1;
+ let x_578 : vec2<f32> = vec2<f32>(x_558.x, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ param_5 = x_120;
+ let x_1051 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1051;
+ let x_121 : i32 = performPartition_i1_i1_(&(param_4), &(param_5));
+ let x_579 : vec2<f32> = vec2<f32>(x_567.x, x_568.x);
+ let x_1052 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1052;
+ p = x_121;
+ let x_1053 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1053;
+ let x_122 : i32 = p;
+ let x_1054 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1054;
+ let x_580 : vec2<f32> = vec2<f32>(x_568.y, x_568.y);
+ let x_1055 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1055;
+ let x_1056 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1056;
+ let x_124 : i32 = l_1;
+ let x_1057 : i32 = *(x_110);
+ *(x_110) = 0i;
+ *(x_110) = x_1057;
+ let x_1058 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1058;
+ let x_582 : vec2<f32> = vec2<f32>(x_567.y, x_573.x);
+ let x_1059 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1059;
+ if (((x_122 - bitcast<i32>(1u)) > x_124)) {
+ let x_1060 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1060;
+ let x_128 : i32 = top;
+ let x_583 : vec2<f32> = vec2<f32>(x_571.y, x_556.y);
+ let x_1061 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1061;
+ let x_1062 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1062;
+ let x_584 : vec2<f32> = vec2<f32>(x_569.z, x_569.y);
+ let x_585 : vec3<f32> = vec3<f32>(x_580.y, x_577.x, x_577.x);
+ let x_130 : i32 = l_1;
+ let x_1063 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1063;
+ let x_586 : vec2<f32> = vec2<f32>(x_564.x, x_585.x);
+ let x_1064 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1064;
+ let x_131 : ptr<function, i32> = &(stack[(1i + x_128)]);
+ let x_1065 : i32 = *(x_110);
+ *(x_110) = 0i;
+ *(x_110) = x_1065;
+ let x_587 : vec3<f32> = vec3<f32>(x_566.y, x_566.y, x_563.x);
+ let x_1066 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1066;
+ *(x_131) = x_130;
+ let x_132 : i32 = top;
+ let x_1067 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1067;
+ let x_588 : vec2<f32> = vec2<f32>(x_575.y, x_575.x);
+ let x_1068 : i32 = *(x_131);
+ *(x_131) = 0i;
+ *(x_131) = x_1068;
+ let x_133 : i32 = bitcast<i32>((1u + bitcast<u32>(x_132)));
+ let x_1069 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1069;
+ let x_589 : vec3<f32> = vec3<f32>(x_576.z, x_588.y, x_576.z);
+ let x_1070 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1070;
+ top = x_133;
+ let x_1071 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1071;
+ let x_134 : i32 = p;
+ let x_590 : vec2<f32> = vec2<f32>(x_576.x, x_573.y);
+ let x_1072 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1072;
+ let x_136 : ptr<function, i32> = &(stack[x_133]);
+ let x_1073 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1073;
+ *(x_136) = (x_134 - bitcast<i32>(1u));
+ let x_1074 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1074;
+ let x_591 : vec2<f32> = vec2<f32>(x_569.z, x_569.y);
+ let x_1075 : i32 = *(x_136);
+ *(x_136) = 0i;
+ *(x_136) = x_1075;
+ }
+ let x_1076 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1076;
+ let x_592 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ let x_1077 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_1077;
+ let x_137 : i32 = p;
+ let x_1078 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1078;
+ let x_593 : vec3<f32> = vec3<f32>(x_571.z, x_556.x, x_556.y);
+ let x_1079 : i32 = p;
+ p = 0i;
+ p = x_1079;
+ let x_594 : vec3<f32> = vec3<f32>(x_563.z, x_563.x, x_575.x);
+ let x_1080 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1080;
+ let x_139 : i32 = h_1;
+ let x_1081 : i32 = top;
+ top = 0i;
+ top = x_1081;
+ let x_595 : vec3<f32> = vec3<f32>(x_560.z, x_568.x, x_560.x);
+ let x_1082 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1082;
+ let x_1083 : i32 = p;
+ p = 0i;
+ p = x_1083;
+ if ((bitcast<i32>((1u + bitcast<u32>(x_137))) < x_139)) {
+ let x_1084 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1084;
+ let x_596 : vec2<f32> = vec2<f32>(x_592.y, x_582.x);
+ let x_1085 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1085;
+ let x_143 : i32 = top;
+ let x_1086 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1086;
+ let x_597 : vec3<f32> = vec3<f32>(x_562.y, x_560.y, x_560.y);
+ let x_144 : i32 = (x_143 + 1i);
+ let x_1087 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1087;
+ top = x_144;
+ let x_1088 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1088;
+ let x_145 : i32 = p;
+ let x_1089 : i32 = param_5;
+ param_5 = 0i;
+ param_5 = x_1089;
+ let x_599 : vec3<f32> = vec3<f32>(x_560.z, x_560.x, x_568.x);
+ let x_1090 : i32 = p;
+ p = 0i;
+ p = x_1090;
+ let x_600 : vec3<f32> = vec3<f32>(x_556.x, x_580.x, x_580.x);
+ let x_1091 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1091;
+ let x_147 : ptr<function, i32> = &(stack[x_144]);
+ let x_1092 : i32 = *(x_110);
+ *(x_110) = 0i;
+ *(x_110) = x_1092;
+ let x_601 : vec2<f32> = vec2<f32>(x_563.x, x_563.y);
+ *(x_147) = bitcast<i32>((1u + bitcast<u32>(x_145)));
+ let x_1093 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1093;
+ let x_148 : i32 = top;
+ let x_1094 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1094;
+ let x_602 : vec2<f32> = vec2<f32>(x_565.y, x_599.y);
+ let x_1095 : array<i32, 10u> = stack;
+ stack = array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i);
+ stack = x_1095;
+ let x_149 : i32 = (x_148 + bitcast<i32>(1u));
+ let x_1096 : i32 = *(x_147);
+ *(x_147) = 0i;
+ *(x_147) = x_1096;
+ top = x_149;
+ let x_1097 : i32 = param_4;
+ param_4 = 0i;
+ param_4 = x_1097;
+ let x_150 : i32 = h_1;
+ let x_1098 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1098;
+ let x_1099 : i32 = *(x_96);
+ *(x_96) = 0i;
+ *(x_96) = x_1099;
+ stack[x_149] = x_150;
+ let x_1100 : i32 = *(x_114);
+ *(x_114) = 0i;
+ *(x_114) = x_1100;
+ let x_603 : vec3<f32> = vec3<f32>(x_568.y, x_564.x, x_564.x);
+ let x_1101 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1101;
+ }
+ let x_1102 : i32 = *(x_100);
+ *(x_100) = 0i;
+ *(x_100) = x_1102;
+
+ continuing {
+ let x_1103 : i32 = l_1;
+ l_1 = 0i;
+ l_1 = x_1103;
+ let x_604 : vec2<f32> = vec2<f32>(x_563.z, x_564.x);
+ let x_1104 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_1104;
+ }
+ }
+ let x_1105 : i32 = h_1;
+ h_1 = 0i;
+ h_1 = x_1105;
+ return;
+}
+
+fn main_1() {
+ var color : vec3<f32>;
+ var i_2 : i32;
+ var uv : vec2<f32>;
+ let x_717 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_717;
+ i_2 = 0i;
+ let x_721 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_721;
+ if (true) {
+ let x_722 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_722;
+ let x_431 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).x, vec3<f32>(1.0f, 2.0f, 3.0f).x);
+ let x_158 : i32 = i_2;
+ let x_723 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_723;
+ let x_725 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_725;
+ let x_432 : vec2<f32> = vec2<f32>(x_431.y, x_431.y);
+ let x_726 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_726;
+ }
+ let x_756 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_756;
+ let x_446 : vec2<f32> = vec2<f32>(vec2<f32>().x, vec2<f32>().x);
+ let x_757 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_757;
+ quicksort_();
+ let x_758 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_758;
+ let x_184 : vec4<f32> = gl_FragCoord;
+ let x_759 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_759;
+ let x_447 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y);
+ let x_760 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_760;
+ let x_185 : vec2<f32> = vec2<f32>(x_184.x, x_184.y);
+ let x_448 : vec3<f32> = vec3<f32>(x_185.y, x_446.y, x_446.y);
+ let x_761 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_761;
+ let x_762 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_762;
+ let x_191 : vec2<f32> = x_188.resolution;
+ let x_763 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_763;
+ let x_449 : vec3<f32> = vec3<f32>(x_184.y, vec3<f32>(1.0f, 2.0f, 3.0f).z, x_184.w);
+ let x_764 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_764;
+ let x_192 : vec2<f32> = (x_185 / x_191);
+ let x_765 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_765;
+ let x_450 : vec2<f32> = vec2<f32>(x_447.x, x_185.y);
+ let x_766 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ let x_767 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_767;
+ color = x_766;
+ uv = x_192;
+ color = vec3<f32>(1.0f, 2.0f, 3.0f);
+ let x_768 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_768;
+ let x_451 : vec3<f32> = vec3<f32>(x_185.x, x_185.y, x_446.y);
+ let x_769 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_769;
+ let x_200 : ptr<private, i32> = &(obj.numbers[0u]);
+ let x_770 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_770;
+ let x_201 : i32 = *(x_200);
+ let x_771 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_771;
+ let x_772 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_772;
+ let x_206 : f32 = color.x;
+ let x_773 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_773;
+ let x_452 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec3<f32>(1.0f, 2.0f, 3.0f).y);
+ let x_774 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_774;
+ let x_775 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_775;
+ let x_453 : vec3<f32> = vec3<f32>(x_451.x, x_450.x, x_450.y);
+ color.x = (x_206 + f32(x_201));
+ let x_776 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_776;
+ let x_777 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_777;
+ let x_454 : vec2<f32> = vec2<f32>(x_184.y, x_184.y);
+ let x_210 : f32 = uv.x;
+ let x_455 : vec2<f32> = vec2<f32>(x_192.y, x_192.x);
+ let x_778 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_778;
+ let x_779 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_779;
+ if ((x_210 > 0.25f)) {
+ let x_780 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_780;
+ let x_781 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_781;
+ let x_456 : vec3<f32> = vec3<f32>(vec2<f32>().y, x_448.y, x_448.y);
+ let x_782 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_782;
+ let x_216 : i32 = obj.numbers[1i];
+ let x_783 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_783;
+ let x_457 : vec2<f32> = vec2<f32>(x_454.x, x_454.x);
+ let x_784 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_784;
+ let x_785 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_785;
+ let x_458 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).z, vec2<f32>().y);
+ let x_786 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_786;
+ let x_219 : f32 = color[0i];
+ let x_787 : f32 = color[0i];
+ color[0i] = 0.0f;
+ color[0i] = x_787;
+ let x_788 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_788;
+ let x_789 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_789;
+ let x_459 : vec3<f32> = vec3<f32>(x_454.y, x_454.y, x_447.y);
+ let x_790 : f32 = color[0i];
+ color[0i] = 0.0f;
+ color[0i] = x_790;
+ color.x = (f32(x_216) + x_219);
+ let x_791 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_791;
+ }
+ let x_792 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_792;
+ let x_793 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_793;
+ let x_223 : f32 = uv.x;
+ let x_794 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_794;
+ let x_460 : vec3<f32> = vec3<f32>(x_453.z, x_453.y, x_453.y);
+ let x_795 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_795;
+ let x_796 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_796;
+ let x_461 : vec2<f32> = vec2<f32>(vec2<f32>().y, vec2<f32>().y);
+ let x_797 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_797;
+ if ((x_223 > 0.5f)) {
+ let x_798 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_798;
+ let x_462 : vec2<f32> = vec2<f32>(x_446.x, x_446.x);
+ let x_799 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_799;
+ let x_229 : ptr<private, i32> = &(obj.numbers[2u]);
+ let x_800 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_800;
+ let x_463 : vec3<f32> = vec3<f32>(x_453.x, x_453.z, x_461.y);
+ let x_801 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_801;
+ let x_230 : i32 = *(x_229);
+ let x_802 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_802;
+ let x_803 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_803;
+ let x_804 : i32 = *(x_229);
+ *(x_229) = 0i;
+ *(x_229) = x_804;
+ let x_464 : vec2<f32> = vec2<f32>(x_450.y, x_191.x);
+ let x_805 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_805;
+ let x_234 : f32 = color.y;
+ let x_806 : i32 = *(x_229);
+ *(x_229) = 0i;
+ *(x_229) = x_806;
+ let x_465 : vec2<f32> = vec2<f32>(x_463.x, x_185.x);
+ let x_807 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_807;
+ let x_808 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_808;
+ let x_466 : vec2<f32> = vec2<f32>(x_455.y, vec2<f32>().y);
+ let x_809 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_809;
+ color.y = (f32(x_230) + x_234);
+ let x_810 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_810;
+ }
+ let x_811 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_811;
+ let x_467 : vec2<f32> = vec2<f32>(x_191.x, x_191.x);
+ let x_812 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_812;
+ let x_238 : f32 = uv[0i];
+ let x_813 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_813;
+ let x_814 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_814;
+ if ((x_238 > 0.75f)) {
+ let x_815 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_815;
+ let x_245 : i32 = obj.numbers[3i];
+ let x_816 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_816;
+ let x_817 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_817;
+ let x_468 : vec3<f32> = vec3<f32>(x_467.x, x_467.x, x_467.x);
+ let x_818 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_818;
+ let x_819 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_819;
+ let x_249 : f32 = color.z;
+ let x_820 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_820;
+ let x_469 : vec3<f32> = vec3<f32>(x_467.x, x_191.y, x_467.y);
+ let x_821 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_821;
+ let x_822 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_822;
+ let x_470 : vec2<f32> = vec2<f32>(vec2<f32>().x, vec2<f32>().y);
+ let x_823 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_823;
+ color.z = (x_249 + f32(x_245));
+ let x_824 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_824;
+ let x_471 : vec2<f32> = vec2<f32>(x_470.y, x_470.y);
+ }
+ let x_825 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_825;
+ let x_472 : vec3<f32> = vec3<f32>(x_454.x, x_454.y, x_454.y);
+ let x_253 : ptr<private, i32> = &(obj.numbers[4i]);
+ let x_254 : i32 = *(x_253);
+ let x_826 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_826;
+ let x_827 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_827;
+ let x_473 : vec3<f32> = vec3<f32>(x_446.y, x_453.x, x_453.x);
+ let x_828 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_828;
+ let x_474 : vec2<f32> = vec2<f32>(x_191.x, x_184.z);
+ let x_829 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_829;
+ let x_257 : f32 = color.y;
+ let x_830 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_830;
+ let x_475 : vec2<f32> = vec2<f32>(x_467.x, x_450.x);
+ let x_831 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_831;
+ let x_832 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_832;
+ let x_476 : vec2<f32> = vec2<f32>(x_451.z, x_460.y);
+ color.y = (x_257 + f32(x_254));
+ let x_477 : vec3<f32> = vec3<f32>(vec2<f32>().x, x_472.x, vec2<f32>().y);
+ let x_833 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_833;
+ let x_834 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_834;
+ let x_478 : vec2<f32> = vec2<f32>(x_472.x, x_472.y);
+ let x_835 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_835;
+ let x_261 : f32 = uv.y;
+ let x_836 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_836;
+ let x_479 : vec3<f32> = vec3<f32>(vec2<f32>().y, x_454.y, vec2<f32>().x);
+ let x_837 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_837;
+ let x_838 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_838;
+ let x_480 : vec3<f32> = vec3<f32>(x_446.x, x_446.x, vec2<f32>().y);
+ let x_839 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_839;
+ if ((x_261 > 0.25f)) {
+ let x_481 : vec2<f32> = vec2<f32>(x_447.x, x_480.z);
+ let x_840 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_840;
+ let x_267 : i32 = obj.numbers[5u];
+ let x_841 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_841;
+ let x_842 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_842;
+ let x_843 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_843;
+ let x_270 : f32 = color.x;
+ let x_844 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_844;
+ let x_482 : vec3<f32> = vec3<f32>(x_455.x, x_475.y, x_455.y);
+ let x_845 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_845;
+ let x_846 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_846;
+ let x_847 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_847;
+ let x_483 : vec3<f32> = vec3<f32>(x_184.w, x_184.w, x_192.x);
+ let x_848 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_848;
+ color.x = (f32(x_267) + x_270);
+ let x_484 : vec3<f32> = vec3<f32>(x_454.y, x_450.x, x_454.y);
+ let x_849 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_849;
+ }
+ let x_850 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_850;
+ let x_485 : vec3<f32> = vec3<f32>(x_467.x, x_450.y, x_450.x);
+ let x_851 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_851;
+ let x_852 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_852;
+ let x_274 : f32 = uv.y;
+ let x_853 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_853;
+ if ((x_274 > 0.5f)) {
+ let x_854 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_854;
+ let x_486 : vec2<f32> = vec2<f32>(x_480.y, x_455.y);
+ let x_279 : ptr<private, i32> = &(obj.numbers[6u]);
+ let x_855 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_855;
+ let x_487 : vec2<f32> = vec2<f32>(x_449.z, x_449.y);
+ let x_856 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_856;
+ let x_280 : i32 = *(x_279);
+ let x_857 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_857;
+ let x_858 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_858;
+ let x_859 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_859;
+ let x_488 : vec2<f32> = vec2<f32>(x_473.z, x_473.y);
+ let x_283 : f32 = color.y;
+ let x_860 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_860;
+ let x_861 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_861;
+ let x_489 : vec2<f32> = vec2<f32>(x_475.y, x_475.x);
+ let x_862 : i32 = *(x_279);
+ *(x_279) = 0i;
+ *(x_279) = x_862;
+ let x_863 : i32 = *(x_279);
+ *(x_279) = 0i;
+ *(x_279) = x_863;
+ let x_490 : vec2<f32> = vec2<f32>(x_480.z, x_480.z);
+ let x_864 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_864;
+ color.y = (f32(x_280) + x_283);
+ let x_865 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_865;
+ let x_491 : vec2<f32> = vec2<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, x_454.x);
+ let x_866 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_866;
+ }
+ let x_492 : vec2<f32> = vec2<f32>(x_455.y, x_455.y);
+ let x_867 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_867;
+ let x_287 : f32 = uv.y;
+ let x_868 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_868;
+ let x_493 : vec2<f32> = vec2<f32>(x_475.x, x_475.y);
+ let x_869 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_869;
+ let x_870 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_870;
+ let x_494 : vec3<f32> = vec3<f32>(x_191.x, x_191.y, x_191.y);
+ let x_871 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_871;
+ if ((x_287 > 0.75f)) {
+ let x_872 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_872;
+ let x_873 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_873;
+ let x_495 : vec3<f32> = vec3<f32>(x_192.y, x_192.x, x_192.y);
+ let x_874 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_874;
+ let x_293 : i32 = obj.numbers[7i];
+ let x_875 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_875;
+ let x_496 : vec3<f32> = vec3<f32>(x_475.x, x_467.y, x_467.x);
+ let x_876 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_876;
+ let x_497 : vec2<f32> = vec2<f32>(x_477.x, x_461.y);
+ let x_877 : i32 = *(x_200);
+ *(x_200) = 0i;
+ *(x_200) = x_877;
+ let x_878 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_878;
+ let x_498 : vec3<f32> = vec3<f32>(x_478.x, x_478.y, x_478.x);
+ let x_879 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_879;
+ let x_296 : f32 = color.z;
+ let x_880 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_880;
+ let x_499 : vec2<f32> = vec2<f32>(x_184.x, x_184.y);
+ let x_881 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_881;
+ let x_882 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_882;
+ let x_883 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_883;
+ let x_500 : vec3<f32> = vec3<f32>(x_499.y, x_499.y, x_494.z);
+ let x_884 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_884;
+ color.z = (f32(x_293) + x_296);
+ let x_885 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_885;
+ let x_501 : vec2<f32> = vec2<f32>(x_453.x, x_453.z);
+ let x_886 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_886;
+ }
+ let x_887 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_887;
+ let x_502 : vec2<f32> = vec2<f32>(x_451.y, x_192.y);
+ let x_888 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_888;
+ let x_300 : ptr<private, i32> = &(obj.numbers[8i]);
+ let x_301 : i32 = *(x_300);
+ let x_889 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_889;
+ let x_503 : vec2<f32> = vec2<f32>(x_185.x, x_451.z);
+ let x_890 : i32 = *(x_300);
+ *(x_300) = 0i;
+ *(x_300) = x_890;
+ let x_891 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_891;
+ let x_504 : vec2<f32> = vec2<f32>(x_453.y, vec2<f32>().x);
+ let x_892 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_892;
+ let x_505 : vec3<f32> = vec3<f32>(x_504.x, x_504.y, x_504.x);
+ let x_893 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_893;
+ let x_304 : f32 = color.z;
+ let x_894 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_894;
+ let x_506 : vec2<f32> = vec2<f32>(x_493.x, x_492.x);
+ let x_895 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_895;
+ let x_896 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_896;
+ let x_507 : vec2<f32> = vec2<f32>(x_461.x, x_447.x);
+ let x_897 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_897;
+ color.z = (x_304 + f32(x_301));
+ let x_898 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_898;
+ let x_899 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_899;
+ let x_508 : vec3<f32> = vec3<f32>(x_461.y, x_461.x, x_506.y);
+ let x_900 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_900;
+ let x_308 : f32 = uv.x;
+ let x_901 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_901;
+ let x_509 : vec3<f32> = vec3<f32>(x_503.y, x_503.x, x_448.z);
+ let x_902 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_902;
+ let x_310 : f32 = uv.y;
+ let x_903 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_903;
+ let x_904 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_904;
+ let x_510 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, x_485.y, x_485.z);
+ let x_905 : f32 = color.z;
+ color.z = 0.0f;
+ color.z = x_905;
+ let x_906 : i32 = i_2;
+ i_2 = 0i;
+ i_2 = x_906;
+ let x_511 : vec2<f32> = vec2<f32>(x_485.z, x_485.y);
+ let x_907 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_907;
+ let x_908 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_908;
+ let x_512 : vec3<f32> = vec3<f32>(x_455.y, x_455.y, x_455.y);
+ let x_909 : i32 = *(x_253);
+ *(x_253) = 0i;
+ *(x_253) = x_909;
+ if ((abs((x_308 - x_310)) < 0.25f)) {
+ let x_910 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_910;
+ let x_911 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_911;
+ let x_513 : vec3<f32> = vec3<f32>(x_505.z, x_505.x, x_448.x);
+ let x_912 : i32 = *(x_300);
+ *(x_300) = 0i;
+ *(x_300) = x_912;
+ let x_317 : i32 = obj.numbers[9u];
+ let x_514 : vec3<f32> = vec3<f32>(x_474.y, x_474.y, x_474.y);
+ let x_913 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_913;
+ let x_320 : f32 = color.x;
+ let x_914 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_914;
+ let x_515 : vec2<f32> = vec2<f32>(x_502.x, x_502.y);
+ let x_915 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_915;
+ let x_916 : vec3<f32> = color;
+ color = vec3<f32>(0.0f, 0.0f, 0.0f);
+ color = x_916;
+ let x_516 : vec2<f32> = vec2<f32>(x_452.x, x_452.x);
+ let x_917 : vec2<f32> = uv;
+ uv = vec2<f32>(0.0f, 0.0f);
+ uv = x_917;
+ let x_918 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_918;
+ let x_517 : vec3<f32> = vec3<f32>(vec2<f32>().x, vec2<f32>().x, vec2<f32>().y);
+ color.x = (f32(x_317) + x_320);
+ let x_919 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_919;
+ let x_518 : vec3<f32> = vec3<f32>(x_480.y, x_508.x, x_480.x);
+ let x_920 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_920;
+ }
+ let x_921 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_921;
+ let x_325 : vec3<f32> = color;
+ let x_922 : f32 = uv[0i];
+ uv[0i] = 0.0f;
+ uv[0i] = x_922;
+ let x_519 : vec3<f32> = vec3<f32>(x_447.x, x_446.x, x_446.y);
+ let x_326 : vec3<f32> = normalize(x_325);
+ let x_923 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_923;
+ let x_924 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_924;
+ let x_925 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_925;
+ let x_926 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_926;
+ let x_520 : vec2<f32> = vec2<f32>(x_506.y, x_519.y);
+ let x_927 : f32 = color.y;
+ color.y = 0.0f;
+ color.y = x_927;
+ let x_330 : vec4<f32> = vec4<f32>(x_326.x, x_326.y, x_326.z, 1.0f);
+ let x_928 : f32 = uv.y;
+ uv.y = 0.0f;
+ uv.y = x_928;
+ let x_521 : vec3<f32> = vec3<f32>(vec3<f32>(1.0f, 2.0f, 3.0f).y, vec3<f32>(1.0f, 2.0f, 3.0f).y, x_520.y);
+ let x_929 : f32 = uv.x;
+ uv.x = 0.0f;
+ uv.x = x_929;
+ x_GLF_color = x_330;
+ let x_930 : QuicksortObject = obj;
+ obj = QuicksortObject(array<i32, 10u>(0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i, 0i));
+ obj = x_930;
+ let x_522 : vec3<f32> = vec3<f32>(x_330.w, x_330.y, x_493.x);
+ let x_931 : f32 = color.x;
+ color.x = 0.0f;
+ color.x = x_931;
+ return;
+}
+
+struct main_out {
+ @location(0)
+ x_GLF_color_1 : vec4<f32>,
+}
+
+@fragment
+fn main(@builtin(position) gl_FragCoord_param : vec4<f32>) -> main_out {
+ gl_FragCoord = gl_FragCoord_param;
+ main_1();
+ return main_out(x_GLF_color);
+}
+
+error: function-scope 'var' must have a constructible type
diff --git a/test/tint/bug/tint/913.wgsl b/test/tint/bug/tint/913.wgsl
index a7786d5..b857106 100644
--- a/test/tint/bug/tint/913.wgsl
+++ b/test/tint/bug/tint/913.wgsl
@@ -18,8 +18,8 @@
}
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
- let srcSize : vec2<i32> = textureDimensions(src);
- let dstSize : vec2<i32> = textureDimensions(dst);
+ let srcSize = textureDimensions(src);
+ let dstSize = textureDimensions(dst);
let dstTexCoord : vec2<u32> = vec2<u32>(GlobalInvocationID.xy);
let nonCoveredColor : vec4<f32> =
vec4<f32>(0.0, 1.0, 0.0, 1.0); // should be green
@@ -40,7 +40,7 @@
// which is flipped and need to unpack flip during the copy.
// We need to calculate the expect y coord based on this rule.
if (uniforms.dstTextureFlipY == 1u) {
- srcTexCoord.y = u32(srcSize.y) - srcTexCoord.y - 1u;
+ srcTexCoord.y = srcSize.y - srcTexCoord.y - 1u;
}
let srcColor : vec4<f32> = textureLoad(src, vec2<i32>(srcTexCoord), 0);
@@ -60,7 +60,7 @@
aboutEqual(dstColor.a, srcColor.a);
}
}
- let outputIndex : u32 = GlobalInvocationID.y * u32(dstSize.x) +
+ let outputIndex : u32 = GlobalInvocationID.y * dstSize.x +
GlobalInvocationID.x;
if (success) {
output.result[outputIndex] = 1u;
diff --git a/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
index 2c8eb01..f95b95c 100644
--- a/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/913.wgsl.expected.dxc.hlsl
@@ -16,10 +16,10 @@
void main_inner(uint3 GlobalInvocationID) {
int2 tint_tmp;
src.GetDimensions(tint_tmp.x, tint_tmp.y);
- const int2 srcSize = tint_tmp;
+ const uint2 srcSize = tint_tmp;
int2 tint_tmp_1;
tint_symbol.GetDimensions(tint_tmp_1.x, tint_tmp_1.y);
- const int2 dstSize = tint_tmp_1;
+ const uint2 dstSize = tint_tmp_1;
const uint2 dstTexCoord = uint2(GlobalInvocationID.xy);
const float4 nonCoveredColor = float4(0.0f, 1.0f, 0.0f, 1.0f);
bool success = true;
@@ -44,7 +44,7 @@
} else {
uint2 srcTexCoord = ((dstTexCoord - uniforms[1].xy) + uniforms[0].zw);
if ((uniforms[0].x == 1u)) {
- srcTexCoord.y = ((uint(srcSize.y) - srcTexCoord.y) - 1u);
+ srcTexCoord.y = ((srcSize.y - srcTexCoord.y) - 1u);
}
const float4 srcColor = src.Load(int3(int2(srcTexCoord), 0));
const float4 dstColor = tint_symbol.Load(int3(int2(dstTexCoord), 0));
@@ -78,7 +78,7 @@
success = tint_symbol_5;
}
}
- const uint outputIndex = ((GlobalInvocationID.y * uint(dstSize.x)) + GlobalInvocationID.x);
+ const uint outputIndex = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
if (success) {
output.Store((4u * outputIndex), asuint(1u));
} else {
diff --git a/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
index 2c8eb01..f95b95c 100644
--- a/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/913.wgsl.expected.fxc.hlsl
@@ -16,10 +16,10 @@
void main_inner(uint3 GlobalInvocationID) {
int2 tint_tmp;
src.GetDimensions(tint_tmp.x, tint_tmp.y);
- const int2 srcSize = tint_tmp;
+ const uint2 srcSize = tint_tmp;
int2 tint_tmp_1;
tint_symbol.GetDimensions(tint_tmp_1.x, tint_tmp_1.y);
- const int2 dstSize = tint_tmp_1;
+ const uint2 dstSize = tint_tmp_1;
const uint2 dstTexCoord = uint2(GlobalInvocationID.xy);
const float4 nonCoveredColor = float4(0.0f, 1.0f, 0.0f, 1.0f);
bool success = true;
@@ -44,7 +44,7 @@
} else {
uint2 srcTexCoord = ((dstTexCoord - uniforms[1].xy) + uniforms[0].zw);
if ((uniforms[0].x == 1u)) {
- srcTexCoord.y = ((uint(srcSize.y) - srcTexCoord.y) - 1u);
+ srcTexCoord.y = ((srcSize.y - srcTexCoord.y) - 1u);
}
const float4 srcColor = src.Load(int3(int2(srcTexCoord), 0));
const float4 dstColor = tint_symbol.Load(int3(int2(dstTexCoord), 0));
@@ -78,7 +78,7 @@
success = tint_symbol_5;
}
}
- const uint outputIndex = ((GlobalInvocationID.y * uint(dstSize.x)) + GlobalInvocationID.x);
+ const uint outputIndex = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
if (success) {
output.Store((4u * outputIndex), asuint(1u));
} else {
diff --git a/test/tint/bug/tint/913.wgsl.expected.glsl b/test/tint/bug/tint/913.wgsl.expected.glsl
index 03f0da1..7fe0bba 100644
--- a/test/tint/bug/tint/913.wgsl.expected.glsl
+++ b/test/tint/bug/tint/913.wgsl.expected.glsl
@@ -19,8 +19,8 @@
uniform highp sampler2D src_1;
uniform highp sampler2D dst_1;
void tint_symbol_1(uvec3 GlobalInvocationID) {
- ivec2 srcSize = textureSize(src_1, 0);
- ivec2 dstSize = textureSize(dst_1, 0);
+ uvec2 srcSize = uvec2(textureSize(src_1, 0));
+ uvec2 dstSize = uvec2(textureSize(dst_1, 0));
uvec2 dstTexCoord = uvec2(GlobalInvocationID.xy);
vec4 nonCoveredColor = vec4(0.0f, 1.0f, 0.0f, 1.0f);
bool success = true;
@@ -45,7 +45,7 @@
} else {
uvec2 srcTexCoord = ((dstTexCoord - uniforms.dstCopyOrigin) + uniforms.srcCopyOrigin);
if ((uniforms.dstTextureFlipY == 1u)) {
- srcTexCoord.y = ((uint(srcSize.y) - srcTexCoord.y) - 1u);
+ srcTexCoord.y = ((srcSize.y - srcTexCoord.y) - 1u);
}
vec4 srcColor = texelFetch(src_1, ivec2(srcTexCoord), 0);
vec4 dstColor = texelFetch(dst_1, ivec2(dstTexCoord), 0);
@@ -79,7 +79,7 @@
success = tint_symbol_4;
}
}
- uint outputIndex = ((GlobalInvocationID.y * uint(dstSize.x)) + GlobalInvocationID.x);
+ uint outputIndex = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
if (success) {
tint_symbol.result[outputIndex] = 1u;
} else {
diff --git a/test/tint/bug/tint/913.wgsl.expected.msl b/test/tint/bug/tint/913.wgsl.expected.msl
index 06f2ded..62aa83f 100644
--- a/test/tint/bug/tint/913.wgsl.expected.msl
+++ b/test/tint/bug/tint/913.wgsl.expected.msl
@@ -31,8 +31,8 @@
}
void tint_symbol_inner(uint3 GlobalInvocationID, texture2d<float, access::sample> tint_symbol_7, texture2d<float, access::sample> tint_symbol_8, const constant Uniforms* const tint_symbol_9, device OutputBuf* const tint_symbol_10) {
- int2 const srcSize = int2(tint_symbol_7.get_width(), tint_symbol_7.get_height());
- int2 const dstSize = int2(tint_symbol_8.get_width(), tint_symbol_8.get_height());
+ uint2 const srcSize = uint2(tint_symbol_7.get_width(), tint_symbol_7.get_height());
+ uint2 const dstSize = uint2(tint_symbol_8.get_width(), tint_symbol_8.get_height());
uint2 const dstTexCoord = uint2(uint3(GlobalInvocationID).xy);
float4 const nonCoveredColor = float4(0.0f, 1.0f, 0.0f, 1.0f);
bool success = true;
@@ -41,7 +41,7 @@
} else {
uint2 srcTexCoord = ((dstTexCoord - (*(tint_symbol_9)).dstCopyOrigin) + (*(tint_symbol_9)).srcCopyOrigin);
if (((*(tint_symbol_9)).dstTextureFlipY == 1u)) {
- srcTexCoord[1] = ((uint(srcSize[1]) - srcTexCoord[1]) - 1u);
+ srcTexCoord[1] = ((srcSize[1] - srcTexCoord[1]) - 1u);
}
float4 const srcColor = tint_symbol_7.read(uint2(int2(srcTexCoord)), 0);
float4 const dstColor = tint_symbol_8.read(uint2(int2(dstTexCoord)), 0);
@@ -75,7 +75,7 @@
success = tint_symbol_3;
}
}
- uint const outputIndex = ((GlobalInvocationID[1] * uint(dstSize[0])) + GlobalInvocationID[0]);
+ uint const outputIndex = ((GlobalInvocationID[1] * dstSize[0]) + GlobalInvocationID[0]);
if (success) {
(*(tint_symbol_10)).result[outputIndex] = 1u;
} else {
diff --git a/test/tint/bug/tint/913.wgsl.expected.spvasm b/test/tint/bug/tint/913.wgsl.expected.spvasm
index 416999d..1abbbc0 100644
--- a/test/tint/bug/tint/913.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/913.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 207
+; Bound: 205
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
@@ -78,20 +78,20 @@
%void = OpTypeVoid
%29 = OpTypeFunction %void %v3uint
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
%int_0 = OpConstant %int 0
%v4float = OpTypeVector %float 4
- %44 = OpConstantNull %float
+ %43 = OpConstantNull %float
%float_1 = OpConstant %float 1
- %46 = OpConstantComposite %v4float %44 %float_1 %44 %float_1
+ %45 = OpConstantComposite %v4float %43 %float_1 %43 %float_1
%true = OpConstantTrue %bool
%_ptr_Function_bool = OpTypePointer Function %bool
- %50 = OpConstantNull %bool
+ %49 = OpConstantNull %bool
%uint_3 = OpConstant %uint 3
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
%uint_4 = OpConstant %uint 4
+ %v2int = OpTypeVector %int 2
%97 = OpConstantNull %int
%v4bool = OpTypeVector %bool 4
%_ptr_Uniform_v2uint = OpTypePointer Uniform %v2uint
@@ -100,8 +100,8 @@
%111 = OpConstantNull %v2uint
%_ptr_Function_uint = OpTypePointer Function %uint
%_ptr_StorageBuffer_uint = OpTypePointer StorageBuffer %uint
- %201 = OpConstantNull %uint
- %202 = OpTypeFunction %void
+ %199 = OpConstantNull %uint
+ %200 = OpTypeFunction %void
%aboutEqual = OpFunction %bool None %18
%value = OpFunctionParameter %float
%expect = OpFunctionParameter %float
@@ -114,81 +114,81 @@
%main_inner = OpFunction %void None %29
%GlobalInvocationID = OpFunctionParameter %v3uint
%33 = OpLabel
- %success = OpVariable %_ptr_Function_bool Function %50
+ %success = OpVariable %_ptr_Function_bool Function %49
%srcTexCoord = OpVariable %_ptr_Function_v2uint Function %111
-%tint_symbol_1 = OpVariable %_ptr_Function_bool Function %50
-%tint_symbol = OpVariable %_ptr_Function_bool Function %50
-%tint_symbol_5 = OpVariable %_ptr_Function_bool Function %50
-%tint_symbol_4 = OpVariable %_ptr_Function_bool Function %50
-%tint_symbol_3 = OpVariable %_ptr_Function_bool Function %50
-%tint_symbol_2 = OpVariable %_ptr_Function_bool Function %50
- %37 = OpLoad %7 %src
- %34 = OpImageQuerySizeLod %v2int %37 %int_0
- %40 = OpLoad %7 %dst
- %39 = OpImageQuerySizeLod %v2int %40 %int_0
- %42 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
+%tint_symbol_1 = OpVariable %_ptr_Function_bool Function %49
+%tint_symbol = OpVariable %_ptr_Function_bool Function %49
+%tint_symbol_5 = OpVariable %_ptr_Function_bool Function %49
+%tint_symbol_4 = OpVariable %_ptr_Function_bool Function %49
+%tint_symbol_3 = OpVariable %_ptr_Function_bool Function %49
+%tint_symbol_2 = OpVariable %_ptr_Function_bool Function %49
+ %35 = OpLoad %7 %src
+ %34 = OpImageQuerySizeLod %v2uint %35 %int_0
+ %39 = OpLoad %7 %dst
+ %38 = OpImageQuerySizeLod %v2uint %39 %int_0
+ %41 = OpVectorShuffle %v2uint %GlobalInvocationID %GlobalInvocationID 0 1
OpStore %success %true
- %51 = OpCompositeExtract %uint %42 0
- %55 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
- %56 = OpLoad %uint %55
- %57 = OpULessThan %bool %51 %56
- OpSelectionMerge %58 None
- OpBranchConditional %57 %58 %59
- %59 = OpLabel
- %60 = OpCompositeExtract %uint %42 1
- %62 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
- %63 = OpLoad %uint %62
- %64 = OpULessThan %bool %60 %63
- OpBranch %58
+ %50 = OpCompositeExtract %uint %41 0
+ %54 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
+ %55 = OpLoad %uint %54
+ %56 = OpULessThan %bool %50 %55
+ OpSelectionMerge %57 None
+ OpBranchConditional %56 %57 %58
%58 = OpLabel
- %65 = OpPhi %bool %57 %33 %64 %59
- OpSelectionMerge %66 None
- OpBranchConditional %65 %66 %67
- %67 = OpLabel
- %68 = OpCompositeExtract %uint %42 0
- %69 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
- %70 = OpLoad %uint %69
- %72 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_0
- %73 = OpLoad %uint %72
- %74 = OpIAdd %uint %70 %73
- %75 = OpUGreaterThanEqual %bool %68 %74
- OpBranch %66
+ %59 = OpCompositeExtract %uint %41 1
+ %61 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
+ %62 = OpLoad %uint %61
+ %63 = OpULessThan %bool %59 %62
+ OpBranch %57
+ %57 = OpLabel
+ %64 = OpPhi %bool %56 %33 %63 %58
+ OpSelectionMerge %65 None
+ OpBranchConditional %64 %65 %66
%66 = OpLabel
- %76 = OpPhi %bool %65 %58 %75 %67
- OpSelectionMerge %77 None
- OpBranchConditional %76 %77 %78
- %78 = OpLabel
- %79 = OpCompositeExtract %uint %42 1
- %80 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
- %81 = OpLoad %uint %80
- %82 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_1
- %83 = OpLoad %uint %82
- %84 = OpIAdd %uint %81 %83
- %85 = OpUGreaterThanEqual %bool %79 %84
- OpBranch %77
+ %67 = OpCompositeExtract %uint %41 0
+ %68 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_0
+ %69 = OpLoad %uint %68
+ %71 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_0
+ %72 = OpLoad %uint %71
+ %73 = OpIAdd %uint %69 %72
+ %74 = OpUGreaterThanEqual %bool %67 %73
+ OpBranch %65
+ %65 = OpLabel
+ %75 = OpPhi %bool %64 %57 %74 %66
+ OpSelectionMerge %76 None
+ OpBranchConditional %75 %76 %77
%77 = OpLabel
- %86 = OpPhi %bool %76 %66 %85 %78
- OpSelectionMerge %87 None
- OpBranchConditional %86 %88 %89
- %88 = OpLabel
- %90 = OpLoad %bool %success
- OpSelectionMerge %91 None
- OpBranchConditional %90 %92 %91
- %92 = OpLabel
- %95 = OpLoad %7 %dst
- %96 = OpBitcast %v2int %42
- %94 = OpImageFetch %v4float %95 %96 Lod %97
- %98 = OpFOrdEqual %v4bool %94 %46
- %93 = OpAll %bool %98
- OpBranch %91
+ %78 = OpCompositeExtract %uint %41 1
+ %79 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_3 %uint_1
+ %80 = OpLoad %uint %79
+ %81 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_4 %uint_1
+ %82 = OpLoad %uint %81
+ %83 = OpIAdd %uint %80 %82
+ %84 = OpUGreaterThanEqual %bool %78 %83
+ OpBranch %76
+ %76 = OpLabel
+ %85 = OpPhi %bool %75 %65 %84 %77
+ OpSelectionMerge %86 None
+ OpBranchConditional %85 %87 %88
+ %87 = OpLabel
+ %89 = OpLoad %bool %success
+ OpSelectionMerge %90 None
+ OpBranchConditional %89 %91 %90
%91 = OpLabel
- %100 = OpPhi %bool %90 %88 %93 %92
+ %94 = OpLoad %7 %dst
+ %95 = OpBitcast %v2int %41
+ %93 = OpImageFetch %v4float %94 %95 Lod %97
+ %98 = OpFOrdEqual %v4bool %93 %45
+ %92 = OpAll %bool %98
+ OpBranch %90
+ %90 = OpLabel
+ %100 = OpPhi %bool %89 %87 %92 %91
OpStore %success %100
- OpBranch %87
- %89 = OpLabel
+ OpBranch %86
+ %88 = OpLabel
%102 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_3
%103 = OpLoad %v2uint %102
- %104 = OpISub %v2uint %42 %103
+ %104 = OpISub %v2uint %41 %103
%106 = OpAccessChain %_ptr_Uniform_v2uint %uniforms %uint_2
%107 = OpLoad %v2uint %106
%108 = OpIAdd %v2uint %104 %107
@@ -200,133 +200,131 @@
OpBranchConditional %114 %116 %115
%116 = OpLabel
%118 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
- %120 = OpCompositeExtract %int %34 1
- %119 = OpBitcast %uint %120
- %121 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
- %122 = OpLoad %uint %121
- %123 = OpISub %uint %119 %122
- %124 = OpISub %uint %123 %uint_1
- OpStore %118 %124
+ %119 = OpCompositeExtract %uint %34 1
+ %120 = OpAccessChain %_ptr_Function_uint %srcTexCoord %uint_1
+ %121 = OpLoad %uint %120
+ %122 = OpISub %uint %119 %121
+ %123 = OpISub %uint %122 %uint_1
+ OpStore %118 %123
OpBranch %115
%115 = OpLabel
- %126 = OpLoad %7 %src
- %128 = OpLoad %v2uint %srcTexCoord
- %127 = OpBitcast %v2int %128
- %125 = OpImageFetch %v4float %126 %127 Lod %97
- %130 = OpLoad %7 %dst
- %131 = OpBitcast %v2int %42
- %129 = OpImageFetch %v4float %130 %131 Lod %97
- %132 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
- %133 = OpLoad %uint %132
- %134 = OpIEqual %bool %133 %uint_2
- OpSelectionMerge %135 None
- OpBranchConditional %134 %136 %137
- %136 = OpLabel
- %138 = OpLoad %bool %success
- OpStore %tint_symbol_1 %138
- %140 = OpLoad %bool %tint_symbol_1
- OpSelectionMerge %141 None
- OpBranchConditional %140 %142 %141
- %142 = OpLabel
- %144 = OpCompositeExtract %float %129 0
- %145 = OpCompositeExtract %float %125 0
- %143 = OpFunctionCall %bool %aboutEqual %144 %145
- OpStore %tint_symbol_1 %143
- OpBranch %141
- %141 = OpLabel
- %146 = OpLoad %bool %tint_symbol_1
- OpStore %tint_symbol %146
- %148 = OpLoad %bool %tint_symbol
- OpSelectionMerge %149 None
- OpBranchConditional %148 %150 %149
- %150 = OpLabel
- %152 = OpCompositeExtract %float %129 1
- %153 = OpCompositeExtract %float %125 1
- %151 = OpFunctionCall %bool %aboutEqual %152 %153
- OpStore %tint_symbol %151
- OpBranch %149
- %149 = OpLabel
- %154 = OpLoad %bool %tint_symbol
- OpStore %success %154
- OpBranch %135
- %137 = OpLabel
- %155 = OpLoad %bool %success
- OpStore %tint_symbol_5 %155
- %157 = OpLoad %bool %tint_symbol_5
- OpSelectionMerge %158 None
- OpBranchConditional %157 %159 %158
- %159 = OpLabel
- %161 = OpCompositeExtract %float %129 0
- %162 = OpCompositeExtract %float %125 0
- %160 = OpFunctionCall %bool %aboutEqual %161 %162
- OpStore %tint_symbol_5 %160
- OpBranch %158
- %158 = OpLabel
- %163 = OpLoad %bool %tint_symbol_5
- OpStore %tint_symbol_4 %163
- %165 = OpLoad %bool %tint_symbol_4
- OpSelectionMerge %166 None
- OpBranchConditional %165 %167 %166
- %167 = OpLabel
- %169 = OpCompositeExtract %float %129 1
- %170 = OpCompositeExtract %float %125 1
- %168 = OpFunctionCall %bool %aboutEqual %169 %170
- OpStore %tint_symbol_4 %168
- OpBranch %166
- %166 = OpLabel
- %171 = OpLoad %bool %tint_symbol_4
- OpStore %tint_symbol_3 %171
- %173 = OpLoad %bool %tint_symbol_3
- OpSelectionMerge %174 None
- OpBranchConditional %173 %175 %174
- %175 = OpLabel
- %177 = OpCompositeExtract %float %129 2
- %178 = OpCompositeExtract %float %125 2
- %176 = OpFunctionCall %bool %aboutEqual %177 %178
- OpStore %tint_symbol_3 %176
- OpBranch %174
- %174 = OpLabel
- %179 = OpLoad %bool %tint_symbol_3
- OpStore %tint_symbol_2 %179
- %181 = OpLoad %bool %tint_symbol_2
- OpSelectionMerge %182 None
- OpBranchConditional %181 %183 %182
- %183 = OpLabel
- %185 = OpCompositeExtract %float %129 3
- %186 = OpCompositeExtract %float %125 3
- %184 = OpFunctionCall %bool %aboutEqual %185 %186
- OpStore %tint_symbol_2 %184
- OpBranch %182
- %182 = OpLabel
- %187 = OpLoad %bool %tint_symbol_2
- OpStore %success %187
- OpBranch %135
+ %125 = OpLoad %7 %src
+ %127 = OpLoad %v2uint %srcTexCoord
+ %126 = OpBitcast %v2int %127
+ %124 = OpImageFetch %v4float %125 %126 Lod %97
+ %129 = OpLoad %7 %dst
+ %130 = OpBitcast %v2int %41
+ %128 = OpImageFetch %v4float %129 %130 Lod %97
+ %131 = OpAccessChain %_ptr_Uniform_uint %uniforms %uint_1
+ %132 = OpLoad %uint %131
+ %133 = OpIEqual %bool %132 %uint_2
+ OpSelectionMerge %134 None
+ OpBranchConditional %133 %135 %136
%135 = OpLabel
- OpBranch %87
- %87 = OpLabel
- %188 = OpCompositeExtract %uint %GlobalInvocationID 1
- %190 = OpCompositeExtract %int %39 0
- %189 = OpBitcast %uint %190
- %191 = OpIMul %uint %188 %189
- %192 = OpCompositeExtract %uint %GlobalInvocationID 0
- %193 = OpIAdd %uint %191 %192
- %194 = OpLoad %bool %success
- OpSelectionMerge %195 None
- OpBranchConditional %194 %196 %197
- %196 = OpLabel
- %199 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %193
- OpStore %199 %uint_1
- OpBranch %195
- %197 = OpLabel
- %200 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %193
- OpStore %200 %201
- OpBranch %195
+ %137 = OpLoad %bool %success
+ OpStore %tint_symbol_1 %137
+ %139 = OpLoad %bool %tint_symbol_1
+ OpSelectionMerge %140 None
+ OpBranchConditional %139 %141 %140
+ %141 = OpLabel
+ %143 = OpCompositeExtract %float %128 0
+ %144 = OpCompositeExtract %float %124 0
+ %142 = OpFunctionCall %bool %aboutEqual %143 %144
+ OpStore %tint_symbol_1 %142
+ OpBranch %140
+ %140 = OpLabel
+ %145 = OpLoad %bool %tint_symbol_1
+ OpStore %tint_symbol %145
+ %147 = OpLoad %bool %tint_symbol
+ OpSelectionMerge %148 None
+ OpBranchConditional %147 %149 %148
+ %149 = OpLabel
+ %151 = OpCompositeExtract %float %128 1
+ %152 = OpCompositeExtract %float %124 1
+ %150 = OpFunctionCall %bool %aboutEqual %151 %152
+ OpStore %tint_symbol %150
+ OpBranch %148
+ %148 = OpLabel
+ %153 = OpLoad %bool %tint_symbol
+ OpStore %success %153
+ OpBranch %134
+ %136 = OpLabel
+ %154 = OpLoad %bool %success
+ OpStore %tint_symbol_5 %154
+ %156 = OpLoad %bool %tint_symbol_5
+ OpSelectionMerge %157 None
+ OpBranchConditional %156 %158 %157
+ %158 = OpLabel
+ %160 = OpCompositeExtract %float %128 0
+ %161 = OpCompositeExtract %float %124 0
+ %159 = OpFunctionCall %bool %aboutEqual %160 %161
+ OpStore %tint_symbol_5 %159
+ OpBranch %157
+ %157 = OpLabel
+ %162 = OpLoad %bool %tint_symbol_5
+ OpStore %tint_symbol_4 %162
+ %164 = OpLoad %bool %tint_symbol_4
+ OpSelectionMerge %165 None
+ OpBranchConditional %164 %166 %165
+ %166 = OpLabel
+ %168 = OpCompositeExtract %float %128 1
+ %169 = OpCompositeExtract %float %124 1
+ %167 = OpFunctionCall %bool %aboutEqual %168 %169
+ OpStore %tint_symbol_4 %167
+ OpBranch %165
+ %165 = OpLabel
+ %170 = OpLoad %bool %tint_symbol_4
+ OpStore %tint_symbol_3 %170
+ %172 = OpLoad %bool %tint_symbol_3
+ OpSelectionMerge %173 None
+ OpBranchConditional %172 %174 %173
+ %174 = OpLabel
+ %176 = OpCompositeExtract %float %128 2
+ %177 = OpCompositeExtract %float %124 2
+ %175 = OpFunctionCall %bool %aboutEqual %176 %177
+ OpStore %tint_symbol_3 %175
+ OpBranch %173
+ %173 = OpLabel
+ %178 = OpLoad %bool %tint_symbol_3
+ OpStore %tint_symbol_2 %178
+ %180 = OpLoad %bool %tint_symbol_2
+ OpSelectionMerge %181 None
+ OpBranchConditional %180 %182 %181
+ %182 = OpLabel
+ %184 = OpCompositeExtract %float %128 3
+ %185 = OpCompositeExtract %float %124 3
+ %183 = OpFunctionCall %bool %aboutEqual %184 %185
+ OpStore %tint_symbol_2 %183
+ OpBranch %181
+ %181 = OpLabel
+ %186 = OpLoad %bool %tint_symbol_2
+ OpStore %success %186
+ OpBranch %134
+ %134 = OpLabel
+ OpBranch %86
+ %86 = OpLabel
+ %187 = OpCompositeExtract %uint %GlobalInvocationID 1
+ %188 = OpCompositeExtract %uint %38 0
+ %189 = OpIMul %uint %187 %188
+ %190 = OpCompositeExtract %uint %GlobalInvocationID 0
+ %191 = OpIAdd %uint %189 %190
+ %192 = OpLoad %bool %success
+ OpSelectionMerge %193 None
+ OpBranchConditional %192 %194 %195
+ %194 = OpLabel
+ %197 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %191
+ OpStore %197 %uint_1
+ OpBranch %193
%195 = OpLabel
+ %198 = OpAccessChain %_ptr_StorageBuffer_uint %output %uint_0 %191
+ OpStore %198 %199
+ OpBranch %193
+ %193 = OpLabel
OpReturn
OpFunctionEnd
- %main = OpFunction %void None %202
- %204 = OpLabel
- %206 = OpLoad %v3uint %GlobalInvocationID_1
- %205 = OpFunctionCall %void %main_inner %206
+ %main = OpFunction %void None %200
+ %202 = OpLabel
+ %204 = OpLoad %v3uint %GlobalInvocationID_1
+ %203 = OpFunctionCall %void %main_inner %204
OpReturn
OpFunctionEnd
diff --git a/test/tint/bug/tint/913.wgsl.expected.wgsl b/test/tint/bug/tint/913.wgsl.expected.wgsl
index d06c995..4940ac9 100644
--- a/test/tint/bug/tint/913.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/913.wgsl.expected.wgsl
@@ -24,8 +24,8 @@
@compute @workgroup_size(1, 1, 1)
fn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {
- let srcSize : vec2<i32> = textureDimensions(src);
- let dstSize : vec2<i32> = textureDimensions(dst);
+ let srcSize = textureDimensions(src);
+ let dstSize = textureDimensions(dst);
let dstTexCoord : vec2<u32> = vec2<u32>(GlobalInvocationID.xy);
let nonCoveredColor : vec4<f32> = vec4<f32>(0.0, 1.0, 0.0, 1.0);
var success : bool = true;
@@ -34,7 +34,7 @@
} else {
var srcTexCoord : vec2<u32> = ((dstTexCoord - uniforms.dstCopyOrigin) + uniforms.srcCopyOrigin);
if ((uniforms.dstTextureFlipY == 1u)) {
- srcTexCoord.y = ((u32(srcSize.y) - srcTexCoord.y) - 1u);
+ srcTexCoord.y = ((srcSize.y - srcTexCoord.y) - 1u);
}
let srcColor : vec4<f32> = textureLoad(src, vec2<i32>(srcTexCoord), 0);
let dstColor : vec4<f32> = textureLoad(dst, vec2<i32>(dstTexCoord), 0);
@@ -44,7 +44,7 @@
success = ((((success && aboutEqual(dstColor.r, srcColor.r)) && aboutEqual(dstColor.g, srcColor.g)) && aboutEqual(dstColor.b, srcColor.b)) && aboutEqual(dstColor.a, srcColor.a));
}
}
- let outputIndex : u32 = ((GlobalInvocationID.y * u32(dstSize.x)) + GlobalInvocationID.x);
+ let outputIndex : u32 = ((GlobalInvocationID.y * dstSize.x) + GlobalInvocationID.x);
if (success) {
output.result[outputIndex] = 1u;
} else {
diff --git a/test/tint/bug/tint/942.wgsl b/test/tint/bug/tint/942.wgsl
index d4c2bcb..300093f 100644
--- a/test/tint/bug/tint/942.wgsl
+++ b/test/tint/bug/tint/942.wgsl
@@ -1,4 +1,4 @@
- struct Params {
+struct Params {
filterDim : u32,
blockDim : u32,
};
@@ -35,16 +35,13 @@
@builtin(local_invocation_id) LocalInvocationID : vec3<u32>
) {
let filterOffset : u32 = (params.filterDim - 1u) / 2u;
- let dims : vec2<i32> = textureDimensions(inputTex, 0);
+ let dims = textureDimensions(inputTex, 0);
- let baseIndex = vec2<i32>(
- WorkGroupID.xy * vec2<u32>(params.blockDim, 4u) +
- LocalInvocationID.xy * vec2<u32>(4u, 1u)
- ) - vec2<i32>(i32(filterOffset), 0);
+ let baseIndex = (WorkGroupID.xy * vec2(params.blockDim, 4) + LocalInvocationID.xy * vec2(4u, 1u)) - vec2(filterOffset, 0);
for (var r : u32 = 0u; r < 4u; r = r + 1u) {
for (var c : u32 = 0u; c < 4u; c = c + 1u) {
- var loadIndex = baseIndex + vec2<i32>(i32(c), i32(r));
+ var loadIndex = baseIndex + vec2(c, r);
if (flip.value != 0u) {
loadIndex = loadIndex.yx;
}
@@ -59,7 +56,7 @@
for (var r : u32 = 0u; r < 4u; r = r + 1u) {
for (var c : u32 = 0u; c < 4u; c = c + 1u) {
- var writeIndex = baseIndex + vec2<i32>(i32(c), i32(r));
+ var writeIndex = baseIndex + vec2(c, r);
if (flip.value != 0u) {
writeIndex = writeIndex.yx;
}
diff --git a/test/tint/bug/tint/942.wgsl.expected.dxc.hlsl b/test/tint/bug/tint/942.wgsl.expected.dxc.hlsl
index 62623bf..0f2d328 100644
--- a/test/tint/bug/tint/942.wgsl.expected.dxc.hlsl
+++ b/test/tint/bug/tint/942.wgsl.expected.dxc.hlsl
@@ -28,13 +28,13 @@
const uint filterOffset = ((params[0].x - 1u) / 2u);
int3 tint_tmp;
inputTex.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- const int2 dims = tint_tmp.xy;
- const int2 baseIndex = (int2(((WorkGroupID.xy * uint2(params[0].y, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u)))) - int2(int(filterOffset), 0));
+ const uint2 dims = tint_tmp.xy;
+ const uint2 baseIndex = (((WorkGroupID.xy * uint2(params[0].y, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u))) - uint2(filterOffset, 0u));
{
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 loadIndex = (baseIndex + int2(int(c), int(r)));
+ uint2 loadIndex = (baseIndex + uint2(c, r));
if ((flip[0].x != 0u)) {
loadIndex = loadIndex.yx;
}
@@ -48,7 +48,7 @@
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 writeIndex = (baseIndex + int2(int(c), int(r)));
+ uint2 writeIndex = (baseIndex + uint2(c, r));
if ((flip[0].x != 0u)) {
writeIndex = writeIndex.yx;
}
diff --git a/test/tint/bug/tint/942.wgsl.expected.fxc.hlsl b/test/tint/bug/tint/942.wgsl.expected.fxc.hlsl
index 62623bf..0f2d328 100644
--- a/test/tint/bug/tint/942.wgsl.expected.fxc.hlsl
+++ b/test/tint/bug/tint/942.wgsl.expected.fxc.hlsl
@@ -28,13 +28,13 @@
const uint filterOffset = ((params[0].x - 1u) / 2u);
int3 tint_tmp;
inputTex.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- const int2 dims = tint_tmp.xy;
- const int2 baseIndex = (int2(((WorkGroupID.xy * uint2(params[0].y, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u)))) - int2(int(filterOffset), 0));
+ const uint2 dims = tint_tmp.xy;
+ const uint2 baseIndex = (((WorkGroupID.xy * uint2(params[0].y, 4u)) + (LocalInvocationID.xy * uint2(4u, 1u))) - uint2(filterOffset, 0u));
{
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 loadIndex = (baseIndex + int2(int(c), int(r)));
+ uint2 loadIndex = (baseIndex + uint2(c, r));
if ((flip[0].x != 0u)) {
loadIndex = loadIndex.yx;
}
@@ -48,7 +48,7 @@
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 writeIndex = (baseIndex + int2(int(c), int(r)));
+ uint2 writeIndex = (baseIndex + uint2(c, r));
if ((flip[0].x != 0u)) {
writeIndex = writeIndex.yx;
}
diff --git a/test/tint/bug/tint/942.wgsl.expected.glsl b/test/tint/bug/tint/942.wgsl.expected.glsl
index bf44f34..49e6cb1 100644
--- a/test/tint/bug/tint/942.wgsl.expected.glsl
+++ b/test/tint/bug/tint/942.wgsl.expected.glsl
@@ -29,13 +29,13 @@
}
barrier();
uint filterOffset = ((params.filterDim - 1u) / 2u);
- ivec2 dims = textureSize(inputTex_1, 0);
- ivec2 baseIndex = (ivec2(((WorkGroupID.xy * uvec2(params.blockDim, 4u)) + (LocalInvocationID.xy * uvec2(4u, 1u)))) - ivec2(int(filterOffset), 0));
+ uvec2 dims = uvec2(textureSize(inputTex_1, 0));
+ uvec2 baseIndex = (((WorkGroupID.xy * uvec2(params.blockDim, 4u)) + (LocalInvocationID.xy * uvec2(4u, 1u))) - uvec2(filterOffset, 0u));
{
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- ivec2 loadIndex = (baseIndex + ivec2(int(c), int(r)));
+ uvec2 loadIndex = (baseIndex + uvec2(c, r));
if ((flip.value != 0u)) {
loadIndex = loadIndex.yx;
}
@@ -49,7 +49,7 @@
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
{
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- ivec2 writeIndex = (baseIndex + ivec2(int(c), int(r)));
+ uvec2 writeIndex = (baseIndex + uvec2(c, r));
if ((flip.value != 0u)) {
writeIndex = writeIndex.yx;
}
@@ -70,7 +70,7 @@
acc = (acc + ((1.0f / float(params.filterDim)) * tile[r][i]));
}
}
- imageStore(outputTex, writeIndex, vec4(acc, 1.0f));
+ imageStore(outputTex, ivec2(writeIndex), vec4(acc, 1.0f));
}
}
}
diff --git a/test/tint/bug/tint/942.wgsl.expected.msl b/test/tint/bug/tint/942.wgsl.expected.msl
index d605a4f..4d884bf 100644
--- a/test/tint/bug/tint/942.wgsl.expected.msl
+++ b/test/tint/bug/tint/942.wgsl.expected.msl
@@ -31,13 +31,13 @@
}
threadgroup_barrier(mem_flags::mem_threadgroup);
uint const filterOffset = (((*(tint_symbol_2)).filterDim - 1u) / 2u);
- int2 const dims = int2(tint_symbol_3.get_width(0), tint_symbol_3.get_height(0));
- int2 const baseIndex = as_type<int2>((as_type<uint2>(int2(int2(((uint3(WorkGroupID).xy * uint2((*(tint_symbol_2)).blockDim, 4u)) + (uint3(LocalInvocationID).xy * uint2(4u, 1u)))))) - as_type<uint2>(int2(int2(int(filterOffset), 0)))));
+ uint2 const dims = uint2(tint_symbol_3.get_width(0), tint_symbol_3.get_height(0));
+ uint2 const baseIndex = (((uint3(WorkGroupID).xy * uint2((*(tint_symbol_2)).blockDim, 4u)) + (uint3(LocalInvocationID).xy * uint2(4u, 1u))) - uint2(filterOffset, 0u));
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 loadIndex = as_type<int2>((as_type<uint2>(int2(baseIndex)) + as_type<uint2>(int2(int2(int(c), int(r))))));
+ uint2 loadIndex = (baseIndex + uint2(c, r));
if (((*(tint_symbol_4)).value != 0u)) {
- loadIndex = int2(loadIndex).yx;
+ loadIndex = uint2(loadIndex).yx;
}
(*(tint_symbol_1))[r][((4u * LocalInvocationID[0]) + c)] = float4(tint_symbol_3.sample(tint_symbol_5, ((float2(loadIndex) + float2(0.25f)) / float2(dims)), level(0.0f))).rgb;
}
@@ -45,9 +45,9 @@
threadgroup_barrier(mem_flags::mem_threadgroup);
for(uint r = 0u; (r < 4u); r = (r + 1u)) {
for(uint c = 0u; (c < 4u); c = (c + 1u)) {
- int2 writeIndex = as_type<int2>((as_type<uint2>(int2(baseIndex)) + as_type<uint2>(int2(int2(int(c), int(r))))));
+ uint2 writeIndex = (baseIndex + uint2(c, r));
if (((*(tint_symbol_4)).value != 0u)) {
- writeIndex = int2(writeIndex).yx;
+ writeIndex = uint2(writeIndex).yx;
}
uint const center = ((4u * LocalInvocationID[0]) + c);
if ((((center >= filterOffset) && (center < (256u - filterOffset))) && all((writeIndex < dims)))) {
diff --git a/test/tint/bug/tint/942.wgsl.expected.spvasm b/test/tint/bug/tint/942.wgsl.expected.spvasm
index 25417c3..22c15c0 100644
--- a/test/tint/bug/tint/942.wgsl.expected.spvasm
+++ b/test/tint/bug/tint/942.wgsl.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 258
+; Bound: 251
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
@@ -104,23 +104,22 @@
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%uint_1 = OpConstant %uint 1
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %76 = OpConstantNull %int
%v2uint = OpTypeVector %uint 2
- %85 = OpConstantComposite %v2uint %uint_4 %uint_1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %119 = OpConstantNull %v2int
+ %int = OpTypeInt 32 1
+ %76 = OpConstantNull %int
+ %83 = OpConstantComposite %v2uint %uint_4 %uint_1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %114 = OpConstantNull %v2uint
%v4float = OpTypeVector %float 4
- %137 = OpTypeSampledImage %16
+ %132 = OpTypeSampledImage %16
%v2float = OpTypeVector %float 2
%float_0_25 = OpConstant %float 0.25
- %143 = OpConstantComposite %v2float %float_0_25 %float_0_25
- %147 = OpConstantNull %float
+ %138 = OpConstantComposite %v2float %float_0_25 %float_0_25
+ %142 = OpConstantNull %float
%v2bool = OpTypeVector %bool 2
%_ptr_Function_v3float = OpTypePointer Function %v3float
%float_1 = OpConstant %float 1
- %251 = OpTypeFunction %void
+ %244 = OpTypeFunction %void
%main_inner = OpFunction %void None %31
%WorkGroupID = OpFunctionParameter %v3uint
%LocalInvocationID = OpFunctionParameter %v3uint
@@ -129,10 +128,10 @@
%idx = OpVariable %_ptr_Function_uint Function %40
%r = OpVariable %_ptr_Function_uint Function %40
%c = OpVariable %_ptr_Function_uint Function %40
- %loadIndex = OpVariable %_ptr_Function_v2int Function %119
+ %loadIndex = OpVariable %_ptr_Function_v2uint Function %114
%r_0 = OpVariable %_ptr_Function_uint Function %40
%c_0 = OpVariable %_ptr_Function_uint Function %40
- %writeIndex = OpVariable %_ptr_Function_v2int Function %119
+ %writeIndex = OpVariable %_ptr_Function_v2uint Function %114
%acc = OpVariable %_ptr_Function_v3float Function %58
%f = OpVariable %_ptr_Function_uint Function %40
%i = OpVariable %_ptr_Function_uint Function %40
@@ -168,240 +167,234 @@
%68 = OpLoad %uint %67
%70 = OpISub %uint %68 %uint_1
%71 = OpUDiv %uint %70 %uint_2
- %75 = OpLoad %16 %inputTex
- %72 = OpImageQuerySizeLod %v2int %75 %76
- %79 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
- %80 = OpAccessChain %_ptr_Uniform_uint %params %uint_1
- %81 = OpLoad %uint %80
- %82 = OpCompositeConstruct %v2uint %81 %uint_4
- %83 = OpIMul %v2uint %79 %82
- %84 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
- %86 = OpIMul %v2uint %84 %85
- %87 = OpIAdd %v2uint %83 %86
- %77 = OpBitcast %v2int %87
- %88 = OpBitcast %int %71
- %89 = OpCompositeConstruct %v2int %88 %76
- %90 = OpISub %v2int %77 %89
+ %74 = OpLoad %16 %inputTex
+ %72 = OpImageQuerySizeLod %v2uint %74 %76
+ %77 = OpVectorShuffle %v2uint %WorkGroupID %WorkGroupID 0 1
+ %78 = OpAccessChain %_ptr_Uniform_uint %params %uint_1
+ %79 = OpLoad %uint %78
+ %80 = OpCompositeConstruct %v2uint %79 %uint_4
+ %81 = OpIMul %v2uint %77 %80
+ %82 = OpVectorShuffle %v2uint %LocalInvocationID %LocalInvocationID 0 1
+ %84 = OpIMul %v2uint %82 %83
+ %85 = OpIAdd %v2uint %81 %84
+ %86 = OpCompositeConstruct %v2uint %71 %40
+ %87 = OpISub %v2uint %85 %86
OpStore %r %40
+ OpBranch %89
+ %89 = OpLabel
+ OpLoopMerge %90 %91 None
OpBranch %92
%92 = OpLabel
- OpLoopMerge %93 %94 None
- OpBranch %95
- %95 = OpLabel
- %97 = OpLoad %uint %r
- %98 = OpULessThan %bool %97 %uint_4
- %96 = OpLogicalNot %bool %98
- OpSelectionMerge %99 None
- OpBranchConditional %96 %100 %99
- %100 = OpLabel
- OpBranch %93
- %99 = OpLabel
+ %94 = OpLoad %uint %r
+ %95 = OpULessThan %bool %94 %uint_4
+ %93 = OpLogicalNot %bool %95
+ OpSelectionMerge %96 None
+ OpBranchConditional %93 %97 %96
+ %97 = OpLabel
+ OpBranch %90
+ %96 = OpLabel
OpStore %c %40
+ OpBranch %99
+ %99 = OpLabel
+ OpLoopMerge %100 %101 None
OpBranch %102
%102 = OpLabel
- OpLoopMerge %103 %104 None
- OpBranch %105
- %105 = OpLabel
- %107 = OpLoad %uint %c
- %108 = OpULessThan %bool %107 %uint_4
- %106 = OpLogicalNot %bool %108
- OpSelectionMerge %109 None
- OpBranchConditional %106 %110 %109
- %110 = OpLabel
- OpBranch %103
- %109 = OpLabel
- %112 = OpLoad %uint %c
- %111 = OpBitcast %int %112
- %114 = OpLoad %uint %r
- %113 = OpBitcast %int %114
- %115 = OpCompositeConstruct %v2int %111 %113
- %116 = OpIAdd %v2int %90 %115
- OpStore %loadIndex %116
- %120 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
- %121 = OpLoad %uint %120
- %122 = OpINotEqual %bool %121 %40
- OpSelectionMerge %123 None
- OpBranchConditional %122 %124 %123
- %124 = OpLabel
- %125 = OpLoad %v2int %loadIndex
- %126 = OpVectorShuffle %v2int %125 %125 1 0
- OpStore %loadIndex %126
- OpBranch %123
- %123 = OpLabel
- %127 = OpLoad %uint %r
- %128 = OpCompositeExtract %uint %LocalInvocationID 0
- %129 = OpIMul %uint %uint_4 %128
- %130 = OpLoad %uint %c
- %131 = OpIAdd %uint %129 %130
- %132 = OpAccessChain %_ptr_Workgroup_v3float %tile %127 %131
- %135 = OpLoad %10 %samp
- %136 = OpLoad %16 %inputTex
- %138 = OpSampledImage %137 %136 %135
- %141 = OpLoad %v2int %loadIndex
- %139 = OpConvertSToF %v2float %141
- %144 = OpFAdd %v2float %139 %143
- %145 = OpConvertSToF %v2float %72
- %146 = OpFDiv %v2float %144 %145
- %133 = OpImageSampleExplicitLod %v4float %138 %146 Lod %147
- %148 = OpVectorShuffle %v3float %133 %133 0 1 2
- OpStore %132 %148
- OpBranch %104
- %104 = OpLabel
- %149 = OpLoad %uint %c
- %150 = OpIAdd %uint %149 %uint_1
- OpStore %c %150
- OpBranch %102
- %103 = OpLabel
- OpBranch %94
- %94 = OpLabel
- %151 = OpLoad %uint %r
- %152 = OpIAdd %uint %151 %uint_1
- OpStore %r %152
- OpBranch %92
- %93 = OpLabel
+ %104 = OpLoad %uint %c
+ %105 = OpULessThan %bool %104 %uint_4
+ %103 = OpLogicalNot %bool %105
+ OpSelectionMerge %106 None
+ OpBranchConditional %103 %107 %106
+ %107 = OpLabel
+ OpBranch %100
+ %106 = OpLabel
+ %108 = OpLoad %uint %c
+ %109 = OpLoad %uint %r
+ %110 = OpCompositeConstruct %v2uint %108 %109
+ %111 = OpIAdd %v2uint %87 %110
+ OpStore %loadIndex %111
+ %115 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
+ %116 = OpLoad %uint %115
+ %117 = OpINotEqual %bool %116 %40
+ OpSelectionMerge %118 None
+ OpBranchConditional %117 %119 %118
+ %119 = OpLabel
+ %120 = OpLoad %v2uint %loadIndex
+ %121 = OpVectorShuffle %v2uint %120 %120 1 0
+ OpStore %loadIndex %121
+ OpBranch %118
+ %118 = OpLabel
+ %122 = OpLoad %uint %r
+ %123 = OpCompositeExtract %uint %LocalInvocationID 0
+ %124 = OpIMul %uint %uint_4 %123
+ %125 = OpLoad %uint %c
+ %126 = OpIAdd %uint %124 %125
+ %127 = OpAccessChain %_ptr_Workgroup_v3float %tile %122 %126
+ %130 = OpLoad %10 %samp
+ %131 = OpLoad %16 %inputTex
+ %133 = OpSampledImage %132 %131 %130
+ %136 = OpLoad %v2uint %loadIndex
+ %134 = OpConvertUToF %v2float %136
+ %139 = OpFAdd %v2float %134 %138
+ %140 = OpConvertUToF %v2float %72
+ %141 = OpFDiv %v2float %139 %140
+ %128 = OpImageSampleExplicitLod %v4float %133 %141 Lod %142
+ %143 = OpVectorShuffle %v3float %128 %128 0 1 2
+ OpStore %127 %143
+ OpBranch %101
+ %101 = OpLabel
+ %144 = OpLoad %uint %c
+ %145 = OpIAdd %uint %144 %uint_1
+ OpStore %c %145
+ OpBranch %99
+ %100 = OpLabel
+ OpBranch %91
+ %91 = OpLabel
+ %146 = OpLoad %uint %r
+ %147 = OpIAdd %uint %146 %uint_1
+ OpStore %r %147
+ OpBranch %89
+ %90 = OpLabel
OpControlBarrier %uint_2 %uint_2 %uint_264
OpStore %r_0 %40
- OpBranch %155
- %155 = OpLabel
- OpLoopMerge %156 %157 None
- OpBranch %158
+ OpBranch %150
+ %150 = OpLabel
+ OpLoopMerge %151 %152 None
+ OpBranch %153
+ %153 = OpLabel
+ %155 = OpLoad %uint %r_0
+ %156 = OpULessThan %bool %155 %uint_4
+ %154 = OpLogicalNot %bool %156
+ OpSelectionMerge %157 None
+ OpBranchConditional %154 %158 %157
%158 = OpLabel
- %160 = OpLoad %uint %r_0
- %161 = OpULessThan %bool %160 %uint_4
- %159 = OpLogicalNot %bool %161
- OpSelectionMerge %162 None
- OpBranchConditional %159 %163 %162
- %163 = OpLabel
- OpBranch %156
- %162 = OpLabel
+ OpBranch %151
+ %157 = OpLabel
OpStore %c_0 %40
- OpBranch %165
- %165 = OpLabel
- OpLoopMerge %166 %167 None
- OpBranch %168
+ OpBranch %160
+ %160 = OpLabel
+ OpLoopMerge %161 %162 None
+ OpBranch %163
+ %163 = OpLabel
+ %165 = OpLoad %uint %c_0
+ %166 = OpULessThan %bool %165 %uint_4
+ %164 = OpLogicalNot %bool %166
+ OpSelectionMerge %167 None
+ OpBranchConditional %164 %168 %167
%168 = OpLabel
- %170 = OpLoad %uint %c_0
- %171 = OpULessThan %bool %170 %uint_4
- %169 = OpLogicalNot %bool %171
- OpSelectionMerge %172 None
- OpBranchConditional %169 %173 %172
- %173 = OpLabel
- OpBranch %166
- %172 = OpLabel
- %175 = OpLoad %uint %c_0
- %174 = OpBitcast %int %175
- %177 = OpLoad %uint %r_0
- %176 = OpBitcast %int %177
- %178 = OpCompositeConstruct %v2int %174 %176
- %179 = OpIAdd %v2int %90 %178
- OpStore %writeIndex %179
- %181 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
- %182 = OpLoad %uint %181
- %183 = OpINotEqual %bool %182 %40
- OpSelectionMerge %184 None
- OpBranchConditional %183 %185 %184
- %185 = OpLabel
- %186 = OpLoad %v2int %writeIndex
- %187 = OpVectorShuffle %v2int %186 %186 1 0
- OpStore %writeIndex %187
- OpBranch %184
- %184 = OpLabel
- %188 = OpCompositeExtract %uint %LocalInvocationID 0
- %189 = OpIMul %uint %uint_4 %188
- %190 = OpLoad %uint %c_0
- %191 = OpIAdd %uint %189 %190
- %192 = OpUGreaterThanEqual %bool %191 %71
- OpSelectionMerge %193 None
- OpBranchConditional %192 %194 %193
- %194 = OpLabel
- %195 = OpISub %uint %uint_256 %71
- %196 = OpULessThan %bool %191 %195
- OpBranch %193
- %193 = OpLabel
- %197 = OpPhi %bool %192 %184 %196 %194
+ OpBranch %161
+ %167 = OpLabel
+ %169 = OpLoad %uint %c_0
+ %170 = OpLoad %uint %r_0
+ %171 = OpCompositeConstruct %v2uint %169 %170
+ %172 = OpIAdd %v2uint %87 %171
+ OpStore %writeIndex %172
+ %174 = OpAccessChain %_ptr_Uniform_uint %flip %uint_0
+ %175 = OpLoad %uint %174
+ %176 = OpINotEqual %bool %175 %40
+ OpSelectionMerge %177 None
+ OpBranchConditional %176 %178 %177
+ %178 = OpLabel
+ %179 = OpLoad %v2uint %writeIndex
+ %180 = OpVectorShuffle %v2uint %179 %179 1 0
+ OpStore %writeIndex %180
+ OpBranch %177
+ %177 = OpLabel
+ %181 = OpCompositeExtract %uint %LocalInvocationID 0
+ %182 = OpIMul %uint %uint_4 %181
+ %183 = OpLoad %uint %c_0
+ %184 = OpIAdd %uint %182 %183
+ %185 = OpUGreaterThanEqual %bool %184 %71
+ OpSelectionMerge %186 None
+ OpBranchConditional %185 %187 %186
+ %187 = OpLabel
+ %188 = OpISub %uint %uint_256 %71
+ %189 = OpULessThan %bool %184 %188
+ OpBranch %186
+ %186 = OpLabel
+ %190 = OpPhi %bool %185 %177 %189 %187
+ OpSelectionMerge %191 None
+ OpBranchConditional %190 %192 %191
+ %192 = OpLabel
+ %194 = OpLoad %v2uint %writeIndex
+ %195 = OpULessThan %v2bool %194 %72
+ %193 = OpAll %bool %195
+ OpBranch %191
+ %191 = OpLabel
+ %197 = OpPhi %bool %190 %186 %193 %192
OpSelectionMerge %198 None
OpBranchConditional %197 %199 %198
%199 = OpLabel
- %201 = OpLoad %v2int %writeIndex
- %202 = OpSLessThan %v2bool %201 %72
- %200 = OpAll %bool %202
- OpBranch %198
- %198 = OpLabel
- %204 = OpPhi %bool %197 %193 %200 %199
- OpSelectionMerge %205 None
- OpBranchConditional %204 %206 %205
- %206 = OpLabel
OpStore %acc %58
OpStore %f %40
- OpBranch %210
- %210 = OpLabel
- OpLoopMerge %211 %212 None
- OpBranch %213
+ OpBranch %203
+ %203 = OpLabel
+ OpLoopMerge %204 %205 None
+ OpBranch %206
+ %206 = OpLabel
+ %208 = OpLoad %uint %f
+ %209 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
+ %210 = OpLoad %uint %209
+ %211 = OpULessThan %bool %208 %210
+ %207 = OpLogicalNot %bool %211
+ OpSelectionMerge %212 None
+ OpBranchConditional %207 %213 %212
%213 = OpLabel
- %215 = OpLoad %uint %f
- %216 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
- %217 = OpLoad %uint %216
- %218 = OpULessThan %bool %215 %217
- %214 = OpLogicalNot %bool %218
- OpSelectionMerge %219 None
- OpBranchConditional %214 %220 %219
- %220 = OpLabel
- OpBranch %211
- %219 = OpLabel
- %221 = OpLoad %uint %f
- %222 = OpIAdd %uint %191 %221
- %223 = OpISub %uint %222 %71
- OpStore %i %223
- %225 = OpLoad %v3float %acc
- %228 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
- %229 = OpLoad %uint %228
- %227 = OpConvertUToF %float %229
- %230 = OpFDiv %float %float_1 %227
- %231 = OpLoad %uint %r_0
- %232 = OpLoad %uint %i
- %233 = OpAccessChain %_ptr_Workgroup_v3float %tile %231 %232
- %234 = OpLoad %v3float %233
- %235 = OpVectorTimesScalar %v3float %234 %230
- %236 = OpFAdd %v3float %225 %235
- OpStore %acc %236
- OpBranch %212
+ OpBranch %204
%212 = OpLabel
- %237 = OpLoad %uint %f
- %238 = OpIAdd %uint %237 %uint_1
- OpStore %f %238
- OpBranch %210
- %211 = OpLabel
- %240 = OpLoad %20 %outputTex
- %241 = OpLoad %v2int %writeIndex
- %242 = OpLoad %v3float %acc
- %243 = OpCompositeExtract %float %242 0
- %244 = OpCompositeExtract %float %242 1
- %245 = OpCompositeExtract %float %242 2
- %246 = OpCompositeConstruct %v4float %243 %244 %245 %float_1
- OpImageWrite %240 %241 %246
+ %214 = OpLoad %uint %f
+ %215 = OpIAdd %uint %184 %214
+ %216 = OpISub %uint %215 %71
+ OpStore %i %216
+ %218 = OpLoad %v3float %acc
+ %221 = OpAccessChain %_ptr_Uniform_uint %params %uint_0
+ %222 = OpLoad %uint %221
+ %220 = OpConvertUToF %float %222
+ %223 = OpFDiv %float %float_1 %220
+ %224 = OpLoad %uint %r_0
+ %225 = OpLoad %uint %i
+ %226 = OpAccessChain %_ptr_Workgroup_v3float %tile %224 %225
+ %227 = OpLoad %v3float %226
+ %228 = OpVectorTimesScalar %v3float %227 %223
+ %229 = OpFAdd %v3float %218 %228
+ OpStore %acc %229
OpBranch %205
%205 = OpLabel
- OpBranch %167
- %167 = OpLabel
- %247 = OpLoad %uint %c_0
- %248 = OpIAdd %uint %247 %uint_1
- OpStore %c_0 %248
- OpBranch %165
- %166 = OpLabel
- OpBranch %157
- %157 = OpLabel
- %249 = OpLoad %uint %r_0
- %250 = OpIAdd %uint %249 %uint_1
- OpStore %r_0 %250
- OpBranch %155
- %156 = OpLabel
+ %230 = OpLoad %uint %f
+ %231 = OpIAdd %uint %230 %uint_1
+ OpStore %f %231
+ OpBranch %203
+ %204 = OpLabel
+ %233 = OpLoad %20 %outputTex
+ %234 = OpLoad %v2uint %writeIndex
+ %235 = OpLoad %v3float %acc
+ %236 = OpCompositeExtract %float %235 0
+ %237 = OpCompositeExtract %float %235 1
+ %238 = OpCompositeExtract %float %235 2
+ %239 = OpCompositeConstruct %v4float %236 %237 %238 %float_1
+ OpImageWrite %233 %234 %239
+ OpBranch %198
+ %198 = OpLabel
+ OpBranch %162
+ %162 = OpLabel
+ %240 = OpLoad %uint %c_0
+ %241 = OpIAdd %uint %240 %uint_1
+ OpStore %c_0 %241
+ OpBranch %160
+ %161 = OpLabel
+ OpBranch %152
+ %152 = OpLabel
+ %242 = OpLoad %uint %r_0
+ %243 = OpIAdd %uint %242 %uint_1
+ OpStore %r_0 %243
+ OpBranch %150
+ %151 = OpLabel
OpReturn
OpFunctionEnd
- %main = OpFunction %void None %251
- %253 = OpLabel
- %255 = OpLoad %v3uint %WorkGroupID_1
- %256 = OpLoad %v3uint %LocalInvocationID_1
- %257 = OpLoad %uint %local_invocation_index_1
- %254 = OpFunctionCall %void %main_inner %255 %256 %257
+ %main = OpFunction %void None %244
+ %246 = OpLabel
+ %248 = OpLoad %v3uint %WorkGroupID_1
+ %249 = OpLoad %v3uint %LocalInvocationID_1
+ %250 = OpLoad %uint %local_invocation_index_1
+ %247 = OpFunctionCall %void %main_inner %248 %249 %250
OpReturn
OpFunctionEnd
diff --git a/test/tint/bug/tint/942.wgsl.expected.wgsl b/test/tint/bug/tint/942.wgsl.expected.wgsl
index 837581e..69ade2e 100644
--- a/test/tint/bug/tint/942.wgsl.expected.wgsl
+++ b/test/tint/bug/tint/942.wgsl.expected.wgsl
@@ -22,11 +22,11 @@
@compute @workgroup_size(64, 1, 1)
fn main(@builtin(workgroup_id) WorkGroupID : vec3<u32>, @builtin(local_invocation_id) LocalInvocationID : vec3<u32>) {
let filterOffset : u32 = ((params.filterDim - 1u) / 2u);
- let dims : vec2<i32> = textureDimensions(inputTex, 0);
- let baseIndex = (vec2<i32>(((WorkGroupID.xy * vec2<u32>(params.blockDim, 4u)) + (LocalInvocationID.xy * vec2<u32>(4u, 1u)))) - vec2<i32>(i32(filterOffset), 0));
+ let dims = textureDimensions(inputTex, 0);
+ let baseIndex = (((WorkGroupID.xy * vec2(params.blockDim, 4)) + (LocalInvocationID.xy * vec2(4u, 1u))) - vec2(filterOffset, 0));
for(var r : u32 = 0u; (r < 4u); r = (r + 1u)) {
for(var c : u32 = 0u; (c < 4u); c = (c + 1u)) {
- var loadIndex = (baseIndex + vec2<i32>(i32(c), i32(r)));
+ var loadIndex = (baseIndex + vec2(c, r));
if ((flip.value != 0u)) {
loadIndex = loadIndex.yx;
}
@@ -36,7 +36,7 @@
workgroupBarrier();
for(var r : u32 = 0u; (r < 4u); r = (r + 1u)) {
for(var c : u32 = 0u; (c < 4u); c = (c + 1u)) {
- var writeIndex = (baseIndex + vec2<i32>(i32(c), i32(r)));
+ var writeIndex = (baseIndex + vec2(c, r));
if ((flip.value != 0u)) {
writeIndex = writeIndex.yx;
}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl
deleted file mode 100644
index 8ca4261..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>) -> i32
-fn textureDimensions_002b2a() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_002b2a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_002b2a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_002b2a();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 29d0c12..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_002b2a() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_002b2a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_002b2a();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 29d0c12..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_002b2a() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_002b2a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_002b2a();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.glsl
deleted file mode 100644
index 9ee3490..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_002b2a();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_002b2a();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.msl
deleted file mode 100644
index b5b2121..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_002b2a(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_002b2a(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_002b2a(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_002b2a(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.spvasm
deleted file mode 100644
index 178d73b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_002b2a "textureDimensions_002b2a"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_002b2a = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %int %18 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.wgsl
deleted file mode 100644
index 5f09068..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/002b2a.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_002b2a() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_002b2a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_002b2a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_002b2a();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl
new file mode 100644
index 0000000..2079209
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<u32>
+fn textureDimensions_00348c() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00348c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00348c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00348c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e613aa1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_00348c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00348c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00348c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e613aa1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_00348c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00348c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00348c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl
new file mode 100644
index 0000000..dd2e0ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_00348c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_00348c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl
new file mode 100644
index 0000000..cf3f493
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureDimensions_00348c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_00348c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_00348c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm
new file mode 100644
index 0000000..5045f2d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_00348c "textureDimensions_00348c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_00348c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl
new file mode 100644
index 0000000..17daeec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/00348c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureDimensions_00348c() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00348c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00348c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00348c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl
deleted file mode 100644
index 3fd6388..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<i32>
-fn textureDimensions_012b82() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_012b82();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_012b82();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_012b82();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 56fb818..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_012b82() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_012b82();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_012b82();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 56fb818..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_012b82() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_012b82();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_012b82();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.glsl
deleted file mode 100644
index 9ae3c1b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_012b82();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_012b82();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.msl
deleted file mode 100644
index f53807b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_012b82(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_012b82(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_012b82(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_012b82(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.spvasm
deleted file mode 100644
index 4e8d502..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_012b82 "textureDimensions_012b82"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_012b82 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_012b82
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_012b82
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_012b82
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.wgsl
deleted file mode 100644
index 216df4f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/012b82.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
-
-fn textureDimensions_012b82() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_012b82();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_012b82();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_012b82();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl
new file mode 100644
index 0000000..3ba9b07
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>, level: u32) -> u32
+fn textureDimensions_022903() {
+ var res: u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_022903();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_022903();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_022903();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0b1b94c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_022903() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_022903();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_022903();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0b1b94c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_022903() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_022903();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_022903();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl
new file mode 100644
index 0000000..471ad98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_022903();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_022903();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl
new file mode 100644
index 0000000..3f1e8e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_022903(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_022903(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_022903(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8430af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_022903 "textureDimensions_022903"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_022903 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %19 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_022903
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_022903
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_022903
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl
new file mode 100644
index 0000000..c03afca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/022903.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_022903() {
+ var res : u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_022903();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_022903();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_022903();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl
deleted file mode 100644
index 2b1e057..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> i32
-fn textureDimensions_08753d() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_08753d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_08753d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_08753d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 83011ff..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_08753d() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_08753d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_08753d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_08753d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 83011ff..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_08753d() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_08753d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_08753d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_08753d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.glsl
deleted file mode 100644
index 0b0f9e3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_08753d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_08753d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_08753d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.msl
deleted file mode 100644
index a1fa2f3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_08753d(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_08753d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_08753d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_08753d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.spvasm
deleted file mode 100644
index 8854f38..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_08753d "textureDimensions_08753d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_08753d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_08753d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_08753d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_08753d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.wgsl
deleted file mode 100644
index 443a678..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/08753d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16sint, write>;
-
-fn textureDimensions_08753d() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_08753d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_08753d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_08753d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl
new file mode 100644
index 0000000..b5607ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>, level: u32) -> vec3<u32>
+fn textureDimensions_0890c6() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0890c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0890c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0890c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..074fc44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_0890c6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0890c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0890c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..074fc44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_0890c6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0890c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0890c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl
new file mode 100644
index 0000000..0f895c4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0890c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_0890c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl
new file mode 100644
index 0000000..2be4142
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_0890c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0890c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0890c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..4688852
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0890c6 "textureDimensions_0890c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0890c6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v3uint %19 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..ab91a24
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0890c6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_0890c6() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0890c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0890c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0890c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl
new file mode 100644
index 0000000..6a49738
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> u32
+fn textureDimensions_09140b() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_09140b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_09140b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_09140b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f718b0a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_09140b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_09140b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_09140b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f718b0a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_09140b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_09140b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_09140b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl
new file mode 100644
index 0000000..67cfd46
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_09140b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_09140b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl
new file mode 100644
index 0000000..5294978
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_09140b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_09140b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_09140b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5cdeef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_09140b "textureDimensions_09140b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_09140b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl
new file mode 100644
index 0000000..a07543a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/09140b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32uint, write>;
+
+fn textureDimensions_09140b() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_09140b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_09140b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_09140b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl
deleted file mode 100644
index 07e738a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array, level: u32) -> vec2<i32>
-fn textureDimensions_0a1ce8() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0a1ce8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0a1ce8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b2765b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_0a1ce8() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0a1ce8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0a1ce8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b2765b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_0a1ce8() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0a1ce8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0a1ce8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.glsl
deleted file mode 100644
index c170917..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0a1ce8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_0a1ce8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.msl
deleted file mode 100644
index 224368f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0a1ce8(depth2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_0a1ce8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0a1ce8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0a1ce8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.spvasm
deleted file mode 100644
index b602707..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0a1ce8 "textureDimensions_0a1ce8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0a1ce8 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.wgsl
deleted file mode 100644
index d050a46..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0a1ce8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_0a1ce8() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0a1ce8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0a1ce8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl
new file mode 100644
index 0000000..c3117f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<u32>
+fn textureDimensions_0baa0d() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0baa0d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0baa0d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b1a4736
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0baa0d() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0baa0d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0baa0d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b1a4736
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0baa0d() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0baa0d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0baa0d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl
new file mode 100644
index 0000000..52bbc21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0baa0d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_0baa0d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl
new file mode 100644
index 0000000..3776c05
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_0baa0d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0baa0d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0baa0d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm
new file mode 100644
index 0000000..f1c67a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0baa0d "textureDimensions_0baa0d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0baa0d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl
new file mode 100644
index 0000000..8099e09
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0baa0d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32float, write>;
+
+fn textureDimensions_0baa0d() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0baa0d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0baa0d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl
new file mode 100644
index 0000000..79bc102
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> u32
+fn textureDimensions_0c0b0c() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0c0b0c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0c0b0c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5fb29dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0c0b0c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0c0b0c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5fb29dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0c0b0c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0c0b0c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl
new file mode 100644
index 0000000..a3815af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0c0b0c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_0c0b0c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl
new file mode 100644
index 0000000..c100b1a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_0c0b0c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0c0b0c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0c0b0c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm
new file mode 100644
index 0000000..8ae986f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0c0b0c "textureDimensions_0c0b0c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0c0b0c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl
new file mode 100644
index 0000000..c7aab96
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0c0b0c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16float, write>;
+
+fn textureDimensions_0c0b0c() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0c0b0c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0c0b0c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl
deleted file mode 100644
index 6341954..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<i32>
-fn textureDimensions_0c4772() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0c4772();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0c4772();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0c4772();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3de620c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_0c4772() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0c4772();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0c4772();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3de620c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_0c4772() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0c4772();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0c4772();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.glsl
deleted file mode 100644
index f58182c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0c4772();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0c4772();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.msl
deleted file mode 100644
index cc675e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0c4772(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_0c4772(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0c4772(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0c4772(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.spvasm
deleted file mode 100644
index 77d91d5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0c4772 "textureDimensions_0c4772"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0c4772 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.wgsl
deleted file mode 100644
index fc2907d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0c4772.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16float, write>;
-
-fn textureDimensions_0c4772() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0c4772();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0c4772();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0c4772();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl
deleted file mode 100644
index 9b72fc3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> i32
-fn textureDimensions_0cce40() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cce40();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cce40();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cce40();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e10fdf6f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cce40() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cce40();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cce40();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e10fdf6f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cce40() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cce40();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cce40();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.glsl
deleted file mode 100644
index a0df901..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0cce40();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0cce40();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.msl
deleted file mode 100644
index e955048..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0cce40(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_0cce40(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0cce40(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0cce40(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.spvasm
deleted file mode 100644
index 51c3c14..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0cce40 "textureDimensions_0cce40"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0cce40 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.wgsl
deleted file mode 100644
index 5193665..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cce40.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32sint, write>;
-
-fn textureDimensions_0cce40() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cce40();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cce40();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cce40();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl
deleted file mode 100644
index 82980ef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<i32>
-fn textureDimensions_0cf2ff() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cf2ff();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cf2ff();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3b9fd52..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cf2ff() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cf2ff();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cf2ff();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3b9fd52..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cf2ff() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cf2ff();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cf2ff();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.glsl
deleted file mode 100644
index d91c9db..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0cf2ff();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0cf2ff();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.msl
deleted file mode 100644
index 875a388..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0cf2ff(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_0cf2ff(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0cf2ff(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0cf2ff(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.spvasm
deleted file mode 100644
index aece9956..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0cf2ff "textureDimensions_0cf2ff"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0cf2ff = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.wgsl
deleted file mode 100644
index a13b916..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0cf2ff.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16uint, write>;
-
-fn textureDimensions_0cf2ff() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cf2ff();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cf2ff();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl
deleted file mode 100644
index cb2ee6d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>, level: u32) -> i32
-fn textureDimensions_0d7633() {
- var res: i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d7633();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d7633();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d7633();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c7d1560..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0d7633() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d7633();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d7633();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c7d1560..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0d7633() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d7633();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d7633();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.glsl
deleted file mode 100644
index 8650ac5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_0d7633();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_0d7633();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.msl
deleted file mode 100644
index e8ba8c2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0d7633(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_0d7633(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0d7633(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0d7633(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.spvasm
deleted file mode 100644
index 3622ddf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0d7633 "textureDimensions_0d7633"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0d7633 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %18 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.wgsl
deleted file mode 100644
index 231bad1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d7633.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_0d7633() {
- var res : i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d7633();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d7633();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d7633();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl
deleted file mode 100644
index 1a88f86..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<i32>
-fn textureDimensions_0d8b7e() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d8b7e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d8b7e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 848d8b7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0d8b7e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d8b7e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d8b7e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 848d8b7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0d8b7e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d8b7e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d8b7e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.glsl
deleted file mode 100644
index 19bb91a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0d8b7e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_0d8b7e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.msl
deleted file mode 100644
index d07d72a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0d8b7e(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_0d8b7e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0d8b7e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0d8b7e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.spvasm
deleted file mode 100644
index c5406d7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0d8b7e "textureDimensions_0d8b7e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0d8b7e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.wgsl
deleted file mode 100644
index 2ce14ea..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0d8b7e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
-
-fn textureDimensions_0d8b7e() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d8b7e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d8b7e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl
deleted file mode 100644
index 377cba0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_0e28d3() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e28d3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e28d3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e28d3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e30632c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_0e28d3() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e28d3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e28d3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e30632c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_0e28d3() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e28d3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e28d3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.glsl
deleted file mode 100644
index 58d893a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0e28d3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_0e28d3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.msl
deleted file mode 100644
index e774b54..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0e28d3(texturecube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_0e28d3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0e28d3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0e28d3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.spvasm
deleted file mode 100644
index f72b374..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0e28d3 "textureDimensions_0e28d3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0e28d3 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.wgsl
deleted file mode 100644
index f9c360a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e28d3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_0e28d3() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e28d3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e28d3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e28d3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl
deleted file mode 100644
index cad4dae..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<i32>
-fn textureDimensions_0e32ee() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e32ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e32ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e32ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0f338cc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0e32ee() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e32ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e32ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0f338cc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0e32ee() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e32ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e32ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.glsl
deleted file mode 100644
index 3b00486..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0e32ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0e32ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.msl
deleted file mode 100644
index 376e7b1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0e32ee(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_0e32ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0e32ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0e32ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.spvasm
deleted file mode 100644
index c045a1a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0e32ee "textureDimensions_0e32ee"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0e32ee = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.wgsl
deleted file mode 100644
index c037616..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0e32ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16uint, write>;
-
-fn textureDimensions_0e32ee() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e32ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e32ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e32ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl
deleted file mode 100644
index ed32924..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<i32>
-fn textureDimensions_0f3c50() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0f3c50();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0f3c50();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0f3c50();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5bef298..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0f3c50() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0f3c50();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0f3c50();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5bef298..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0f3c50() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0f3c50();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0f3c50();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.glsl
deleted file mode 100644
index da53ee8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0f3c50();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_0f3c50();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.msl
deleted file mode 100644
index 9e6f6ab..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0f3c50(texture2d_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_0f3c50(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0f3c50(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0f3c50(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.spvasm
deleted file mode 100644
index 53a9a61..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0f3c50 "textureDimensions_0f3c50"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0f3c50 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.wgsl
deleted file mode 100644
index 45eee36..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/0f3c50.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_0f3c50() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0f3c50();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0f3c50();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0f3c50();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl
new file mode 100644
index 0000000..ad676cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2<u32>
+fn textureDimensions_0ff9a4() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0ff9a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0ff9a4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b875a29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_0ff9a4() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0ff9a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b875a29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_0ff9a4() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0ff9a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl
new file mode 100644
index 0000000..31029a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_0ff9a4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_0ff9a4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl
new file mode 100644
index 0000000..b0dbfa8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_0ff9a4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0ff9a4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0ff9a4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..fde44a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0ff9a4 "textureDimensions_0ff9a4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0ff9a4 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..db58ccd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/0ff9a4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_0ff9a4() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0ff9a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0ff9a4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl
deleted file mode 100644
index d035ecd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>) -> vec2<i32>
-fn textureDimensions_1191a5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1191a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1191a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1191a5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cedbfad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1191a5() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1191a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1191a5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cedbfad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1191a5() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1191a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1191a5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.glsl
deleted file mode 100644
index 0514b2e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1191a5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_1191a5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.msl
deleted file mode 100644
index c08c723d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1191a5(texture2d<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_1191a5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1191a5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1191a5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.spvasm
deleted file mode 100644
index 1cc88e1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1191a5 "textureDimensions_1191a5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1191a5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.wgsl
deleted file mode 100644
index c0e1745..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1191a5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_1191a5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1191a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1191a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1191a5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl
deleted file mode 100644
index e62fe51..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2<i32>
-fn textureDimensions_12c9bb() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_12c9bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_12c9bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_12c9bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b7d7274..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_12c9bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_12c9bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_12c9bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b7d7274..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_12c9bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_12c9bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_12c9bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.glsl
deleted file mode 100644
index f0dd48b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_12c9bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_12c9bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.msl
deleted file mode 100644
index ec1712d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_12c9bb(depth2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_12c9bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_12c9bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_12c9bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.spvasm
deleted file mode 100644
index 6fd74ae..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_12c9bb "textureDimensions_12c9bb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_12c9bb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.wgsl
deleted file mode 100644
index 7d58ee6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/12c9bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_12c9bb() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_12c9bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_12c9bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_12c9bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl
new file mode 100644
index 0000000..7a6d2dd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_13f8db() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_13f8db();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_13f8db();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_13f8db();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..45be9cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_13f8db() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_13f8db();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_13f8db();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..45be9cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_13f8db() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_13f8db();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_13f8db();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl
new file mode 100644
index 0000000..71b1703
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_13f8db();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_13f8db();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl
new file mode 100644
index 0000000..cdb8b6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_13f8db(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_13f8db(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_13f8db(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm
new file mode 100644
index 0000000..912c616
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_13f8db "textureDimensions_13f8db"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_13f8db = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl
new file mode 100644
index 0000000..95f880c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/13f8db.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_13f8db() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_13f8db();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_13f8db();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_13f8db();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl
new file mode 100644
index 0000000..baeaac6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<u32>
+fn textureDimensions_1417dd() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1417dd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1417dd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1417dd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9b7349f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_1417dd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1417dd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1417dd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9b7349f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_1417dd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1417dd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1417dd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl
new file mode 100644
index 0000000..6b2d3bb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1417dd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_1417dd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl
new file mode 100644
index 0000000..297b49a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_1417dd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1417dd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1417dd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm
new file mode 100644
index 0000000..c7a3eae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1417dd "textureDimensions_1417dd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1417dd = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl
new file mode 100644
index 0000000..430451d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1417dd.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16sint, write>;
+
+fn textureDimensions_1417dd() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1417dd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1417dd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1417dd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl
deleted file mode 100644
index 8a88425..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<i32>
-fn textureDimensions_147998() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_147998();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_147998();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_147998();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.dxc.hlsl
deleted file mode 100644
index af1e9bd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_147998() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_147998();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_147998();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_147998();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.fxc.hlsl
deleted file mode 100644
index af1e9bd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_147998() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_147998();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_147998();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_147998();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.glsl
deleted file mode 100644
index 90d19e8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_147998();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_147998();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_147998();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.msl
deleted file mode 100644
index 2543103..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_147998(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_147998(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_147998(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_147998(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.spvasm
deleted file mode 100644
index 9e80b7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_147998 "textureDimensions_147998"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_147998 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_147998
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_147998
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_147998
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.wgsl
deleted file mode 100644
index 8379507..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/147998.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32float, write>;
-
-fn textureDimensions_147998() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_147998();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_147998();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_147998();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl
new file mode 100644
index 0000000..953249a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<u32>
+fn textureDimensions_15aa17() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15aa17();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15aa17();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15aa17();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..06e4e9c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_15aa17() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15aa17();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15aa17();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..06e4e9c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_15aa17() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15aa17();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15aa17();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl
new file mode 100644
index 0000000..da990e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_15aa17();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_15aa17();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl
new file mode 100644
index 0000000..147cf4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_15aa17(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_15aa17(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_15aa17(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm
new file mode 100644
index 0000000..4201163
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_15aa17 "textureDimensions_15aa17"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_15aa17 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl
new file mode 100644
index 0000000..2f28d1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15aa17.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32sint, write>;
+
+fn textureDimensions_15aa17() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15aa17();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15aa17();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15aa17();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl
new file mode 100644
index 0000000..ffd1378
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_15b577() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15b577();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15b577();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15b577();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fc8b923
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_15b577() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15b577();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15b577();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fc8b923
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_15b577() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15b577();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15b577();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl
new file mode 100644
index 0000000..3156467
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_15b577();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_15b577();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl
new file mode 100644
index 0000000..4283f9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_15b577(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_15b577(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_15b577(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm
new file mode 100644
index 0000000..5eeed16
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_15b577 "textureDimensions_15b577"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_15b577 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl
new file mode 100644
index 0000000..ea67f39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/15b577.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_15b577() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15b577();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15b577();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15b577();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl
deleted file mode 100644
index a1baa96..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<i32>
-fn textureDimensions_16036c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16036c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16036c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16036c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 02565baa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_16036c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16036c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16036c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 02565baa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_16036c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16036c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16036c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.glsl
deleted file mode 100644
index 5e4d692..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_16036c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_16036c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.msl
deleted file mode 100644
index 4872c89..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_16036c(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_16036c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_16036c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_16036c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.spvasm
deleted file mode 100644
index af24793..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_16036c "textureDimensions_16036c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_16036c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_16036c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_16036c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_16036c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.wgsl
deleted file mode 100644
index 5a9c5f3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16036c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
-
-fn textureDimensions_16036c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16036c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16036c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16036c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl
deleted file mode 100644
index 049b3af..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>, level: u32) -> i32
-fn textureDimensions_16f7cb() {
- var res: i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16f7cb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16f7cb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16f7cb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 711c3d5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_16f7cb() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16f7cb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16f7cb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 711c3d5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_16f7cb() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16f7cb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16f7cb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.glsl
deleted file mode 100644
index a856a6f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_16f7cb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_16f7cb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.msl
deleted file mode 100644
index a358067..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_16f7cb(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_16f7cb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_16f7cb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_16f7cb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.spvasm
deleted file mode 100644
index ec32af4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_16f7cb "textureDimensions_16f7cb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_16f7cb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %int %18 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.wgsl
deleted file mode 100644
index 3ce015d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/16f7cb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_16f7cb() {
- var res : i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16f7cb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16f7cb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16f7cb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl
new file mode 100644
index 0000000..88a2b21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>) -> vec3<u32>
+fn textureDimensions_1a2be7() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1a2be7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1a2be7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..091179b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1a2be7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1a2be7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1a2be7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..091179b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1a2be7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1a2be7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1a2be7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl
new file mode 100644
index 0000000..70c2d4c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1a2be7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_1a2be7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl
new file mode 100644
index 0000000..94c6aef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_1a2be7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1a2be7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1a2be7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c04ebf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1a2be7 "textureDimensions_1a2be7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1a2be7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a5396a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1a2be7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_1a2be7() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1a2be7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1a2be7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl
deleted file mode 100644
index d77491e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<i32>
-fn textureDimensions_1b71f0() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1b71f0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1b71f0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1b71f0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1ffa3d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_1b71f0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1b71f0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1b71f0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1ffa3d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_1b71f0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1b71f0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1b71f0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.glsl
deleted file mode 100644
index 16bd5b6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1b71f0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_1b71f0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.msl
deleted file mode 100644
index 9ef7f55..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1b71f0(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_1b71f0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1b71f0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1b71f0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.spvasm
deleted file mode 100644
index ba6dd6a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1b71f0 "textureDimensions_1b71f0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1b71f0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.wgsl
deleted file mode 100644
index ee928e2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1b71f0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16sint, write>;
-
-fn textureDimensions_1b71f0() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1b71f0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1b71f0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1b71f0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl
new file mode 100644
index 0000000..b38e463
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>, level: i32) -> vec3<u32>
+fn textureDimensions_1bc428() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bc428();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bc428();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bc428();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a50ab85
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bc428() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bc428();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bc428();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a50ab85
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bc428() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bc428();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bc428();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl
new file mode 100644
index 0000000..9936f9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1bc428();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_1bc428();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl
new file mode 100644
index 0000000..17aa025
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_1bc428(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1bc428(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1bc428(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm
new file mode 100644
index 0000000..db6f0f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1bc428 "textureDimensions_1bc428"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1bc428 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v3uint %19 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl
new file mode 100644
index 0000000..5f85f95
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bc428.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_1bc428() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bc428();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bc428();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bc428();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl
new file mode 100644
index 0000000..68b54ae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_1bd78c() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bd78c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bd78c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e1d8fd4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bd78c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bd78c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bd78c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e1d8fd4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bd78c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bd78c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bd78c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl
new file mode 100644
index 0000000..394c9ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1bd78c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_1bd78c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl
new file mode 100644
index 0000000..eb59208
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_1bd78c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1bd78c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1bd78c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm
new file mode 100644
index 0000000..b8bc3ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1bd78c "textureDimensions_1bd78c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1bd78c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl
new file mode 100644
index 0000000..7bad57c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/1bd78c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_1bd78c() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bd78c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bd78c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl
deleted file mode 100644
index b5cb5d9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<i32>
-fn textureDimensions_1d6c26() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1d6c26();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1d6c26();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1d6c26();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 26140a0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1d6c26() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1d6c26();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1d6c26();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 26140a0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1d6c26() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1d6c26();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1d6c26();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.glsl
deleted file mode 100644
index bea79ae..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_1d6c26();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_1d6c26();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.msl
deleted file mode 100644
index 65d506d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1d6c26(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_1d6c26(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1d6c26(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1d6c26(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.spvasm
deleted file mode 100644
index f0feca5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1d6c26 "textureDimensions_1d6c26"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1d6c26 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.wgsl
deleted file mode 100644
index 8bb5c22..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1d6c26.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
-
-fn textureDimensions_1d6c26() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1d6c26();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1d6c26();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1d6c26();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl
deleted file mode 100644
index ed361fe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>, level: u32) -> i32
-fn textureDimensions_1e3981() {
- var res: i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e3981();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e3981();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e3981();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 38cf7e0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1e3981() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e3981();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e3981();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 38cf7e0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1e3981() {
- int2 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e3981();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e3981();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.glsl
deleted file mode 100644
index 24f7b92..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_1e3981();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- int res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_1e3981();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.msl
deleted file mode 100644
index 9651af1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1e3981(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_1e3981(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1e3981(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1e3981(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.spvasm
deleted file mode 100644
index 90f1292..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1e3981 "textureDimensions_1e3981"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1e3981 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %19 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.wgsl
deleted file mode 100644
index 65d87df..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e3981.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_1e3981() {
- var res : i32 = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e3981();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e3981();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e3981();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl
deleted file mode 100644
index 8e3eb59..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> i32
-fn textureDimensions_1e9e39() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e9e39();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e9e39();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e9e39();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 16444c0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1e9e39() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e9e39();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e9e39();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 16444c0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1e9e39() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e9e39();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e9e39();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.glsl
deleted file mode 100644
index 067bc8b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1e9e39();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_1e9e39();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.msl
deleted file mode 100644
index 352d58d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1e9e39(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_1e9e39(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1e9e39(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1e9e39(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.spvasm
deleted file mode 100644
index c83aa50..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1e9e39 "textureDimensions_1e9e39"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1e9e39 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.wgsl
deleted file mode 100644
index efd42ac..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1e9e39.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16float, write>;
-
-fn textureDimensions_1e9e39() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e9e39();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e9e39();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e9e39();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl
deleted file mode 100644
index 4be52a4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<i32>
-fn textureDimensions_1f20c5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1f20c5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1f20c5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1f20c5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e453d42..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1f20c5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1f20c5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1f20c5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e453d42..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1f20c5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1f20c5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1f20c5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.glsl
deleted file mode 100644
index ac742c2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_1f20c5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_1f20c5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.msl
deleted file mode 100644
index d35a456..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1f20c5(texture2d_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_1f20c5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1f20c5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1f20c5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.spvasm
deleted file mode 100644
index 83e1fb4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1f20c5 "textureDimensions_1f20c5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1f20c5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_0
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.wgsl
deleted file mode 100644
index 4800bad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/1f20c5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_1f20c5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1f20c5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1f20c5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1f20c5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl
deleted file mode 100644
index 070bb0b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<i32>
-fn textureDimensions_214dd4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_214dd4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_214dd4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_214dd4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c91423e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_214dd4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_214dd4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_214dd4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c91423e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_214dd4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_214dd4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_214dd4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.glsl
deleted file mode 100644
index d7f534f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_214dd4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_214dd4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.msl
deleted file mode 100644
index 169ee32..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_214dd4(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_214dd4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_214dd4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_214dd4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.spvasm
deleted file mode 100644
index 8210ce8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_214dd4 "textureDimensions_214dd4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_214dd4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.wgsl
deleted file mode 100644
index 8fdb8a3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/214dd4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8sint, write>;
-
-fn textureDimensions_214dd4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_214dd4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_214dd4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_214dd4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl
deleted file mode 100644
index 08978c5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_216688() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_216688();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_216688();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_216688();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c4c2066..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_216688() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_216688();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_216688();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_216688();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c4c2066..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_216688() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_216688();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_216688();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_216688();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.glsl
deleted file mode 100644
index 653c714..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_216688();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_216688();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_216688();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.msl
deleted file mode 100644
index 79a21ca..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_216688(texture2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_216688(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_216688(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_216688(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.spvasm
deleted file mode 100644
index f5abe15..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_216688 "textureDimensions_216688"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_216688 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_216688
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_216688
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_216688
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.wgsl
deleted file mode 100644
index 2480c8f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/216688.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_216688() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_216688();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_216688();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_216688();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl
deleted file mode 100644
index 4328aef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_220dc3() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_220dc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_220dc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_220dc3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index faf57cf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_220dc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_220dc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_220dc3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index faf57cf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_220dc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_220dc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_220dc3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.glsl
deleted file mode 100644
index 4977181..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_220dc3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_220dc3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.msl
deleted file mode 100644
index 953e48a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_220dc3(texture2d<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_220dc3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_220dc3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_220dc3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.spvasm
deleted file mode 100644
index 41ca029..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_220dc3 "textureDimensions_220dc3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_220dc3 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.wgsl
deleted file mode 100644
index 35cc4dd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/220dc3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_220dc3() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_220dc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_220dc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_220dc3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl
deleted file mode 100644
index 707f8d7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_221f22() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_221f22();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_221f22();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_221f22();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 407ec75..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_221f22() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_221f22();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_221f22();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 407ec75..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_221f22() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_221f22();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_221f22();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.glsl
deleted file mode 100644
index 2e53eb0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_221f22();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_221f22();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.msl
deleted file mode 100644
index 21af40c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_221f22(texturecube_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_221f22(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_221f22(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_221f22(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.spvasm
deleted file mode 100644
index 27f7146..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_221f22 "textureDimensions_221f22"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_221f22 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_221f22
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_221f22
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_221f22
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.wgsl
deleted file mode 100644
index 64451b8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/221f22.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_221f22() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_221f22();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_221f22();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_221f22();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl
new file mode 100644
index 0000000..95d6010
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<u32>
+fn textureDimensions_224113() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_224113();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_224113();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_224113();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2af1026
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_224113() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_224113();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_224113();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2af1026
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_224113() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_224113();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_224113();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl
new file mode 100644
index 0000000..569cec5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_224113();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_224113();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl
new file mode 100644
index 0000000..a0f1191
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_224113(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_224113(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_224113(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9d1190
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_224113 "textureDimensions_224113"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_224113 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_224113
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_224113
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_224113
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl
new file mode 100644
index 0000000..c16b613
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/224113.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8unorm, write>;
+
+fn textureDimensions_224113() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_224113();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_224113();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_224113();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl
new file mode 100644
index 0000000..7140918
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_22b5b6() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_22b5b6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_22b5b6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..28b2361
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_22b5b6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_22b5b6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_22b5b6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..28b2361
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_22b5b6() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_22b5b6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_22b5b6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl
new file mode 100644
index 0000000..876edc6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_22b5b6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_22b5b6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl
new file mode 100644
index 0000000..b253911
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_22b5b6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_22b5b6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_22b5b6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm
new file mode 100644
index 0000000..abc00c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_22b5b6 "textureDimensions_22b5b6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_22b5b6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl
new file mode 100644
index 0000000..7710c30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/22b5b6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_22b5b6() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_22b5b6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_22b5b6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl
new file mode 100644
index 0000000..feef6f2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>) -> vec2<u32>
+fn textureDimensions_24db07() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_24db07();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_24db07();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_24db07();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d27a502
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_24db07() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_24db07();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_24db07();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d27a502
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_24db07() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_24db07();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_24db07();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl
new file mode 100644
index 0000000..b48ef53
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_24db07();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_24db07();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl
new file mode 100644
index 0000000..1575e42
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_24db07(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_24db07(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_24db07(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm
new file mode 100644
index 0000000..855ef0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_24db07 "textureDimensions_24db07"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_24db07 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl
new file mode 100644
index 0000000..28f4077
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/24db07.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_24db07() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_24db07();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_24db07();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_24db07();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl
new file mode 100644
index 0000000..95cac6e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<u32>
+fn textureDimensions_2674d8() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2674d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2674d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2674d8();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b619638
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_2674d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2674d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2674d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b619638
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_2674d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2674d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2674d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl
new file mode 100644
index 0000000..6c4d034
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_2674d8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_2674d8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl
new file mode 100644
index 0000000..b367114
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_2674d8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2674d8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2674d8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..3b8b2fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2674d8 "textureDimensions_2674d8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2674d8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ece5a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2674d8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureDimensions_2674d8() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2674d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2674d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2674d8();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl
deleted file mode 100644
index dc9ba72..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_267788() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_267788();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_267788();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_267788();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e168509..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_267788() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_267788();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_267788();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_267788();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e168509..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_267788() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_267788();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_267788();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_267788();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.glsl
deleted file mode 100644
index 85c3d3c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_267788();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void fragment_main() {
- textureDimensions_267788();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void compute_main() {
- textureDimensions_267788();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.msl
deleted file mode 100644
index 418ff8e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_267788(texture2d_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_267788(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_267788(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_267788(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.spvasm
deleted file mode 100644
index 38a3379..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_267788 "textureDimensions_267788"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_267788 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_1
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_267788
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_267788
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_267788
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.wgsl
deleted file mode 100644
index 00dd2eb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/267788.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_267788() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_267788();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_267788();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_267788();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl
deleted file mode 100644
index 5cc0947..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>, level: i32) -> vec3<i32>
-fn textureDimensions_26bdfa() {
- var res: vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26bdfa();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26bdfa();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26bdfa();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3af475c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_26bdfa() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26bdfa();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26bdfa();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3af475c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_26bdfa() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26bdfa();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26bdfa();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.glsl
deleted file mode 100644
index fb93b69..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_26bdfa();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_26bdfa();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.msl
deleted file mode 100644
index 5010337..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_26bdfa(texture3d<float, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_26bdfa(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_26bdfa(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_26bdfa(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.spvasm
deleted file mode 100644
index b9b9b96..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_26bdfa "textureDimensions_26bdfa"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_26bdfa = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v3int %19 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.wgsl
deleted file mode 100644
index 2a55852..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26bdfa.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_26bdfa() {
- var res : vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26bdfa();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26bdfa();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26bdfa();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl
new file mode 100644
index 0000000..56b19de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>) -> u32
+fn textureDimensions_26d6bf() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_26d6bf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_26d6bf();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3de8d27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_26d6bf() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_26d6bf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26d6bf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3de8d27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_26d6bf() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_26d6bf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26d6bf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl
new file mode 100644
index 0000000..d262540
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_26d6bf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_26d6bf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl
new file mode 100644
index 0000000..d8130b4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_26d6bf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_26d6bf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_26d6bf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm
new file mode 100644
index 0000000..47116b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_26d6bf "textureDimensions_26d6bf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_26d6bf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %uint %18 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl
new file mode 100644
index 0000000..ba2a96a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/26d6bf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_26d6bf() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_26d6bf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_26d6bf();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl
deleted file mode 100644
index 4cde4c9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<i32>
-fn textureDimensions_26ef6c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26ef6c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26ef6c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26ef6c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7ccf32f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_26ef6c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26ef6c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26ef6c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7ccf32f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_26ef6c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26ef6c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26ef6c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.glsl
deleted file mode 100644
index dbdb178..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_26ef6c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_26ef6c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.msl
deleted file mode 100644
index ba9013a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_26ef6c(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_26ef6c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_26ef6c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_26ef6c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.spvasm
deleted file mode 100644
index bd40e12..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_26ef6c "textureDimensions_26ef6c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_26ef6c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.wgsl
deleted file mode 100644
index c0b495c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/26ef6c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
-
-fn textureDimensions_26ef6c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26ef6c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26ef6c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26ef6c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl
deleted file mode 100644
index 593565b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<i32>
-fn textureDimensions_2ad087() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2ad087();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2ad087();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2ad087();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 33dee50..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2ad087() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2ad087();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2ad087();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 33dee50..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2ad087() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2ad087();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2ad087();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.glsl
deleted file mode 100644
index 90289b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_2ad087();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_2ad087();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.msl
deleted file mode 100644
index 011b3cb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2ad087(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_2ad087(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2ad087(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2ad087(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.spvasm
deleted file mode 100644
index cb89db5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2ad087 "textureDimensions_2ad087"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2ad087 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.wgsl
deleted file mode 100644
index e965a18..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2ad087.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16sint, write>;
-
-fn textureDimensions_2ad087() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2ad087();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2ad087();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2ad087();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl
deleted file mode 100644
index 082fab0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_2d4299() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2d4299();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2d4299();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2d4299();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1c2051f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_2d4299() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2d4299();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2d4299();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1c2051f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_2d4299() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2d4299();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2d4299();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.glsl
deleted file mode 100644
index c5a791c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_2d4299();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_2d4299();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.msl
deleted file mode 100644
index dcc5aa1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2d4299(texturecube_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_2d4299(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2d4299(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2d4299(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.spvasm
deleted file mode 100644
index 9a78821..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2d4299 "textureDimensions_2d4299"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2d4299 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.wgsl
deleted file mode 100644
index 41da16a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2d4299.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_2d4299() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2d4299();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2d4299();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2d4299();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl
new file mode 100644
index 0000000..8457bc5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_2e443d() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2e443d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2e443d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2e443d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9760281
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_2e443d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2e443d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2e443d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9760281
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_2e443d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2e443d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2e443d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl
new file mode 100644
index 0000000..f85f6a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_2e443d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_2e443d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl
new file mode 100644
index 0000000..5ae0332
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_2e443d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2e443d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2e443d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm
new file mode 100644
index 0000000..7bef763
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2e443d "textureDimensions_2e443d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2e443d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl
new file mode 100644
index 0000000..50d05a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2e443d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_2e443d() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2e443d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2e443d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2e443d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl
deleted file mode 100644
index 0a64436..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>, level: i32) -> vec3<i32>
-fn textureDimensions_2efa05() {
- var res: vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2efa05();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2efa05();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2efa05();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 10640f6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_2efa05() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2efa05();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2efa05();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 10640f6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_2efa05() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2efa05();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2efa05();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.glsl
deleted file mode 100644
index d500bc4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_2efa05();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_2efa05();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.msl
deleted file mode 100644
index 8e8fc66..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2efa05(texture3d<uint, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_2efa05(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2efa05(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2efa05(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.spvasm
deleted file mode 100644
index cd2e64c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2efa05 "textureDimensions_2efa05"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2efa05 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %20 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.wgsl
deleted file mode 100644
index 360912c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2efa05.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_2efa05() {
- var res : vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2efa05();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2efa05();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2efa05();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl
deleted file mode 100644
index d5bbd86..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<i32>
-fn textureDimensions_2f289f() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2f289f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2f289f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2f289f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b84004a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2f289f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2f289f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2f289f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b84004a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2f289f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2f289f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2f289f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.glsl
deleted file mode 100644
index ecf5ce0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_2f289f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_2f289f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.msl
deleted file mode 100644
index a61bafe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2f289f(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_2f289f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2f289f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2f289f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.spvasm
deleted file mode 100644
index ae04243..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2f289f "textureDimensions_2f289f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2f289f = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.wgsl
deleted file mode 100644
index 6895807..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2f289f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32sint, write>;
-
-fn textureDimensions_2f289f() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2f289f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2f289f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2f289f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl
new file mode 100644
index 0000000..2b7fc26
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_2fd2a4() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2fd2a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2fd2a4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..00bd752
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2fd2a4() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2fd2a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..00bd752
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2fd2a4() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2fd2a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl
new file mode 100644
index 0000000..10ce5b5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_2fd2a4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_2fd2a4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl
new file mode 100644
index 0000000..c6c33ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_2fd2a4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2fd2a4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2fd2a4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..b64c7b2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2fd2a4 "textureDimensions_2fd2a4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2fd2a4 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..873be75
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/2fd2a4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_2fd2a4() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2fd2a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2fd2a4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl
deleted file mode 100644
index c58da7f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_2fe1cc() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2fe1cc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2fe1cc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 56625c8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_2fe1cc() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2fe1cc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2fe1cc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 56625c8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_2fe1cc() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2fe1cc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2fe1cc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.glsl
deleted file mode 100644
index 9f1b3d5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_2fe1cc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_2fe1cc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.msl
deleted file mode 100644
index 2950d53..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2fe1cc(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_2fe1cc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2fe1cc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2fe1cc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.spvasm
deleted file mode 100644
index 498011b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2fe1cc "textureDimensions_2fe1cc"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2fe1cc = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.wgsl
deleted file mode 100644
index 8ed4e5e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/2fe1cc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_2fe1cc() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2fe1cc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2fe1cc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl
new file mode 100644
index 0000000..ac10c7f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<u32>
+fn textureDimensions_31799c() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_31799c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_31799c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_31799c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..35f842f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_31799c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_31799c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_31799c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..35f842f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_31799c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_31799c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_31799c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl
new file mode 100644
index 0000000..f9e44f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_31799c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_31799c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl
new file mode 100644
index 0000000..2636a9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_31799c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_31799c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_31799c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm
new file mode 100644
index 0000000..95189a1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_31799c "textureDimensions_31799c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_31799c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl
new file mode 100644
index 0000000..9fdcfa9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/31799c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32uint, write>;
+
+fn textureDimensions_31799c() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_31799c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_31799c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_31799c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl
deleted file mode 100644
index dd4bfd1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> i32
-fn textureDimensions_318ecc() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_318ecc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_318ecc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_318ecc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bc9b732..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_318ecc() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_318ecc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_318ecc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bc9b732..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_318ecc() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_318ecc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_318ecc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.glsl
deleted file mode 100644
index 078e8b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_318ecc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_318ecc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.msl
deleted file mode 100644
index a9655f5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_318ecc(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_318ecc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_318ecc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_318ecc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.spvasm
deleted file mode 100644
index c65dba9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_318ecc "textureDimensions_318ecc"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_318ecc = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.wgsl
deleted file mode 100644
index 9a7028c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/318ecc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16uint, write>;
-
-fn textureDimensions_318ecc() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_318ecc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_318ecc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_318ecc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl
deleted file mode 100644
index df9309b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<i32>
-fn textureDimensions_340d06() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_340d06();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_340d06();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_340d06();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.dxc.hlsl
deleted file mode 100644
index db01f68..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_340d06() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_340d06();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_340d06();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_340d06();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.fxc.hlsl
deleted file mode 100644
index db01f68..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_340d06() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_340d06();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_340d06();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_340d06();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.glsl
deleted file mode 100644
index 78d4994..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_340d06();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_340d06();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_340d06();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.msl
deleted file mode 100644
index eb04eb8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_340d06(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_340d06(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_340d06(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_340d06(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.spvasm
deleted file mode 100644
index c58da9b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_340d06 "textureDimensions_340d06"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_340d06 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_340d06
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_340d06
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_340d06
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.wgsl
deleted file mode 100644
index 99bca2d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/340d06.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32uint, write>;
-
-fn textureDimensions_340d06() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_340d06();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_340d06();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_340d06();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl
new file mode 100644
index 0000000..aac258e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_346fee() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_346fee();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_346fee();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_346fee();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9013e3c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_346fee() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_346fee();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_346fee();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9013e3c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_346fee() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_346fee();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_346fee();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl
new file mode 100644
index 0000000..cff2b1c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_346fee();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_346fee();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl
new file mode 100644
index 0000000..535a3ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_346fee(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_346fee(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_346fee(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm
new file mode 100644
index 0000000..aa9789f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_346fee "textureDimensions_346fee"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_346fee = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl
new file mode 100644
index 0000000..e8e7746
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/346fee.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_346fee() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_346fee();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_346fee();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_346fee();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl
new file mode 100644
index 0000000..23512e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<u32>
+fn textureDimensions_35a7e5() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35a7e5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35a7e5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..89ff223
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35a7e5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35a7e5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35a7e5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..89ff223
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35a7e5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35a7e5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35a7e5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl
new file mode 100644
index 0000000..02d2d30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_35a7e5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_35a7e5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl
new file mode 100644
index 0000000..5e7177a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_35a7e5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_35a7e5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_35a7e5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c6fd1b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_35a7e5 "textureDimensions_35a7e5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_35a7e5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl
new file mode 100644
index 0000000..bea8f76
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35a7e5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16uint, write>;
+
+fn textureDimensions_35a7e5() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35a7e5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35a7e5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl
new file mode 100644
index 0000000..b63e75f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<u32>
+fn textureDimensions_35ee69() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35ee69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35ee69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35ee69();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9880c32
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35ee69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35ee69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35ee69();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9880c32
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35ee69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35ee69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35ee69();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl
new file mode 100644
index 0000000..a338d42
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_35ee69();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_35ee69();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl
new file mode 100644
index 0000000..de21a7c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_35ee69(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_35ee69(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_35ee69(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm
new file mode 100644
index 0000000..492a8e3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_35ee69 "textureDimensions_35ee69"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_35ee69 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a1050d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/35ee69.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32uint, write>;
+
+fn textureDimensions_35ee69() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35ee69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35ee69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35ee69();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl
new file mode 100644
index 0000000..b0ce2cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<u32>
+fn textureDimensions_378a65() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_378a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_378a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_378a65();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1782677
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_378a65() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_378a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_378a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1782677
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_378a65() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_378a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_378a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl
new file mode 100644
index 0000000..54d2060
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_378a65();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_378a65();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl
new file mode 100644
index 0000000..8db7c6e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_378a65(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_378a65(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_378a65(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm
new file mode 100644
index 0000000..e2429ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_378a65 "textureDimensions_378a65"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_378a65 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl
new file mode 100644
index 0000000..0400b2f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/378a65.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8sint, write>;
+
+fn textureDimensions_378a65() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_378a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_378a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_378a65();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl
new file mode 100644
index 0000000..ded6da2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_382b16() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_382b16();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_382b16();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_382b16();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..05d0f91
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_382b16() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_382b16();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_382b16();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..05d0f91
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_382b16() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_382b16();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_382b16();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl
new file mode 100644
index 0000000..0504b8f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_382b16();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_382b16();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl
new file mode 100644
index 0000000..b3b12bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_382b16(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_382b16(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_382b16(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm
new file mode 100644
index 0000000..122abf6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_382b16 "textureDimensions_382b16"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_382b16 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl
new file mode 100644
index 0000000..28c3a2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/382b16.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_382b16() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_382b16();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_382b16();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_382b16();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl
new file mode 100644
index 0000000..cbd3c9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_3963d0() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3963d0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3963d0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3963d0();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..25b47dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3963d0() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3963d0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3963d0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..25b47dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3963d0() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3963d0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3963d0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl
new file mode 100644
index 0000000..11f97c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3963d0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_3963d0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl
new file mode 100644
index 0000000..a4aa7f7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_3963d0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3963d0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3963d0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm
new file mode 100644
index 0000000..1bb43d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3963d0 "textureDimensions_3963d0"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3963d0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %uint_1
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl
new file mode 100644
index 0000000..4c24f17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3963d0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_3963d0() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3963d0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3963d0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3963d0();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl
deleted file mode 100644
index f4c0975..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<i32>
-fn textureDimensions_398e30() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_398e30();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_398e30();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_398e30();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ee95c58..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_398e30() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_398e30();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_398e30();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ee95c58..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_398e30() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_398e30();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_398e30();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.glsl
deleted file mode 100644
index 6db6351..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_398e30();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_398e30();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.msl
deleted file mode 100644
index 8de5617..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_398e30(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_398e30(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_398e30(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_398e30(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.spvasm
deleted file mode 100644
index 9339841..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_398e30 "textureDimensions_398e30"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_398e30 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_398e30
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_398e30
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_398e30
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.wgsl
deleted file mode 100644
index 5deab7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/398e30.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
-
-fn textureDimensions_398e30() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_398e30();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_398e30();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_398e30();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl
new file mode 100644
index 0000000..941dd1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<u32>
+fn textureDimensions_3a5bb1() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a5bb1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a5bb1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..634df9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a5bb1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a5bb1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..634df9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a5bb1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a5bb1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl
new file mode 100644
index 0000000..ca53343
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3a5bb1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_3a5bb1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl
new file mode 100644
index 0000000..0b128b7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_3a5bb1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3a5bb1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3a5bb1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm
new file mode 100644
index 0000000..c804df1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3a5bb1 "textureDimensions_3a5bb1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3a5bb1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl
new file mode 100644
index 0000000..16c8913
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a5bb1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32float, write>;
+
+fn textureDimensions_3a5bb1() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a5bb1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a5bb1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl
new file mode 100644
index 0000000..ad105d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<u32>
+fn textureDimensions_3a7b69() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a7b69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a7b69();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c967a1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a7b69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a7b69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a7b69();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c967a1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a7b69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a7b69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a7b69();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl
new file mode 100644
index 0000000..b9b2a19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3a7b69();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_3a7b69();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl
new file mode 100644
index 0000000..113dca5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_3a7b69(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3a7b69(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3a7b69(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm
new file mode 100644
index 0000000..8dbeda7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3a7b69 "textureDimensions_3a7b69"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3a7b69 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl
new file mode 100644
index 0000000..7267529
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3a7b69.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureDimensions_3a7b69() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a7b69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a7b69();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl
deleted file mode 100644
index db77b57..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<i32>
-fn textureDimensions_3a94ea() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3a94ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3a94ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3a94ea();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 347c92e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_3a94ea() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3a94ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3a94ea();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 347c92e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_3a94ea() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3a94ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3a94ea();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.glsl
deleted file mode 100644
index 4e7d263..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3a94ea();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3a94ea();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.msl
deleted file mode 100644
index 7dd2f6b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3a94ea(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_3a94ea(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3a94ea(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3a94ea(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.spvasm
deleted file mode 100644
index 1ef266d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3a94ea "textureDimensions_3a94ea"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3a94ea = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.wgsl
deleted file mode 100644
index c1cebaf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3a94ea.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32uint, write>;
-
-fn textureDimensions_3a94ea() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3a94ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3a94ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3a94ea();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl
deleted file mode 100644
index 673d8c2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> i32
-fn textureDimensions_3aca08() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3aca08();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3aca08();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3aca08();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 05eedf3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_3aca08() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3aca08();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3aca08();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 05eedf3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_3aca08() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3aca08();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3aca08();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.glsl
deleted file mode 100644
index e9c1656..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3aca08();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3aca08();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.msl
deleted file mode 100644
index 765771f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3aca08(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_3aca08(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3aca08(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3aca08(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.spvasm
deleted file mode 100644
index faf0eff..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3aca08 "textureDimensions_3aca08"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3aca08 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.wgsl
deleted file mode 100644
index 1a72665..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3aca08.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32float, write>;
-
-fn textureDimensions_3aca08() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3aca08();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3aca08();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3aca08();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl
new file mode 100644
index 0000000..3b115bd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> u32
+fn textureDimensions_3af3e7() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3af3e7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3af3e7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fd65762
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3af3e7() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3af3e7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3af3e7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fd65762
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3af3e7() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3af3e7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3af3e7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl
new file mode 100644
index 0000000..dc7f1b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3af3e7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_3af3e7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl
new file mode 100644
index 0000000..3623ce7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_3af3e7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3af3e7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3af3e7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ab0115
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3af3e7 "textureDimensions_3af3e7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3af3e7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..35da220
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3af3e7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8unorm, write>;
+
+fn textureDimensions_3af3e7() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3af3e7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3af3e7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl
new file mode 100644
index 0000000..bafaabe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d) -> vec2<u32>
+fn textureDimensions_3b38f6() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3b38f6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3b38f6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4d33804
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_3b38f6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3b38f6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3b38f6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4d33804
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_3b38f6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3b38f6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3b38f6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl
new file mode 100644
index 0000000..129932f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3b38f6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_3b38f6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl
new file mode 100644
index 0000000..4e768f8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_3b38f6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3b38f6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3b38f6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc00d06
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3b38f6 "textureDimensions_3b38f6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3b38f6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl
new file mode 100644
index 0000000..f217d69
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3b38f6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_3b38f6() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3b38f6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3b38f6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl
new file mode 100644
index 0000000..a8563c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<u32>
+fn textureDimensions_3baab5() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3baab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3baab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3baab5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..09829f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_3baab5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3baab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3baab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..09829f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_3baab5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3baab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3baab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl
new file mode 100644
index 0000000..e5fd931
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3baab5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_3baab5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl
new file mode 100644
index 0000000..fabb265
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_3baab5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3baab5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3baab5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm
new file mode 100644
index 0000000..f11c499
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3baab5 "textureDimensions_3baab5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3baab5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl
new file mode 100644
index 0000000..35891f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3baab5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureDimensions_3baab5() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3baab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3baab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3baab5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl
deleted file mode 100644
index 3fe2fb6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<i32>
-fn textureDimensions_3c5ad8() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3c5ad8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3c5ad8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 78cd91b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_3c5ad8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3c5ad8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3c5ad8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 78cd91b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_3c5ad8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3c5ad8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3c5ad8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.glsl
deleted file mode 100644
index b27ab3b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3c5ad8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3c5ad8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.msl
deleted file mode 100644
index ba7e47a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3c5ad8(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_3c5ad8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3c5ad8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3c5ad8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.spvasm
deleted file mode 100644
index f91c033..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3c5ad8 "textureDimensions_3c5ad8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3c5ad8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.wgsl
deleted file mode 100644
index a73139d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/3c5ad8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8sint, write>;
-
-fn textureDimensions_3c5ad8() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3c5ad8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3c5ad8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl
new file mode 100644
index 0000000..31fc310
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_3c66f0() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3c66f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3c66f0();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d542da1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3c66f0() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3c66f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3c66f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d542da1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3c66f0() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3c66f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3c66f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl
new file mode 100644
index 0000000..b3e471e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3c66f0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_3c66f0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl
new file mode 100644
index 0000000..97e45a6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_3c66f0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3c66f0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3c66f0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm
new file mode 100644
index 0000000..8aa3f8d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3c66f0 "textureDimensions_3c66f0"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3c66f0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_1
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl
new file mode 100644
index 0000000..7b1e56e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3c66f0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_3c66f0() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3c66f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3c66f0();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl
new file mode 100644
index 0000000..4762ddd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<u32>
+fn textureDimensions_3f3474() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3f3474();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3f3474();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3f3474();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..588227e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3f3474() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3f3474();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3f3474();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..588227e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3f3474() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3f3474();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3f3474();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl
new file mode 100644
index 0000000..91d50d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3f3474();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_3f3474();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl
new file mode 100644
index 0000000..1ab3e70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureDimensions_3f3474(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3f3474(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3f3474(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9f1b47
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3f3474 "textureDimensions_3f3474"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3f3474 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1db5f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3f3474.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureDimensions_3f3474() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3f3474();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3f3474();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3f3474();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl
new file mode 100644
index 0000000..eb8dba1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_3fc3dc() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3fc3dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3fc3dc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f553980
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3fc3dc() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3fc3dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f553980
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3fc3dc() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3fc3dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl
new file mode 100644
index 0000000..05b93eb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3fc3dc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_3fc3dc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl
new file mode 100644
index 0000000..cdb5b1a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_3fc3dc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3fc3dc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3fc3dc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm
new file mode 100644
index 0000000..9becd97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3fc3dc "textureDimensions_3fc3dc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3fc3dc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl
new file mode 100644
index 0000000..0d7707e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/3fc3dc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_3fc3dc() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3fc3dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3fc3dc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl
new file mode 100644
index 0000000..8611ca5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<u32>
+fn textureDimensions_40c671() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40c671();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40c671();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40c671();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..74aa4ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_40c671() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40c671();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40c671();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..74aa4ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_40c671() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40c671();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40c671();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl
new file mode 100644
index 0000000..6494fd0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_40c671();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_40c671();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl
new file mode 100644
index 0000000..d737668
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_40c671(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_40c671(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_40c671(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm
new file mode 100644
index 0000000..c1c8494
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_40c671 "textureDimensions_40c671"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40c671 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e38a8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40c671.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8sint, write>;
+
+fn textureDimensions_40c671() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40c671();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40c671();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40c671();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl
new file mode 100644
index 0000000..4b387f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<u32>
+fn textureDimensions_40ecf4() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40ecf4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40ecf4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..76e4032
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_40ecf4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40ecf4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40ecf4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..76e4032
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_40ecf4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40ecf4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40ecf4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl
new file mode 100644
index 0000000..8eab55c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_40ecf4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_40ecf4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl
new file mode 100644
index 0000000..1ee450a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_40ecf4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_40ecf4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_40ecf4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea8ee52
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_40ecf4 "textureDimensions_40ecf4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40ecf4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl
new file mode 100644
index 0000000..5732ee2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/40ecf4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureDimensions_40ecf4() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40ecf4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40ecf4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl
deleted file mode 100644
index 2e88d1b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<i32>
-fn textureDimensions_4152a6() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4152a6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4152a6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4152a6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ae5eb35..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_4152a6() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4152a6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4152a6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ae5eb35..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_4152a6() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4152a6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4152a6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.glsl
deleted file mode 100644
index d3120a3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_4152a6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_4152a6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.msl
deleted file mode 100644
index ac8d43d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4152a6(texturecube_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_4152a6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4152a6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4152a6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.spvasm
deleted file mode 100644
index e092546..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4152a6 "textureDimensions_4152a6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4152a6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_0
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.wgsl
deleted file mode 100644
index 67521ab..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4152a6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_4152a6() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4152a6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4152a6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4152a6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl
new file mode 100644
index 0000000..cc79e7c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<u32>
+fn textureDimensions_41545f() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_41545f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_41545f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_41545f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6352cad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_41545f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_41545f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_41545f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6352cad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_41545f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_41545f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_41545f();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl
new file mode 100644
index 0000000..542e625
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_41545f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_41545f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl
new file mode 100644
index 0000000..6d66d30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_41545f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_41545f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_41545f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm
new file mode 100644
index 0000000..e5a2d6d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_41545f "textureDimensions_41545f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_41545f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl
new file mode 100644
index 0000000..119c226
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/41545f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureDimensions_41545f() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_41545f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_41545f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_41545f();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl
deleted file mode 100644
index f358b83..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>) -> i32
-fn textureDimensions_423f99() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_423f99();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_423f99();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_423f99();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d6a4e4b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_423f99() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_423f99();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_423f99();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_423f99();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d6a4e4b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_423f99() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_423f99();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_423f99();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_423f99();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.glsl
deleted file mode 100644
index 08f2e24..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_423f99();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_423f99();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_423f99();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.msl
deleted file mode 100644
index 77b610f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_423f99(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_423f99(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_423f99(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_423f99(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.spvasm
deleted file mode 100644
index 807bc78..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_423f99 "textureDimensions_423f99"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_423f99 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %18 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_423f99
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_423f99
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_423f99
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.wgsl
deleted file mode 100644
index 0ef4f77..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/423f99.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_423f99() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_423f99();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_423f99();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_423f99();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl
deleted file mode 100644
index cbe8ae3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<i32>
-fn textureDimensions_4267ee() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4267ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4267ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4267ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index aab581e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_4267ee() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4267ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4267ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index aab581e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_4267ee() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4267ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4267ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.glsl
deleted file mode 100644
index c1f09fa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_4267ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_4267ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.msl
deleted file mode 100644
index 177015d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4267ee(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_4267ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4267ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4267ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.spvasm
deleted file mode 100644
index a93a79d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4267ee "textureDimensions_4267ee"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4267ee = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.wgsl
deleted file mode 100644
index a634268..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4267ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32float, write>;
-
-fn textureDimensions_4267ee() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4267ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4267ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4267ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl
deleted file mode 100644
index 1cb8613..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> i32
-fn textureDimensions_42d4e6() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_42d4e6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_42d4e6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_42d4e6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7c81817..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_42d4e6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_42d4e6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_42d4e6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7c81817..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_42d4e6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_42d4e6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_42d4e6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.glsl
deleted file mode 100644
index f59d175..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_42d4e6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_42d4e6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.msl
deleted file mode 100644
index cc3fa54..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_42d4e6(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_42d4e6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_42d4e6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_42d4e6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.spvasm
deleted file mode 100644
index 4127ab0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_42d4e6 "textureDimensions_42d4e6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_42d4e6 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.wgsl
deleted file mode 100644
index ab0376b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/42d4e6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8unorm, write>;
-
-fn textureDimensions_42d4e6() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_42d4e6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_42d4e6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_42d4e6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl
new file mode 100644
index 0000000..42b6803
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<u32>
+fn textureDimensions_439651() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_439651();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_439651();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_439651();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5a450e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_439651() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_439651();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_439651();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5a450e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_439651() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_439651();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_439651();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl
new file mode 100644
index 0000000..d997ea7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_439651();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_439651();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl
new file mode 100644
index 0000000..6c456ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_439651(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_439651(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_439651(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm
new file mode 100644
index 0000000..d5f13da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_439651 "textureDimensions_439651"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_439651 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_439651
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_439651
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_439651
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl
new file mode 100644
index 0000000..d99bc45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/439651.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32sint, write>;
+
+fn textureDimensions_439651() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_439651();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_439651();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_439651();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl
new file mode 100644
index 0000000..ed4441c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<u32>
+fn textureDimensions_445376() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_445376();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_445376();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_445376();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c60935
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_445376() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_445376();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_445376();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c60935
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_445376() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_445376();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_445376();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl
new file mode 100644
index 0000000..9854fcf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_445376();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_445376();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl
new file mode 100644
index 0000000..de6d82a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_445376(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_445376(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_445376(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm
new file mode 100644
index 0000000..f9cf186
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_445376 "textureDimensions_445376"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_445376 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_445376
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_445376
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_445376
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl
new file mode 100644
index 0000000..9b3d28b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/445376.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_445376() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_445376();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_445376();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_445376();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl
new file mode 100644
index 0000000..505488f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<u32>
+fn textureDimensions_44b358() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_44b358();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_44b358();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_44b358();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..28733d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_44b358() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_44b358();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_44b358();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..28733d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_44b358() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_44b358();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_44b358();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl
new file mode 100644
index 0000000..b8140ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_44b358();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_44b358();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl
new file mode 100644
index 0000000..3fdd338
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_44b358(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_44b358(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_44b358(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm
new file mode 100644
index 0000000..d3cbbcd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_44b358 "textureDimensions_44b358"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_44b358 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl
new file mode 100644
index 0000000..de45407
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/44b358.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32uint, write>;
+
+fn textureDimensions_44b358() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_44b358();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_44b358();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_44b358();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl
new file mode 100644
index 0000000..a156207
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<u32>
+fn textureDimensions_452fc1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_452fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_452fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_452fc1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1a21c49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_452fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_452fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_452fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1a21c49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_452fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_452fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_452fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl
new file mode 100644
index 0000000..7588f6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_452fc1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_452fc1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl
new file mode 100644
index 0000000..291394f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_452fc1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_452fc1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_452fc1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..4fd3aa9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_452fc1 "textureDimensions_452fc1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_452fc1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..5f78af1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/452fc1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureDimensions_452fc1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_452fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_452fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_452fc1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl
new file mode 100644
index 0000000..4fe62b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<u32>
+fn textureDimensions_46f0fc() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_46f0fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_46f0fc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f82b087
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_46f0fc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_46f0fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_46f0fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f82b087
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_46f0fc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_46f0fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_46f0fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl
new file mode 100644
index 0000000..8ca5717
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_46f0fc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_46f0fc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl
new file mode 100644
index 0000000..d085a9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_46f0fc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_46f0fc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_46f0fc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm
new file mode 100644
index 0000000..5847f93
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_46f0fc "textureDimensions_46f0fc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_46f0fc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl
new file mode 100644
index 0000000..f968df1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/46f0fc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_46f0fc() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_46f0fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_46f0fc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl
deleted file mode 100644
index 95910e9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<i32>
-fn textureDimensions_48cb89() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_48cb89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_48cb89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_48cb89();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9ec64be..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_48cb89() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_48cb89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_48cb89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9ec64be..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_48cb89() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_48cb89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_48cb89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.glsl
deleted file mode 100644
index 026fcaef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_48cb89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_48cb89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.msl
deleted file mode 100644
index 5f475e2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_48cb89(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_48cb89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_48cb89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_48cb89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.spvasm
deleted file mode 100644
index 9a887dc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_48cb89 "textureDimensions_48cb89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_48cb89 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.wgsl
deleted file mode 100644
index 2e4ee35..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/48cb89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16float, write>;
-
-fn textureDimensions_48cb89() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_48cb89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_48cb89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_48cb89();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl
new file mode 100644
index 0000000..cd46de9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_49a067() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_49a067();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_49a067();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_49a067();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..120351c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_49a067() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_49a067();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_49a067();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..120351c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_49a067() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_49a067();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_49a067();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl
new file mode 100644
index 0000000..e9eb025
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_49a067();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_49a067();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl
new file mode 100644
index 0000000..9ab7902
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_49a067(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_49a067(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_49a067(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm
new file mode 100644
index 0000000..52f197e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_49a067 "textureDimensions_49a067"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_49a067 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl
new file mode 100644
index 0000000..517c8c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/49a067.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_49a067() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_49a067();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_49a067();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_49a067();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl
deleted file mode 100644
index ee9101f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<i32>
-fn textureDimensions_49d274() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_49d274();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_49d274();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_49d274();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9ceff50..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_49d274() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_49d274();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_49d274();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9ceff50..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_49d274() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_49d274();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_49d274();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.glsl
deleted file mode 100644
index 70347a6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_49d274();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_49d274();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.msl
deleted file mode 100644
index 4ca4453..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_49d274(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_49d274(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_49d274(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_49d274(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.spvasm
deleted file mode 100644
index 9a63680..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_49d274 "textureDimensions_49d274"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_49d274 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_49d274
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_49d274
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_49d274
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.wgsl
deleted file mode 100644
index 060af23..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/49d274.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
-
-fn textureDimensions_49d274() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_49d274();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_49d274();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_49d274();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl
new file mode 100644
index 0000000..a11f1c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<u32>
+fn textureDimensions_4acec7() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4acec7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4acec7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4acec7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fcad56d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4acec7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4acec7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4acec7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fcad56d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4acec7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4acec7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4acec7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl
new file mode 100644
index 0000000..b94e7fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_4acec7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_4acec7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl
new file mode 100644
index 0000000..1647a14
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_4acec7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4acec7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4acec7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm
new file mode 100644
index 0000000..de0e0ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4acec7 "textureDimensions_4acec7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4acec7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl
new file mode 100644
index 0000000..38343eb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4acec7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureDimensions_4acec7() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4acec7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4acec7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4acec7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl
new file mode 100644
index 0000000..5dcc74b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<u32>
+fn textureDimensions_4b26ef() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4b26ef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4b26ef();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e783ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4b26ef() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4b26ef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4b26ef();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e783ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4b26ef() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4b26ef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4b26ef();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl
new file mode 100644
index 0000000..e7491ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_4b26ef();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_4b26ef();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl
new file mode 100644
index 0000000..5efcbfa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_4b26ef(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4b26ef(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4b26ef(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab7781f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4b26ef "textureDimensions_4b26ef"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4b26ef = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl
new file mode 100644
index 0000000..c12b60c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4b26ef.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8unorm, write>;
+
+fn textureDimensions_4b26ef() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4b26ef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4b26ef();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl
new file mode 100644
index 0000000..49432db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>) -> vec2<u32>
+fn textureDimensions_4be71b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4be71b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4be71b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4be71b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bf593db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_4be71b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4be71b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4be71b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bf593db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_4be71b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4be71b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4be71b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl
new file mode 100644
index 0000000..13a1e30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_4be71b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_4be71b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl
new file mode 100644
index 0000000..7bbfb11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_4be71b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4be71b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4be71b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm
new file mode 100644
index 0000000..0bbbd21
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4be71b "textureDimensions_4be71b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4be71b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl
new file mode 100644
index 0000000..cea7772
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/4be71b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_4be71b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4be71b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4be71b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4be71b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl
deleted file mode 100644
index 28c7b44..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_4d42cf() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4d42cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4d42cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4d42cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 335abdb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_4d42cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4d42cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4d42cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 335abdb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_4d42cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4d42cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4d42cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.glsl
deleted file mode 100644
index a303a97..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_4d42cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_4d42cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.msl
deleted file mode 100644
index b77d856..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4d42cf(texture2d<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_4d42cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4d42cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4d42cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.spvasm
deleted file mode 100644
index b8e96d0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4d42cf "textureDimensions_4d42cf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4d42cf = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.wgsl
deleted file mode 100644
index 4185202..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4d42cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_4d42cf() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4d42cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4d42cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4d42cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl
deleted file mode 100644
index fc79c53..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> i32
-fn textureDimensions_4df9a8() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4df9a8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4df9a8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4df9a8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8541c75..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_4df9a8() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4df9a8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4df9a8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8541c75..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_4df9a8() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4df9a8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4df9a8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.glsl
deleted file mode 100644
index 7871ed7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_4df9a8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_4df9a8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.msl
deleted file mode 100644
index 54723cb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4df9a8(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_4df9a8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4df9a8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4df9a8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.spvasm
deleted file mode 100644
index c4be2a7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4df9a8 "textureDimensions_4df9a8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4df9a8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.wgsl
deleted file mode 100644
index b771310..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/4df9a8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32uint, write>;
-
-fn textureDimensions_4df9a8() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4df9a8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4df9a8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4df9a8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl
deleted file mode 100644
index b47834c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_50a9ee() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_50a9ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_50a9ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_50a9ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7cbe97a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_50a9ee() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_50a9ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_50a9ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7cbe97a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_50a9ee() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_50a9ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_50a9ee();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.glsl
deleted file mode 100644
index a02b6e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_50a9ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_50a9ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.msl
deleted file mode 100644
index 1f00f52..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_50a9ee(texturecube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_50a9ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_50a9ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_50a9ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.spvasm
deleted file mode 100644
index 33f320b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_50a9ee "textureDimensions_50a9ee"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_50a9ee = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.wgsl
deleted file mode 100644
index 4af6ec4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/50a9ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_50a9ee() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_50a9ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_50a9ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_50a9ee();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl
deleted file mode 100644
index 0431113..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>, level: i32) -> i32
-fn textureDimensions_52045c() {
- var res: i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_52045c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_52045c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_52045c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9be1cdc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_52045c() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_52045c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_52045c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_52045c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9be1cdc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_52045c() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_52045c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_52045c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_52045c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.glsl
deleted file mode 100644
index f4c5ca9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_52045c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_52045c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_52045c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.msl
deleted file mode 100644
index ec08120..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_52045c(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_52045c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_52045c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_52045c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.spvasm
deleted file mode 100644
index c5033522..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_52045c "textureDimensions_52045c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_52045c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %18 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_52045c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_52045c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_52045c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.wgsl
deleted file mode 100644
index 6bef70a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/52045c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_52045c() {
- var res : i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_52045c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_52045c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_52045c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl
new file mode 100644
index 0000000..d40875d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_528c0e() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_528c0e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_528c0e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_528c0e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bd33bb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_528c0e() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_528c0e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_528c0e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bd33bb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_528c0e() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_528c0e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_528c0e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl
new file mode 100644
index 0000000..830b87d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_528c0e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_528c0e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl
new file mode 100644
index 0000000..d09c8c4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_528c0e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_528c0e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_528c0e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm
new file mode 100644
index 0000000..bceb8a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_528c0e "textureDimensions_528c0e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_528c0e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl
new file mode 100644
index 0000000..504ea2f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/528c0e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_528c0e() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_528c0e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_528c0e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_528c0e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl
deleted file mode 100644
index 617f0df..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_5331e0() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5331e0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5331e0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5331e0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 970329b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_5331e0() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5331e0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5331e0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 970329b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_5331e0() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5331e0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5331e0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.glsl
deleted file mode 100644
index 9d7c5ef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_5331e0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_5331e0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.msl
deleted file mode 100644
index 70ffada..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5331e0(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_5331e0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5331e0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5331e0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.spvasm
deleted file mode 100644
index be5f6cd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5331e0 "textureDimensions_5331e0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5331e0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.wgsl
deleted file mode 100644
index 2f4c8ac..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5331e0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_5331e0() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5331e0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5331e0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5331e0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl
deleted file mode 100644
index a7efa73..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> i32
-fn textureDimensions_55b23e() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_55b23e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_55b23e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_55b23e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c3634a3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_55b23e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_55b23e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_55b23e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c3634a3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_55b23e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_55b23e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_55b23e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.glsl
deleted file mode 100644
index a9465b8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_55b23e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_55b23e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.msl
deleted file mode 100644
index 0778752..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_55b23e(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_55b23e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_55b23e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_55b23e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.spvasm
deleted file mode 100644
index e6470a9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_55b23e "textureDimensions_55b23e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_55b23e = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.wgsl
deleted file mode 100644
index 430da3c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/55b23e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32float, write>;
-
-fn textureDimensions_55b23e() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_55b23e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_55b23e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_55b23e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl
deleted file mode 100644
index 111e70b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<i32>
-fn textureDimensions_579629() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_579629();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_579629();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_579629();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 297d5dd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_579629() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_579629();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_579629();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_579629();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 297d5dd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_579629() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_579629();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_579629();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_579629();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.glsl
deleted file mode 100644
index d1ca2e7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_579629();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_579629();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_579629();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.msl
deleted file mode 100644
index d6c497b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_579629(texture2d_ms<uint, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
- textureDimensions_579629(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_579629(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_579629(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.spvasm
deleted file mode 100644
index 5d35bf9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_579629 "textureDimensions_579629"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_579629 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_579629
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_579629
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_579629
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.wgsl
deleted file mode 100644
index 1e1d6d7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/579629.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
-
-fn textureDimensions_579629() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_579629();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_579629();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_579629();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl
deleted file mode 100644
index f56dbbd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> i32
-fn textureDimensions_57da0b() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57da0b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57da0b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57da0b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f9df5ef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_57da0b() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57da0b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57da0b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f9df5ef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_57da0b() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57da0b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57da0b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.glsl
deleted file mode 100644
index c45ed2f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_57da0b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_57da0b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.msl
deleted file mode 100644
index fb1c232..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_57da0b(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_57da0b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_57da0b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_57da0b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.spvasm
deleted file mode 100644
index 9d0c96d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_57da0b "textureDimensions_57da0b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_57da0b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.wgsl
deleted file mode 100644
index b599184..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57da0b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32uint, write>;
-
-fn textureDimensions_57da0b() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57da0b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57da0b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57da0b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl
deleted file mode 100644
index 9da6a8a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube) -> vec2<i32>
-fn textureDimensions_57e28f() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57e28f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57e28f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57e28f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8da8d7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_57e28f() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57e28f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57e28f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8da8d7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_57e28f() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57e28f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57e28f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.glsl
deleted file mode 100644
index c8713a2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_57e28f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_57e28f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.msl
deleted file mode 100644
index c089020..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_57e28f(depthcube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_57e28f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_57e28f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_57e28f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.spvasm
deleted file mode 100644
index 9dd34bf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_57e28f "textureDimensions_57e28f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_57e28f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.wgsl
deleted file mode 100644
index e0b854e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/57e28f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_57e28f() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57e28f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57e28f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57e28f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl
deleted file mode 100644
index ac97548..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<i32>
-fn textureDimensions_58a515() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_58a515();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_58a515();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_58a515();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e8a7b4b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_58a515() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_58a515();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_58a515();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e8a7b4b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_58a515() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_58a515();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_58a515();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.glsl
deleted file mode 100644
index b67bb0f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_58a515();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_58a515();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.msl
deleted file mode 100644
index c8d90cd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_58a515(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_58a515(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_58a515(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_58a515(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.spvasm
deleted file mode 100644
index 5afc929..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_58a515 "textureDimensions_58a515"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_58a515 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_58a515
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_58a515
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_58a515
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.wgsl
deleted file mode 100644
index 21bad72..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/58a515.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
-
-fn textureDimensions_58a515() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_58a515();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_58a515();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_58a515();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl
new file mode 100644
index 0000000..e3e1557
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> u32
+fn textureDimensions_58a82d() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_58a82d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_58a82d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_58a82d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..80b2c98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_58a82d() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_58a82d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_58a82d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..80b2c98
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_58a82d() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_58a82d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_58a82d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl
new file mode 100644
index 0000000..2fcd82e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_58a82d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_58a82d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl
new file mode 100644
index 0000000..34b38cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_58a82d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_58a82d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_58a82d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc519c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_58a82d "textureDimensions_58a82d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_58a82d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl
new file mode 100644
index 0000000..f61f64b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/58a82d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16uint, write>;
+
+fn textureDimensions_58a82d() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_58a82d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_58a82d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_58a82d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl
new file mode 100644
index 0000000..062e5ad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<u32>
+fn textureDimensions_591981() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_591981();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_591981();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_591981();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4f3144c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_591981() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_591981();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_591981();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4f3144c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_591981() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_591981();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_591981();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl
new file mode 100644
index 0000000..03a38d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_591981();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_591981();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl
new file mode 100644
index 0000000..b80abf1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_591981(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_591981(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_591981(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm
new file mode 100644
index 0000000..f66c1ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_591981 "textureDimensions_591981"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_591981 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_591981
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_591981
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_591981
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f1b90b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/591981.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16sint, write>;
+
+fn textureDimensions_591981() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_591981();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_591981();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_591981();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl
deleted file mode 100644
index 52d9859..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<i32>
-fn textureDimensions_5985f3() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5985f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5985f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5985f3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 488cb17..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_5985f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5985f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5985f3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 488cb17..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_5985f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5985f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5985f3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.glsl
deleted file mode 100644
index 4c33a17..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_5985f3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_5985f3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.msl
deleted file mode 100644
index 90f407d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5985f3(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_5985f3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5985f3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5985f3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.spvasm
deleted file mode 100644
index f51c50b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5985f3 "textureDimensions_5985f3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5985f3 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.wgsl
deleted file mode 100644
index 8449517..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5985f3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
-
-fn textureDimensions_5985f3() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5985f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5985f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5985f3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl
new file mode 100644
index 0000000..25708ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<u32>
+fn textureDimensions_599ab5() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_599ab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_599ab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_599ab5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..161321e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_599ab5() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_599ab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_599ab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..161321e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_599ab5() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_599ab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_599ab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl
new file mode 100644
index 0000000..e4e61d5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_599ab5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_599ab5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl
new file mode 100644
index 0000000..9d36a4b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_599ab5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_599ab5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_599ab5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6a2e7c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_599ab5 "textureDimensions_599ab5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_599ab5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl
new file mode 100644
index 0000000..0607926
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/599ab5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16float, write>;
+
+fn textureDimensions_599ab5() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_599ab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_599ab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_599ab5();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl
deleted file mode 100644
index 8de30ac..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> i32
-fn textureDimensions_5caa5e() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5caa5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5caa5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5caa5e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 066fbdf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5caa5e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5caa5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5caa5e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 066fbdf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5caa5e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5caa5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5caa5e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.glsl
deleted file mode 100644
index d02caf1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_5caa5e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_5caa5e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.msl
deleted file mode 100644
index 56e5f71..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5caa5e(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_5caa5e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5caa5e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5caa5e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.spvasm
deleted file mode 100644
index 68ec968..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5caa5e "textureDimensions_5caa5e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5caa5e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.wgsl
deleted file mode 100644
index ac87720..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5caa5e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32uint, write>;
-
-fn textureDimensions_5caa5e() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5caa5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5caa5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5caa5e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl
new file mode 100644
index 0000000..b89ffbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>) -> u32
+fn textureDimensions_5df042() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_5df042();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_5df042();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_5df042();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..25b206a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_5df042() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_5df042();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5df042();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..25b206a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_5df042() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_5df042();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5df042();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl
new file mode 100644
index 0000000..c8e4d65
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_5df042();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_5df042();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl
new file mode 100644
index 0000000..c3d1fc2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_5df042(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_5df042(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_5df042(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm
new file mode 100644
index 0000000..7205a05
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5df042 "textureDimensions_5df042"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_5df042 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl
new file mode 100644
index 0000000..8e083a2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/5df042.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_5df042() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_5df042();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_5df042();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_5df042();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl
deleted file mode 100644
index 6e8e71e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<i32>
-fn textureDimensions_5e295d() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5e295d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5e295d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5e295d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a88725c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5e295d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5e295d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5e295d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a88725c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5e295d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5e295d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5e295d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.glsl
deleted file mode 100644
index f079eb8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_5e295d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_5e295d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.msl
deleted file mode 100644
index 50d3988..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5e295d(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_5e295d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5e295d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5e295d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.spvasm
deleted file mode 100644
index 05297b0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5e295d "textureDimensions_5e295d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5e295d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.wgsl
deleted file mode 100644
index ae8f763..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/5e295d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
-
-fn textureDimensions_5e295d() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5e295d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5e295d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5e295d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl
new file mode 100644
index 0000000..f03cde1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> u32
+fn textureDimensions_607979() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_607979();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_607979();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_607979();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8fbf889
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_607979() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_607979();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_607979();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8fbf889
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_607979() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_607979();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_607979();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl
new file mode 100644
index 0000000..5b5a4c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_607979();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_607979();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl
new file mode 100644
index 0000000..360b5a3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_607979(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_607979(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_607979(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm
new file mode 100644
index 0000000..d8c6402
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_607979 "textureDimensions_607979"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_607979 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_607979
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_607979
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_607979
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl
new file mode 100644
index 0000000..d54a65b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/607979.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32sint, write>;
+
+fn textureDimensions_607979() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_607979();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_607979();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_607979();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl
deleted file mode 100644
index 36982d8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<i32>
-fn textureDimensions_60bf54() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_60bf54();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_60bf54();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_60bf54();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d7ac1d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_60bf54() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_60bf54();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_60bf54();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d7ac1d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_60bf54() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_60bf54();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_60bf54();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.glsl
deleted file mode 100644
index 91d0815..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_60bf54();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_60bf54();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.msl
deleted file mode 100644
index bf597c3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_60bf54(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_60bf54(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_60bf54(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_60bf54(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.spvasm
deleted file mode 100644
index 5073da1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_60bf54 "textureDimensions_60bf54"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_60bf54 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.wgsl
deleted file mode 100644
index fbc7cd7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/60bf54.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32sint, write>;
-
-fn textureDimensions_60bf54() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_60bf54();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_60bf54();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_60bf54();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl
new file mode 100644
index 0000000..7d34ccd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<u32>
+fn textureDimensions_62cb5a() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_62cb5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_62cb5a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9ce8aa4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_62cb5a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_62cb5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_62cb5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9ce8aa4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_62cb5a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_62cb5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_62cb5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl
new file mode 100644
index 0000000..421af5e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_62cb5a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_62cb5a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl
new file mode 100644
index 0000000..8702a25
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_62cb5a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_62cb5a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_62cb5a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..622c055
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_62cb5a "textureDimensions_62cb5a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_62cb5a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_0
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..4fd56a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/62cb5a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_62cb5a() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_62cb5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_62cb5a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl
deleted file mode 100644
index deb1125..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<i32>
-fn textureDimensions_63f3cf() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_63f3cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_63f3cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_63f3cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f03906d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_63f3cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_63f3cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_63f3cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f03906d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_63f3cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_63f3cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_63f3cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.glsl
deleted file mode 100644
index 6a77ea9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_63f3cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_63f3cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.msl
deleted file mode 100644
index 931b457..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_63f3cf(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_63f3cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_63f3cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_63f3cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.spvasm
deleted file mode 100644
index f146e10..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_63f3cf "textureDimensions_63f3cf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_63f3cf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.wgsl
deleted file mode 100644
index 3e0ebfd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/63f3cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32float, write>;
-
-fn textureDimensions_63f3cf() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_63f3cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_63f3cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_63f3cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl
deleted file mode 100644
index 427c713..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube, level: u32) -> vec2<i32>
-fn textureDimensions_647386() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_647386();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_647386();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_647386();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 940a060..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_647386() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_647386();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_647386();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_647386();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 940a060..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_647386() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_647386();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_647386();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_647386();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.glsl
deleted file mode 100644
index 7e35c07..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_647386();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_647386();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_647386();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.msl
deleted file mode 100644
index 03d3ff9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_647386(depthcube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_647386(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_647386(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_647386(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.spvasm
deleted file mode 100644
index 2411956..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_647386 "textureDimensions_647386"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_647386 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_647386
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_647386
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_647386
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.wgsl
deleted file mode 100644
index 6339c96..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/647386.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_647386() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_647386();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_647386();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_647386();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl
new file mode 100644
index 0000000..2204379
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_64dc74() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_64dc74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_64dc74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_64dc74();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9be06d2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_64dc74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_64dc74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_64dc74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9be06d2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_64dc74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_64dc74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_64dc74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl
new file mode 100644
index 0000000..7408687
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_64dc74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_64dc74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl
new file mode 100644
index 0000000..5fa3713
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_64dc74(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_64dc74(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_64dc74(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm
new file mode 100644
index 0000000..6caad5e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_64dc74 "textureDimensions_64dc74"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_64dc74 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl
new file mode 100644
index 0000000..745bc42
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/64dc74.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_64dc74() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_64dc74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_64dc74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_64dc74();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl
new file mode 100644
index 0000000..5e964b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<u32>
+fn textureDimensions_674058() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_674058();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_674058();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_674058();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9369bd2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_674058() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_674058();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_674058();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9369bd2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_674058() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_674058();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_674058();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl
new file mode 100644
index 0000000..7e3dc84
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_674058();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_674058();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl
new file mode 100644
index 0000000..6c86158
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_674058(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_674058(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_674058(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm
new file mode 100644
index 0000000..b312fbf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_674058 "textureDimensions_674058"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_674058 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_674058
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_674058
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_674058
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl
new file mode 100644
index 0000000..207af65
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/674058.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureDimensions_674058() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_674058();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_674058();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_674058();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl
deleted file mode 100644
index 6a41cfe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<i32>
-fn textureDimensions_68105c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_68105c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_68105c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_68105c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c372328..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_68105c() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_68105c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_68105c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_68105c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c372328..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_68105c() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_68105c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_68105c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_68105c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.glsl
deleted file mode 100644
index d366071..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_68105c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_68105c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_68105c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.msl
deleted file mode 100644
index a1fdb63..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_68105c(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_68105c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_68105c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_68105c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.spvasm
deleted file mode 100644
index 471b570..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_68105c "textureDimensions_68105c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_68105c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_68105c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_68105c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_68105c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.wgsl
deleted file mode 100644
index 19c4929..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/68105c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32uint, write>;
-
-fn textureDimensions_68105c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_68105c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_68105c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_68105c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl
deleted file mode 100644
index 615c164..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_686ef2() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_686ef2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_686ef2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_686ef2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f8759b6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_686ef2() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_686ef2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_686ef2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f8759b6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_686ef2() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_686ef2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_686ef2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.glsl
deleted file mode 100644
index 6d89fce..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_686ef2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_686ef2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.msl
deleted file mode 100644
index bffb431..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_686ef2(texturecube<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_686ef2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_686ef2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_686ef2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.spvasm
deleted file mode 100644
index 93b1f24..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_686ef2 "textureDimensions_686ef2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_686ef2 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.wgsl
deleted file mode 100644
index 5aec21a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/686ef2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_686ef2() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_686ef2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_686ef2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_686ef2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl
deleted file mode 100644
index d2d4a11..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> i32
-fn textureDimensions_6adac6() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6adac6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6adac6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6adac6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 52b2080..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_6adac6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6adac6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6adac6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 52b2080..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_6adac6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6adac6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6adac6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.glsl
deleted file mode 100644
index acaaa5a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_6adac6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_6adac6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.msl
deleted file mode 100644
index 7087625..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6adac6(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_6adac6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6adac6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6adac6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.spvasm
deleted file mode 100644
index 363af60..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6adac6 "textureDimensions_6adac6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6adac6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.wgsl
deleted file mode 100644
index 8ab67f0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6adac6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32sint, write>;
-
-fn textureDimensions_6adac6() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6adac6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6adac6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6adac6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl
new file mode 100644
index 0000000..2b66f08
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>, level: u32) -> vec3<u32>
+fn textureDimensions_6e6c7a() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6e6c7a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6e6c7a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..774a29c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_6e6c7a() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6e6c7a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..774a29c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_6e6c7a() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6e6c7a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl
new file mode 100644
index 0000000..410e633
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_6e6c7a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_6e6c7a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl
new file mode 100644
index 0000000..a27b937
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_6e6c7a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_6e6c7a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_6e6c7a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm
new file mode 100644
index 0000000..c52215e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6e6c7a "textureDimensions_6e6c7a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_6e6c7a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %19 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl
new file mode 100644
index 0000000..1e91b8f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6e6c7a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_6e6c7a() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6e6c7a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6e6c7a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl
deleted file mode 100644
index ea06df4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_6eae7f() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6eae7f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6eae7f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6eae7f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 2fb9257..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_6eae7f() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6eae7f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6eae7f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 2fb9257..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_6eae7f() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6eae7f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6eae7f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.glsl
deleted file mode 100644
index 6758f41..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_6eae7f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_6eae7f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.msl
deleted file mode 100644
index 28bbf37..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6eae7f(texturecube<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_6eae7f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6eae7f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6eae7f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.spvasm
deleted file mode 100644
index a51782d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6eae7f "textureDimensions_6eae7f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6eae7f = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.wgsl
deleted file mode 100644
index 0415add..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6eae7f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_6eae7f() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6eae7f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6eae7f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6eae7f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl
deleted file mode 100644
index ef7fe5d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>) -> vec3<i32>
-fn textureDimensions_6ec1b4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6ec1b4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6ec1b4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6e9cb1f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_6ec1b4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6ec1b4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6ec1b4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6e9cb1f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_6ec1b4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6ec1b4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6ec1b4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.glsl
deleted file mode 100644
index 482455d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_6ec1b4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_6ec1b4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.msl
deleted file mode 100644
index 52a3369..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6ec1b4(texture3d<uint, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_6ec1b4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6ec1b4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6ec1b4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.spvasm
deleted file mode 100644
index 4f8be17..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6ec1b4 "textureDimensions_6ec1b4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6ec1b4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.wgsl
deleted file mode 100644
index 7573c55..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6ec1b4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_6ec1b4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6ec1b4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6ec1b4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl
deleted file mode 100644
index 2e0eb57..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<i32>
-fn textureDimensions_6f0d79() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6f0d79();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6f0d79();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6f0d79();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cd1a3a4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_6f0d79() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6f0d79();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6f0d79();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cd1a3a4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_6f0d79() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6f0d79();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6f0d79();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.glsl
deleted file mode 100644
index 71893cb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_6f0d79();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_6f0d79();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.msl
deleted file mode 100644
index 5154f6c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6f0d79(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_6f0d79(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6f0d79(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6f0d79(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.spvasm
deleted file mode 100644
index f1032b6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6f0d79 "textureDimensions_6f0d79"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6f0d79 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.wgsl
deleted file mode 100644
index b055eea..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/6f0d79.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
-
-fn textureDimensions_6f0d79() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6f0d79();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6f0d79();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6f0d79();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl
new file mode 100644
index 0000000..2743674
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2<u32>
+fn textureDimensions_6f1b5d() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6f1b5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6f1b5d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2cd49f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_6f1b5d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6f1b5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2cd49f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_6f1b5d() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6f1b5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl
new file mode 100644
index 0000000..26e95ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_6f1b5d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_6f1b5d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl
new file mode 100644
index 0000000..b30d32d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_6f1b5d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_6f1b5d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_6f1b5d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm
new file mode 100644
index 0000000..bd7a5ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6f1b5d "textureDimensions_6f1b5d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_6f1b5d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl
new file mode 100644
index 0000000..78394ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/6f1b5d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_6f1b5d() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6f1b5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6f1b5d();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl
deleted file mode 100644
index 99afe61..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<i32>
-fn textureDimensions_702c53() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_702c53();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_702c53();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_702c53();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 40c27c8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_702c53() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_702c53();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_702c53();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_702c53();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 40c27c8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_702c53() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_702c53();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_702c53();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_702c53();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.glsl
deleted file mode 100644
index e4f0c34..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_702c53();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_702c53();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_702c53();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.msl
deleted file mode 100644
index d202631..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_702c53(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_702c53(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_702c53(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_702c53(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.spvasm
deleted file mode 100644
index 514d19f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_702c53 "textureDimensions_702c53"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_702c53 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_702c53
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_702c53
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_702c53
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.wgsl
deleted file mode 100644
index 093625d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/702c53.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8unorm, write>;
-
-fn textureDimensions_702c53() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_702c53();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_702c53();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_702c53();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl
deleted file mode 100644
index 0d093ec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>, level: u32) -> vec3<i32>
-fn textureDimensions_71b9f4() {
- var res: vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_71b9f4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_71b9f4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_71b9f4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index df1d04e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_71b9f4() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_71b9f4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_71b9f4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index df1d04e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_71b9f4() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_71b9f4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_71b9f4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.glsl
deleted file mode 100644
index d43d997..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_71b9f4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_71b9f4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.msl
deleted file mode 100644
index 2815e84..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_71b9f4(texture3d<int, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_71b9f4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_71b9f4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_71b9f4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.spvasm
deleted file mode 100644
index 4d1cb17..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_71b9f4 "textureDimensions_71b9f4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_71b9f4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %19 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.wgsl
deleted file mode 100644
index 8a0ff1b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/71b9f4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_71b9f4() {
- var res : vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_71b9f4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_71b9f4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_71b9f4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl
new file mode 100644
index 0000000..48176cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> u32
+fn textureDimensions_7228de() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7228de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7228de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7228de();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..79216e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_7228de() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7228de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7228de();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..79216e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_7228de() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7228de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7228de();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl
new file mode 100644
index 0000000..d148823
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7228de();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_7228de();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl
new file mode 100644
index 0000000..d5d9363
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_7228de(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7228de(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7228de(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm
new file mode 100644
index 0000000..defd7fb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7228de "textureDimensions_7228de"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7228de = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl
new file mode 100644
index 0000000..6f791d8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7228de.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32uint, write>;
+
+fn textureDimensions_7228de() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7228de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7228de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7228de();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl
deleted file mode 100644
index c1fe807..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2<i32>
-fn textureDimensions_72e5d6() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_72e5d6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_72e5d6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_72e5d6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6c9f386..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_72e5d6() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_72e5d6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_72e5d6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6c9f386..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_72e5d6() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_72e5d6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_72e5d6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.glsl
deleted file mode 100644
index 4b1ae18..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_72e5d6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void compute_main() {
- textureDimensions_72e5d6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.msl
deleted file mode 100644
index 27cd0a3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_72e5d6(depth2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_72e5d6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_72e5d6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_72e5d6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.spvasm
deleted file mode 100644
index b2bb907..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_72e5d6 "textureDimensions_72e5d6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_72e5d6 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.wgsl
deleted file mode 100644
index 1c3a6a5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/72e5d6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_72e5d6() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_72e5d6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_72e5d6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_72e5d6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl
new file mode 100644
index 0000000..921966e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>, level: i32) -> vec3<u32>
+fn textureDimensions_756031() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756031();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756031();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756031();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..28f6ccd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_756031() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756031();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756031();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..28f6ccd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_756031() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756031();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756031();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl
new file mode 100644
index 0000000..a30d806
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_756031();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_756031();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl
new file mode 100644
index 0000000..15a7d51
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_756031(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_756031(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_756031(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm
new file mode 100644
index 0000000..b675dfa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_756031 "textureDimensions_756031"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_756031 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %20 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_756031
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_756031
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_756031
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl
new file mode 100644
index 0000000..478da6d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756031.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_756031() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756031();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756031();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756031();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl
new file mode 100644
index 0000000..d06fb96
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<u32>
+fn textureDimensions_756304() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756304();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756304();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756304();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..70b5dc9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_756304() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756304();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756304();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..70b5dc9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_756304() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756304();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756304();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl
new file mode 100644
index 0000000..a1d9085
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_756304();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_756304();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl
new file mode 100644
index 0000000..21be296f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_756304(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_756304(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_756304(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c2eeb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_756304 "textureDimensions_756304"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_756304 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_756304
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_756304
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_756304
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl
new file mode 100644
index 0000000..16fcc5c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/756304.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureDimensions_756304() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756304();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756304();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756304();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl
new file mode 100644
index 0000000..ca43d3c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2<u32>
+fn textureDimensions_79d168() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_79d168();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_79d168();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_79d168();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..864fb0a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_79d168() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_79d168();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_79d168();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..864fb0a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_79d168() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_79d168();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_79d168();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl
new file mode 100644
index 0000000..31f86e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_79d168();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_79d168();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl
new file mode 100644
index 0000000..80c59c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_79d168(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_79d168(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_79d168(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm
new file mode 100644
index 0000000..7cc8c06
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_79d168 "textureDimensions_79d168"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_79d168 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl
new file mode 100644
index 0000000..1400b0f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/79d168.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_79d168() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_79d168();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_79d168();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_79d168();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl
deleted file mode 100644
index 0f5e74f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>, level: i32) -> i32
-fn textureDimensions_79df87() {
- var res: i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_79df87();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_79df87();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_79df87();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0280f10..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_79df87() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_79df87();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_79df87();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_79df87();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0280f10..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_79df87() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_79df87();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_79df87();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_79df87();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.glsl
deleted file mode 100644
index b7ee7fd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_79df87();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_79df87();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_79df87();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.msl
deleted file mode 100644
index 92eebe2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_79df87(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_79df87(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_79df87(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_79df87(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.spvasm
deleted file mode 100644
index 1ed0972..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_79df87 "textureDimensions_79df87"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_79df87 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %19 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_79df87
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_79df87
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_79df87
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.wgsl
deleted file mode 100644
index 00b9b88..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/79df87.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_79df87() {
- var res : i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_79df87();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_79df87();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_79df87();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl
new file mode 100644
index 0000000..30e8a51
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>) -> vec3<u32>
+fn textureDimensions_7a3890() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a3890();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a3890();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a3890();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3a01cb7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a3890() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a3890();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a3890();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3a01cb7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a3890() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a3890();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a3890();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl
new file mode 100644
index 0000000..533a4f8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7a3890();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_7a3890();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl
new file mode 100644
index 0000000..3118213
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_7a3890(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7a3890(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7a3890(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm
new file mode 100644
index 0000000..43921a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7a3890 "textureDimensions_7a3890"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7a3890 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl
new file mode 100644
index 0000000..82213cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a3890.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_7a3890() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a3890();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a3890();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a3890();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl
new file mode 100644
index 0000000..9d1f0b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>) -> vec2<u32>
+fn textureDimensions_7a9e30() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a9e30();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a9e30();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..12d975c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a9e30() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a9e30();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a9e30();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..12d975c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a9e30() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a9e30();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a9e30();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl
new file mode 100644
index 0000000..c7e9efa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7a9e30();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_7a9e30();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl
new file mode 100644
index 0000000..4456cad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_7a9e30(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7a9e30(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7a9e30(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm
new file mode 100644
index 0000000..b036bf4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7a9e30 "textureDimensions_7a9e30"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7a9e30 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd784d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/7a9e30.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_7a9e30() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a9e30();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a9e30();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl
deleted file mode 100644
index 8245cc2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array) -> vec2<i32>
-fn textureDimensions_7bf826() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7bf826();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7bf826();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7bf826();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9c0e675..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_7bf826() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7bf826();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7bf826();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9c0e675..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_7bf826() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7bf826();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7bf826();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.glsl
deleted file mode 100644
index 9859cdd9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_7bf826();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_7bf826();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.msl
deleted file mode 100644
index 59cd373..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7bf826(depth2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_7bf826(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7bf826(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7bf826(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.spvasm
deleted file mode 100644
index 2229e18..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7bf826 "textureDimensions_7bf826"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7bf826 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.wgsl
deleted file mode 100644
index 4953ba3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7bf826.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_7bf826() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7bf826();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7bf826();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7bf826();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl
deleted file mode 100644
index 182b849..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_7c8821() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7c8821();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7c8821();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7c8821();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.dxc.hlsl
deleted file mode 100644
index efa39ce..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_7c8821() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7c8821();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7c8821();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.fxc.hlsl
deleted file mode 100644
index efa39ce..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_7c8821() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7c8821();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7c8821();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.glsl
deleted file mode 100644
index fa19d29..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_7c8821();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_7c8821();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.msl
deleted file mode 100644
index dd07d8b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7c8821(texture2d_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_7c8821(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7c8821(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7c8821(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.spvasm
deleted file mode 100644
index af64de4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7c8821 "textureDimensions_7c8821"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7c8821 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.wgsl
deleted file mode 100644
index 4156043..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7c8821.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_7c8821() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7c8821();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7c8821();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7c8821();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl
deleted file mode 100644
index 87caa44..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<i32>
-fn textureDimensions_7f5c2e() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7f5c2e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7f5c2e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9c6abe3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_7f5c2e() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7f5c2e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7f5c2e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9c6abe3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_7f5c2e() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7f5c2e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7f5c2e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.glsl
deleted file mode 100644
index ed85e7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_7f5c2e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_7f5c2e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.msl
deleted file mode 100644
index f853ebc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7f5c2e(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_7f5c2e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7f5c2e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7f5c2e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.spvasm
deleted file mode 100644
index 5a25cc1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7f5c2e "textureDimensions_7f5c2e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7f5c2e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.wgsl
deleted file mode 100644
index 85bbc4b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/7f5c2e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32sint, write>;
-
-fn textureDimensions_7f5c2e() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7f5c2e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7f5c2e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl
deleted file mode 100644
index 99c4483..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<i32>
-fn textureDimensions_8028f3() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8028f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8028f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8028f3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f18db34..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8028f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8028f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8028f3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f18db34..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8028f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8028f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8028f3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.glsl
deleted file mode 100644
index 4ac9ac9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8028f3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_8028f3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.msl
deleted file mode 100644
index efc7793..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8028f3(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_8028f3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8028f3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8028f3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.spvasm
deleted file mode 100644
index 814b999..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8028f3 "textureDimensions_8028f3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8028f3 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.wgsl
deleted file mode 100644
index fbc1979..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8028f3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32float, write>;
-
-fn textureDimensions_8028f3() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8028f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8028f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8028f3();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl
deleted file mode 100644
index 630debe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<i32>
-fn textureDimensions_811679() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_811679();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_811679();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_811679();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a474cba..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_811679() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_811679();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_811679();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_811679();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a474cba..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_811679() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_811679();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_811679();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_811679();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.glsl
deleted file mode 100644
index 152d367..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_811679();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_811679();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_811679();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.msl
deleted file mode 100644
index 825c3ad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_811679(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_811679(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_811679(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_811679(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.spvasm
deleted file mode 100644
index c051822..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_811679 "textureDimensions_811679"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_811679 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_811679
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_811679
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_811679
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.wgsl
deleted file mode 100644
index 494c1da..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/811679.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32uint, write>;
-
-fn textureDimensions_811679() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_811679();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_811679();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_811679();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl
deleted file mode 100644
index 793ab47..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<i32>
-fn textureDimensions_820596() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_820596();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_820596();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_820596();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.dxc.hlsl
deleted file mode 100644
index af2f262..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_820596() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_820596();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_820596();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_820596();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.fxc.hlsl
deleted file mode 100644
index af2f262..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_820596() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_820596();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_820596();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_820596();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.glsl
deleted file mode 100644
index 12ee4ec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_820596();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_820596();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_820596();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.msl
deleted file mode 100644
index 1ecf8c9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_820596(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_820596(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_820596(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_820596(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.spvasm
deleted file mode 100644
index a657294..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_820596 "textureDimensions_820596"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_820596 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_820596
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_820596
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_820596
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.wgsl
deleted file mode 100644
index dc1379f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/820596.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32uint, write>;
-
-fn textureDimensions_820596() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_820596();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_820596();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_820596();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl
deleted file mode 100644
index d0a3eab..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<i32>
-fn textureDimensions_83ee5a() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_83ee5a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_83ee5a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_83ee5a();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl
deleted file mode 100644
index efa903a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_83ee5a() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_83ee5a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_83ee5a();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl
deleted file mode 100644
index efa903a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_83ee5a() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_83ee5a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_83ee5a();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.glsl
deleted file mode 100644
index 1f6ce58..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_83ee5a();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_83ee5a();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.msl
deleted file mode 100644
index 29cff8f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_83ee5a(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_83ee5a(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_83ee5a(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_83ee5a(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.spvasm
deleted file mode 100644
index 32e7431..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_83ee5a "textureDimensions_83ee5a"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_83ee5a = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.wgsl
deleted file mode 100644
index 0d0d5ea..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/83ee5a.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32sint, write>;
-
-fn textureDimensions_83ee5a() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_83ee5a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_83ee5a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_83ee5a();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl
deleted file mode 100644
index 743861f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_85d556() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_85d556();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_85d556();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_85d556();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 12e1ea9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_85d556() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_85d556();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_85d556();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 12e1ea9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_85d556() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_85d556();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_85d556();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.glsl
deleted file mode 100644
index ef072ce..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_85d556();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void compute_main() {
- textureDimensions_85d556();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.msl
deleted file mode 100644
index 27556e1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_85d556(texture2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_85d556(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_85d556(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_85d556(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.spvasm
deleted file mode 100644
index 9244329..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_85d556 "textureDimensions_85d556"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_85d556 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_85d556
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_85d556
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_85d556
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.wgsl
deleted file mode 100644
index da6d3cc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/85d556.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_85d556() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_85d556();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_85d556();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_85d556();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl
new file mode 100644
index 0000000..2a6540f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<u32>
+fn textureDimensions_867ead() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_867ead();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_867ead();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_867ead();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c3db085
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_867ead() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_867ead();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_867ead();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c3db085
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_867ead() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_867ead();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_867ead();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl
new file mode 100644
index 0000000..ed270a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_867ead();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_867ead();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl
new file mode 100644
index 0000000..7985b52
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_867ead(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_867ead(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_867ead(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0dac2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_867ead "textureDimensions_867ead"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_867ead = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl
new file mode 100644
index 0000000..50f701a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/867ead.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureDimensions_867ead() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_867ead();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_867ead();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_867ead();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl
new file mode 100644
index 0000000..c3f7003
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<u32>
+fn textureDimensions_879b73() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_879b73();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_879b73();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_879b73();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8e2f821
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_879b73() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_879b73();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_879b73();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8e2f821
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_879b73() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_879b73();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_879b73();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl
new file mode 100644
index 0000000..fe9a84b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_879b73();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_879b73();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl
new file mode 100644
index 0000000..f452786
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_879b73(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_879b73(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_879b73(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5199b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_879b73 "textureDimensions_879b73"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_879b73 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl
new file mode 100644
index 0000000..6078916
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/879b73.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_879b73() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_879b73();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_879b73();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_879b73();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl
deleted file mode 100644
index b272374..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_88ad17() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_88ad17();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_88ad17();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_88ad17();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b45fa1f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_88ad17() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_88ad17();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_88ad17();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b45fa1f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_88ad17() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_88ad17();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_88ad17();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.glsl
deleted file mode 100644
index 0568f54..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_88ad17();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_88ad17();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.msl
deleted file mode 100644
index dbad45f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_88ad17(texturecube<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_88ad17(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_88ad17(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_88ad17(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.spvasm
deleted file mode 100644
index cb822f6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_88ad17 "textureDimensions_88ad17"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_88ad17 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.wgsl
deleted file mode 100644
index 397b27c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/88ad17.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_88ad17() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_88ad17();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_88ad17();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_88ad17();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl
new file mode 100644
index 0000000..349d4aa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<u32>
+fn textureDimensions_8a35f9() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8a35f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8a35f9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cb72f96
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8a35f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8a35f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8a35f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cb72f96
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8a35f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8a35f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8a35f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl
new file mode 100644
index 0000000..2da1261
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_8a35f9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_8a35f9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl
new file mode 100644
index 0000000..f3c2d7c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_8a35f9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_8a35f9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_8a35f9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3a454b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8a35f9 "textureDimensions_8a35f9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8a35f9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl
new file mode 100644
index 0000000..04585f3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8a35f9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32float, write>;
+
+fn textureDimensions_8a35f9() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8a35f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8a35f9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl
deleted file mode 100644
index 4a9ac37..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>) -> vec3<i32>
-fn textureDimensions_8aa4c4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8aa4c4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8aa4c4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e8a2fa1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8aa4c4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8aa4c4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8aa4c4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e8a2fa1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8aa4c4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8aa4c4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8aa4c4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.glsl
deleted file mode 100644
index 45495e9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8aa4c4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_8aa4c4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.msl
deleted file mode 100644
index 77f5715..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8aa4c4(texture3d<float, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_8aa4c4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8aa4c4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8aa4c4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.spvasm
deleted file mode 100644
index 4b2376f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8aa4c4 "textureDimensions_8aa4c4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8aa4c4 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v3int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.wgsl
deleted file mode 100644
index 840105b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8aa4c4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_8aa4c4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8aa4c4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8aa4c4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl
deleted file mode 100644
index 2142832..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_8d87ed() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8d87ed();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8d87ed();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8d87ed();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e554d37..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_8d87ed() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8d87ed();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8d87ed();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e554d37..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_8d87ed() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8d87ed();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8d87ed();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.glsl
deleted file mode 100644
index 19bfcef..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_8d87ed();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_8d87ed();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.msl
deleted file mode 100644
index da5758b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8d87ed(texturecube<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_8d87ed(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8d87ed(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8d87ed(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.spvasm
deleted file mode 100644
index 2bf40fc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8d87ed "textureDimensions_8d87ed"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8d87ed = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.wgsl
deleted file mode 100644
index 6a88207..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8d87ed.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_8d87ed() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8d87ed();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8d87ed();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8d87ed();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl
deleted file mode 100644
index 9ecc26f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>) -> vec3<i32>
-fn textureDimensions_8deb5e() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8deb5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8deb5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8deb5e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 398823e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_8deb5e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8deb5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8deb5e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 398823e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_8deb5e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8deb5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8deb5e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.glsl
deleted file mode 100644
index 8869c19..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8deb5e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_8deb5e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.msl
deleted file mode 100644
index 7899845..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8deb5e(texture3d<int, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_8deb5e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8deb5e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8deb5e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.spvasm
deleted file mode 100644
index 7afdac3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8deb5e "textureDimensions_8deb5e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8deb5e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.wgsl
deleted file mode 100644
index c3e10c7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8deb5e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_8deb5e() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8deb5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8deb5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8deb5e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl
new file mode 100644
index 0000000..e4931ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> u32
+fn textureDimensions_8efd47() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8efd47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8efd47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8efd47();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0ec2359
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_8efd47() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8efd47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8efd47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0ec2359
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_8efd47() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8efd47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8efd47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl
new file mode 100644
index 0000000..ae3365d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_8efd47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_8efd47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl
new file mode 100644
index 0000000..1aa9fa8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_8efd47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_8efd47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_8efd47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb6145d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8efd47 "textureDimensions_8efd47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8efd47 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl
new file mode 100644
index 0000000..791a3af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/8efd47.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32sint, write>;
+
+fn textureDimensions_8efd47() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8efd47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8efd47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8efd47();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl
deleted file mode 100644
index f5e7f3a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<i32>
-fn textureDimensions_8f20bf() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8f20bf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8f20bf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8f20bf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 58462cf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8f20bf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8f20bf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8f20bf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 58462cf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8f20bf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8f20bf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8f20bf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.glsl
deleted file mode 100644
index a01eead..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_8f20bf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_8f20bf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.msl
deleted file mode 100644
index 431a454..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8f20bf(texturecube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_8f20bf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8f20bf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8f20bf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.spvasm
deleted file mode 100644
index 952b3d4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8f20bf "textureDimensions_8f20bf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8f20bf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.wgsl
deleted file mode 100644
index 2d3dcb0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8f20bf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_8f20bf() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8f20bf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8f20bf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8f20bf();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl
deleted file mode 100644
index 9492de6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<i32>
-fn textureDimensions_8fca0f() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8fca0f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8fca0f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8fca0f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ace86e0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8fca0f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8fca0f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8fca0f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ace86e0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8fca0f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8fca0f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8fca0f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.glsl
deleted file mode 100644
index 255924a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8fca0f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_8fca0f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.msl
deleted file mode 100644
index f104902..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8fca0f(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_8fca0f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8fca0f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8fca0f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.spvasm
deleted file mode 100644
index 0f3281e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8fca0f "textureDimensions_8fca0f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8fca0f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.wgsl
deleted file mode 100644
index 6ef7d1b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/8fca0f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32float, write>;
-
-fn textureDimensions_8fca0f() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8fca0f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8fca0f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8fca0f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl
new file mode 100644
index 0000000..3a8b15e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<u32>
+fn textureDimensions_902179() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_902179();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_902179();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_902179();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c84269
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_902179() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_902179();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_902179();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c84269
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_902179() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_902179();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_902179();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl
new file mode 100644
index 0000000..24eeebf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_902179();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_902179();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl
new file mode 100644
index 0000000..ff7f11b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_902179(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_902179(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_902179(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm
new file mode 100644
index 0000000..cdb6d12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_902179 "textureDimensions_902179"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_902179 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_902179
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_902179
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_902179
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl
new file mode 100644
index 0000000..81da1cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/902179.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32float, write>;
+
+fn textureDimensions_902179() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_902179();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_902179();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_902179();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl
deleted file mode 100644
index 86f40ed..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array) -> vec2<i32>
-fn textureDimensions_90340b() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_90340b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_90340b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_90340b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 26df72f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_90340b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_90340b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_90340b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 26df72f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_90340b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_90340b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_90340b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.glsl
deleted file mode 100644
index 09d10eb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_90340b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_90340b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.msl
deleted file mode 100644
index f585531..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_90340b(depthcube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_90340b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_90340b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_90340b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.spvasm
deleted file mode 100644
index 5d4d7e7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_90340b "textureDimensions_90340b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_90340b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_90340b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_90340b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_90340b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.wgsl
deleted file mode 100644
index c70e0d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/90340b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_90340b() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_90340b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_90340b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_90340b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl
deleted file mode 100644
index 1f6eb1c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<i32>
-fn textureDimensions_9042ab() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9042ab();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9042ab();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9042ab();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 95dc105..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9042ab() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9042ab();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9042ab();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 95dc105..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9042ab() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9042ab();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9042ab();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.glsl
deleted file mode 100644
index 1fb6520..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9042ab();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_9042ab();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.msl
deleted file mode 100644
index 5f29287..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9042ab(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_9042ab(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9042ab(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9042ab(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.spvasm
deleted file mode 100644
index d0099a0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9042ab "textureDimensions_9042ab"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9042ab = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.wgsl
deleted file mode 100644
index 1602fd8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9042ab.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
-
-fn textureDimensions_9042ab() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9042ab();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9042ab();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9042ab();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl
new file mode 100644
index 0000000..fde73cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<u32>
+fn textureDimensions_90dd74() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_90dd74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_90dd74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_90dd74();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6e10196
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_90dd74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_90dd74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_90dd74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6e10196
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_90dd74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_90dd74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_90dd74();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl
new file mode 100644
index 0000000..4e0747d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_90dd74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_90dd74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl
new file mode 100644
index 0000000..8439e12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_90dd74(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_90dd74(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_90dd74(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm
new file mode 100644
index 0000000..0fe6302
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_90dd74 "textureDimensions_90dd74"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_90dd74 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl
new file mode 100644
index 0000000..d5471c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/90dd74.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureDimensions_90dd74() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_90dd74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_90dd74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_90dd74();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl
new file mode 100644
index 0000000..b303bac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>, level: i32) -> u32
+fn textureDimensions_920006() {
+ var res: u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_920006();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_920006();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_920006();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0260041
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_920006() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_920006();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_920006();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0260041
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_920006() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_920006();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_920006();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl
new file mode 100644
index 0000000..ea1406c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_920006();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_920006();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl
new file mode 100644
index 0000000..e3fd99f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_920006(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_920006(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_920006(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm
new file mode 100644
index 0000000..b98b0f6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_920006 "textureDimensions_920006"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_920006 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %18 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_920006
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_920006
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_920006
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl
new file mode 100644
index 0000000..b709469
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/920006.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_920006() {
+ var res : u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_920006();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_920006();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_920006();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl
new file mode 100644
index 0000000..d4677e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> u32
+fn textureDimensions_92552e() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_92552e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_92552e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_92552e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6afab39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_92552e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_92552e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_92552e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6afab39
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_92552e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_92552e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_92552e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl
new file mode 100644
index 0000000..aea8be7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_92552e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_92552e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl
new file mode 100644
index 0000000..b291fc2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_92552e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_92552e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_92552e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm
new file mode 100644
index 0000000..900be97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_92552e "textureDimensions_92552e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_92552e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d970314
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/92552e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8sint, write>;
+
+fn textureDimensions_92552e() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_92552e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_92552e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_92552e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl
deleted file mode 100644
index 085e363..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2<i32>
-fn textureDimensions_9393b0() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9393b0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9393b0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9393b0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b4da577..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_9393b0() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9393b0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9393b0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b4da577..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_9393b0() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9393b0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9393b0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.glsl
deleted file mode 100644
index 117faa8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_9393b0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_9393b0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.msl
deleted file mode 100644
index 1c7d028..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9393b0(depthcube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_9393b0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9393b0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9393b0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.spvasm
deleted file mode 100644
index b4fb55c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9393b0 "textureDimensions_9393b0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9393b0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.wgsl
deleted file mode 100644
index 602dc3a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9393b0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_9393b0() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9393b0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9393b0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9393b0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl
deleted file mode 100644
index 6914338..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d) -> vec2<i32>
-fn textureDimensions_939fdb() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_939fdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_939fdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_939fdb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1edab80..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_939fdb() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_939fdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_939fdb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1edab80..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_939fdb() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_939fdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_939fdb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.glsl
deleted file mode 100644
index 380941e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_939fdb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_939fdb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.msl
deleted file mode 100644
index a6283fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_939fdb(depth2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_939fdb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_939fdb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_939fdb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.spvasm
deleted file mode 100644
index 7e41c36..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_939fdb "textureDimensions_939fdb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_939fdb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.wgsl
deleted file mode 100644
index eda2bcb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/939fdb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_939fdb() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_939fdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_939fdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_939fdb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl
deleted file mode 100644
index bb326a9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d, level: u32) -> vec2<i32>
-fn textureDimensions_941d6e() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_941d6e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_941d6e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_941d6e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d1de2e5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_941d6e() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_941d6e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_941d6e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d1de2e5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_941d6e() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_941d6e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_941d6e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.glsl
deleted file mode 100644
index 5a05fed..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_941d6e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_941d6e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.msl
deleted file mode 100644
index efb87fe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_941d6e(depth2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_941d6e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_941d6e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_941d6e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.spvasm
deleted file mode 100644
index 0ed6d4a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_941d6e "textureDimensions_941d6e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_941d6e = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.wgsl
deleted file mode 100644
index 5fd586e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/941d6e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_941d6e() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_941d6e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_941d6e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_941d6e();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl
new file mode 100644
index 0000000..917ddec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<u32>
+fn textureDimensions_9573f3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9573f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9573f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9573f3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4d8998d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9573f3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9573f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9573f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4d8998d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9573f3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9573f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9573f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl
new file mode 100644
index 0000000..fa06ee3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9573f3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_9573f3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl
new file mode 100644
index 0000000..f0fa2a7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_9573f3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9573f3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9573f3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1f6cc3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9573f3 "textureDimensions_9573f3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9573f3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..de5167b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9573f3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32uint, write>;
+
+fn textureDimensions_9573f3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9573f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9573f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9573f3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl
deleted file mode 100644
index 48a77d1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_95b2db() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_95b2db();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_95b2db();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_95b2db();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f550adc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_95b2db() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_95b2db();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_95b2db();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f550adc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_95b2db() {
- int3 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_95b2db();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_95b2db();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.glsl
deleted file mode 100644
index 645a437..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_95b2db();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- ivec2 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_95b2db();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.msl
deleted file mode 100644
index b6cabc6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_95b2db(texturecube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_95b2db(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_95b2db(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_95b2db(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.spvasm
deleted file mode 100644
index 0f784cb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_95b2db "textureDimensions_95b2db"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_95b2db = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.wgsl
deleted file mode 100644
index 928eafb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/95b2db.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_95b2db() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_95b2db();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_95b2db();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_95b2db();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl
deleted file mode 100644
index af253df..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>) -> vec2<i32>
-fn textureDimensions_962dcd() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_962dcd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_962dcd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_962dcd();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7f1c1eb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_962dcd() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_962dcd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_962dcd();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7f1c1eb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_962dcd() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_962dcd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_962dcd();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.glsl
deleted file mode 100644
index ded4e42..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_962dcd();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_962dcd();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.msl
deleted file mode 100644
index 052154f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_962dcd(texturecube<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_962dcd(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_962dcd(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_962dcd(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.spvasm
deleted file mode 100644
index ceac95f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_962dcd "textureDimensions_962dcd"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_962dcd = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.wgsl
deleted file mode 100644
index bd3ca7a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/962dcd.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_962dcd() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_962dcd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_962dcd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_962dcd();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl
new file mode 100644
index 0000000..a09022b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>) -> u32
+fn textureDimensions_965645() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_965645();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_965645();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_965645();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..285b9f8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_965645() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_965645();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_965645();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..285b9f8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_965645() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_965645();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_965645();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl
new file mode 100644
index 0000000..1aaef12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_965645();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_965645();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl
new file mode 100644
index 0000000..6d38430
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_965645(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_965645(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_965645(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e8f9a4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_965645 "textureDimensions_965645"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_965645 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %18 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_965645
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_965645
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_965645
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl
new file mode 100644
index 0000000..45ddf97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/965645.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_965645() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_965645();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_965645();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_965645();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl
new file mode 100644
index 0000000..0f82afb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<u32>
+fn textureDimensions_98b2d3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_98b2d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_98b2d3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..70d774f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_98b2d3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_98b2d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_98b2d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..70d774f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_98b2d3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_98b2d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_98b2d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl
new file mode 100644
index 0000000..7b14e6c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_98b2d3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_98b2d3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl
new file mode 100644
index 0000000..dc4a496
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_98b2d3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_98b2d3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_98b2d3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm
new file mode 100644
index 0000000..d511aaa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_98b2d3 "textureDimensions_98b2d3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_98b2d3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_0
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl
new file mode 100644
index 0000000..8609f45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/98b2d3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_98b2d3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_98b2d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_98b2d3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl
new file mode 100644
index 0000000..aa05e7b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d, level: u32) -> vec2<u32>
+fn textureDimensions_991ea9() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_991ea9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_991ea9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_991ea9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..76b6996
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_991ea9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_991ea9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_991ea9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..76b6996
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_991ea9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_991ea9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_991ea9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl
new file mode 100644
index 0000000..c100c91
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_991ea9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_991ea9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl
new file mode 100644
index 0000000..7da42db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_991ea9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_991ea9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_991ea9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm
new file mode 100644
index 0000000..a82a839
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_991ea9 "textureDimensions_991ea9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_991ea9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl
new file mode 100644
index 0000000..d54d29a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/991ea9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_991ea9() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_991ea9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_991ea9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_991ea9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl
deleted file mode 100644
index de90222..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<i32>
-fn textureDimensions_9abfe5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9abfe5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9abfe5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9abfe5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d97dcf7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_9abfe5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9abfe5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9abfe5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d97dcf7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_9abfe5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9abfe5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9abfe5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.glsl
deleted file mode 100644
index 0de8c91..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9abfe5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_9abfe5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.msl
deleted file mode 100644
index cc19962..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9abfe5(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_9abfe5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9abfe5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9abfe5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.spvasm
deleted file mode 100644
index 6a733e8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9abfe5 "textureDimensions_9abfe5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9abfe5 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.wgsl
deleted file mode 100644
index 5845daa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9abfe5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
-
-fn textureDimensions_9abfe5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9abfe5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9abfe5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9abfe5();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl
new file mode 100644
index 0000000..25108ad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>) -> vec2<u32>
+fn textureDimensions_9b223b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9b223b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9b223b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9b223b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..50846b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9b223b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9b223b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9b223b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..50846b9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9b223b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9b223b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9b223b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl
new file mode 100644
index 0000000..c748051
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9b223b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_9b223b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl
new file mode 100644
index 0000000..ce95387
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_9b223b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9b223b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9b223b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm
new file mode 100644
index 0000000..b7a28e0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9b223b "textureDimensions_9b223b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9b223b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl
new file mode 100644
index 0000000..72fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9b223b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_9b223b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9b223b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9b223b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9b223b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl
new file mode 100644
index 0000000..66c6751
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_9baf27() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9baf27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9baf27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9baf27();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c70561
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9baf27() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9baf27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9baf27();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c70561
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9baf27() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9baf27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9baf27();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl
new file mode 100644
index 0000000..08ce12a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9baf27();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_9baf27();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl
new file mode 100644
index 0000000..188376e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9baf27(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9baf27(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9baf27(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm
new file mode 100644
index 0000000..230931d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9baf27 "textureDimensions_9baf27"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9baf27 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a4141f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9baf27.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_9baf27() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9baf27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9baf27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9baf27();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl
new file mode 100644
index 0000000..bc5e36a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>, level: u32) -> u32
+fn textureDimensions_9c7a00() {
+ var res: u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9c7a00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9c7a00();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d1c1db0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9c7a00() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9c7a00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9c7a00();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d1c1db0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9c7a00() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9c7a00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9c7a00();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl
new file mode 100644
index 0000000..c645494
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9c7a00();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_9c7a00();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl
new file mode 100644
index 0000000..6e193d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9c7a00(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9c7a00(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9c7a00(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5bfdaa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9c7a00 "textureDimensions_9c7a00"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9c7a00 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %18 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl
new file mode 100644
index 0000000..22c9233
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9c7a00.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_9c7a00() {
+ var res : u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9c7a00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9c7a00();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl
deleted file mode 100644
index de82341..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_9c9c57() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9c9c57();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9c9c57();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9c9c57();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ee0579e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_9c9c57() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9c9c57();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9c9c57();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ee0579e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_9c9c57() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9c9c57();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9c9c57();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.glsl
deleted file mode 100644
index e6d8ac5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9c9c57();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- ivec2 res = textureSize(arg_0_1, 1).xy;
-}
-
-void compute_main() {
- textureDimensions_9c9c57();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.msl
deleted file mode 100644
index 567ad0e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9c9c57(texture2d_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_9c9c57(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9c9c57(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9c9c57(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.spvasm
deleted file mode 100644
index f311607..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9c9c57 "textureDimensions_9c9c57"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9c9c57 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.wgsl
deleted file mode 100644
index cf98bb1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9c9c57.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_9c9c57() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9c9c57();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9c9c57();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9c9c57();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl
new file mode 100644
index 0000000..35d5bbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_9cd4ca() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd4ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd4ca();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bae851e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9cd4ca() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd4ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bae851e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9cd4ca() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd4ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl
new file mode 100644
index 0000000..b6be761
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9cd4ca();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_9cd4ca();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl
new file mode 100644
index 0000000..3181b6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9cd4ca(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9cd4ca(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9cd4ca(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm
new file mode 100644
index 0000000..0dba168
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9cd4ca "textureDimensions_9cd4ca"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9cd4ca = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5297df
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd4ca.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_9cd4ca() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd4ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd4ca();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl
new file mode 100644
index 0000000..309ffe2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<u32>
+fn textureDimensions_9cd8ad() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd8ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd8ad();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..15a1e11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_9cd8ad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd8ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..15a1e11
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_9cd8ad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd8ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl
new file mode 100644
index 0000000..abddd70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9cd8ad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_9cd8ad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl
new file mode 100644
index 0000000..23fcbf6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_9cd8ad(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9cd8ad(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9cd8ad(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..0155eb4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9cd8ad "textureDimensions_9cd8ad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9cd8ad = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..7ac9caf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9cd8ad.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32float, write>;
+
+fn textureDimensions_9cd8ad() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd8ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd8ad();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl
deleted file mode 100644
index bd2527e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> i32
-fn textureDimensions_9da9e2() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9da9e2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9da9e2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9da9e2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f500491b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_9da9e2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9da9e2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9da9e2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f500491b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_9da9e2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9da9e2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9da9e2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.glsl
deleted file mode 100644
index 5773b40..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9da9e2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_9da9e2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.msl
deleted file mode 100644
index ea085fa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9da9e2(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_9da9e2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9da9e2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9da9e2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.spvasm
deleted file mode 100644
index edaecfe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9da9e2 "textureDimensions_9da9e2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9da9e2 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.wgsl
deleted file mode 100644
index 73cfaf1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9da9e2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8sint, write>;
-
-fn textureDimensions_9da9e2() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9da9e2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9da9e2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9da9e2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl
new file mode 100644
index 0000000..ebef3e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_9e0794() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9e0794();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9e0794();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9e0794();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5de37e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9e0794() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9e0794();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9e0794();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5de37e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9e0794() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9e0794();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9e0794();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl
new file mode 100644
index 0000000..784f8be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_9e0794();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_9e0794();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl
new file mode 100644
index 0000000..1afc85d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9e0794(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9e0794(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9e0794(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm
new file mode 100644
index 0000000..13de1c1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9e0794 "textureDimensions_9e0794"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9e0794 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl
new file mode 100644
index 0000000..1de4efe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9e0794.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_9e0794() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9e0794();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9e0794();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9e0794();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl
deleted file mode 100644
index c1f41d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<i32>
-fn textureDimensions_9eb8d8() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9eb8d8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9eb8d8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cf18843..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9eb8d8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9eb8d8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9eb8d8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cf18843..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9eb8d8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9eb8d8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9eb8d8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.glsl
deleted file mode 100644
index 6185ef1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9eb8d8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_9eb8d8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.msl
deleted file mode 100644
index 140c2af..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9eb8d8(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_9eb8d8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9eb8d8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9eb8d8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.spvasm
deleted file mode 100644
index b450c7b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9eb8d8 "textureDimensions_9eb8d8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9eb8d8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.wgsl
deleted file mode 100644
index fc40eab..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9eb8d8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32uint, write>;
-
-fn textureDimensions_9eb8d8() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9eb8d8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9eb8d8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl
deleted file mode 100644
index 2234617..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>) -> vec2<i32>
-fn textureDimensions_9f8e46() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9f8e46();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9f8e46();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9f8e46();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 384fdc3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_9f8e46() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9f8e46();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9f8e46();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 384fdc3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_9f8e46() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9f8e46();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9f8e46();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.glsl
deleted file mode 100644
index a292ec4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9f8e46();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_9f8e46();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.msl
deleted file mode 100644
index b7097a2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9f8e46(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_9f8e46(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9f8e46(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9f8e46(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.spvasm
deleted file mode 100644
index 9fabd6e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9f8e46 "textureDimensions_9f8e46"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9f8e46 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.wgsl
deleted file mode 100644
index 3d3ef83..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/9f8e46.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_9f8e46() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9f8e46();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9f8e46();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9f8e46();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl
new file mode 100644
index 0000000..9f69ac6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
+fn textureDimensions_9fcc3b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9fcc3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9fcc3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5252d8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_9fcc3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9fcc3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5252d8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_9fcc3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9fcc3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl
new file mode 100644
index 0000000..ff61b88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_9fcc3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_9fcc3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl
new file mode 100644
index 0000000..ddabf3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_9fcc3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9fcc3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9fcc3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a57305e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9fcc3b "textureDimensions_9fcc3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9fcc3b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..14dbcf2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/9fcc3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_9fcc3b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9fcc3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9fcc3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl
deleted file mode 100644
index b37bbba..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2<i32>
-fn textureDimensions_a01845() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a01845();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a01845();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a01845();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 34d5eea..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_a01845() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a01845();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a01845();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 34d5eea..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_a01845() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a01845();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a01845();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.glsl
deleted file mode 100644
index 5be0e3e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_a01845();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_a01845();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.msl
deleted file mode 100644
index 02c2125..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a01845(depthcube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_a01845(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a01845(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a01845(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.spvasm
deleted file mode 100644
index 2c61784..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a01845 "textureDimensions_a01845"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a01845 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_a01845
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_a01845
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_a01845
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.wgsl
deleted file mode 100644
index f5e348b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a01845.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_a01845() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a01845();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a01845();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a01845();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl
new file mode 100644
index 0000000..76171f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<u32>
+fn textureDimensions_a1598a() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a1598a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a1598a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a1598a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ed94e77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_a1598a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a1598a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a1598a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ed94e77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_a1598a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a1598a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a1598a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl
new file mode 100644
index 0000000..010039d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_a1598a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_a1598a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl
new file mode 100644
index 0000000..f8e8256
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_a1598a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a1598a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a1598a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm
new file mode 100644
index 0000000..a28204c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a1598a "textureDimensions_a1598a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a1598a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6f7047
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a1598a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_a1598a() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a1598a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a1598a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a1598a();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl
new file mode 100644
index 0000000..618688c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_a2ba5e() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a2ba5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a2ba5e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..05e2e02
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a2ba5e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a2ba5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..05e2e02
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a2ba5e() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a2ba5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl
new file mode 100644
index 0000000..f398ada
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_a2ba5e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_a2ba5e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl
new file mode 100644
index 0000000..2cc988d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_a2ba5e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a2ba5e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a2ba5e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..a6ffae2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a2ba5e "textureDimensions_a2ba5e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a2ba5e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..49e2b88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a2ba5e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_a2ba5e() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a2ba5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a2ba5e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl
new file mode 100644
index 0000000..42075ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_a48049() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a48049();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a48049();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a48049();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ccfed60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a48049() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a48049();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a48049();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ccfed60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a48049() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a48049();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a48049();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl
new file mode 100644
index 0000000..f77b8da
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_a48049();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_a48049();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl
new file mode 100644
index 0000000..46202c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_a48049(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a48049(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a48049(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm
new file mode 100644
index 0000000..089a9ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a48049 "textureDimensions_a48049"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a48049 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl
new file mode 100644
index 0000000..077ac17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a48049.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_a48049() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a48049();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a48049();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a48049();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl
new file mode 100644
index 0000000..5628cd5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
+fn textureDimensions_a4cd56() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a4cd56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a4cd56();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f8f2b16
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_a4cd56() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a4cd56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a4cd56();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f8f2b16
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_a4cd56() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a4cd56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a4cd56();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl
new file mode 100644
index 0000000..759cda6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_a4cd56();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_a4cd56();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl
new file mode 100644
index 0000000..9022f6d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_a4cd56(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a4cd56(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a4cd56(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm
new file mode 100644
index 0000000..d7caf97
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a4cd56 "textureDimensions_a4cd56"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a4cd56 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl
new file mode 100644
index 0000000..50f2c77
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/a4cd56.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_a4cd56() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a4cd56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a4cd56();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl
deleted file mode 100644
index c2d1409..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>) -> i32
-fn textureDimensions_a7d565() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a7d565();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a7d565();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a7d565();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 949e8b1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_a7d565() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a7d565();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a7d565();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 949e8b1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_a7d565() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a7d565();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a7d565();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.glsl
deleted file mode 100644
index 24152c7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_a7d565();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_a7d565();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.msl
deleted file mode 100644
index aef8670..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a7d565(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_a7d565(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a7d565(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a7d565(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.spvasm
deleted file mode 100644
index 1694f88..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a7d565 "textureDimensions_a7d565"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a7d565 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.wgsl
deleted file mode 100644
index 76183ec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a7d565.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_a7d565() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a7d565();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a7d565();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a7d565();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl
deleted file mode 100644
index 4dbf2ed..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> i32
-fn textureDimensions_a863f2() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a863f2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a863f2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a863f2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 212bbca..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_a863f2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a863f2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a863f2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 212bbca..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_a863f2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a863f2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a863f2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.glsl
deleted file mode 100644
index b157dd9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_a863f2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_a863f2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.msl
deleted file mode 100644
index 583342b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a863f2(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_a863f2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a863f2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a863f2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.spvasm
deleted file mode 100644
index 9e5a66a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a863f2 "textureDimensions_a863f2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a863f2 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.wgsl
deleted file mode 100644
index d3e7e38..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a863f2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32float, write>;
-
-fn textureDimensions_a863f2() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a863f2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a863f2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a863f2();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl
deleted file mode 100644
index c139f4a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_a9c9c1() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a9c9c1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a9c9c1();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b749a19..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_a9c9c1() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a9c9c1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a9c9c1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b749a19..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_a9c9c1() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a9c9c1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a9c9c1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.glsl
deleted file mode 100644
index 735d7fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_a9c9c1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_a9c9c1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.msl
deleted file mode 100644
index 710d8f5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a9c9c1(texturecube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_a9c9c1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a9c9c1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a9c9c1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.spvasm
deleted file mode 100644
index a443bc0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a9c9c1 "textureDimensions_a9c9c1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a9c9c1 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.wgsl
deleted file mode 100644
index ab9848b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/a9c9c1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_a9c9c1() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a9c9c1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a9c9c1();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl
new file mode 100644
index 0000000..8b47484
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<u32>
+fn textureDimensions_aa4353() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aa4353();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aa4353();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aa4353();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3d24ddb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_aa4353() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aa4353();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aa4353();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3d24ddb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_aa4353() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aa4353();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aa4353();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl
new file mode 100644
index 0000000..4a25902
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_aa4353();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_aa4353();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl
new file mode 100644
index 0000000..7845df7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_aa4353(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_aa4353(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_aa4353(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a9900d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_aa4353 "textureDimensions_aa4353"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_aa4353 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl
new file mode 100644
index 0000000..7aa80e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aa4353.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32sint, write>;
+
+fn textureDimensions_aa4353() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aa4353();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aa4353();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aa4353();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl
new file mode 100644
index 0000000..981d7ca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>, level: u32) -> u32
+fn textureDimensions_aac604() {
+ var res: u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aac604();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aac604();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aac604();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4bd5d9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_aac604() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aac604();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aac604();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4bd5d9d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_aac604() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aac604();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aac604();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl
new file mode 100644
index 0000000..05ccce8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_aac604();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint res = uint(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_aac604();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl
new file mode 100644
index 0000000..6e94f2d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_aac604(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_aac604(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_aac604(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm
new file mode 100644
index 0000000..3e60083
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_aac604 "textureDimensions_aac604"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_aac604 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %uint %18 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl
new file mode 100644
index 0000000..cb19c1c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/aac604.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_aac604() {
+ var res : u32 = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aac604();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aac604();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aac604();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl
new file mode 100644
index 0000000..39b6f4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> u32
+fn textureDimensions_ad7d3b() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ad7d3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ad7d3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c052ebe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ad7d3b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ad7d3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c052ebe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ad7d3b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ad7d3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl
new file mode 100644
index 0000000..37dc452
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ad7d3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ad7d3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl
new file mode 100644
index 0000000..5ebfda2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_ad7d3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ad7d3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ad7d3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..f349ad4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ad7d3b "textureDimensions_ad7d3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ad7d3b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..f3d84ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ad7d3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8uint, write>;
+
+fn textureDimensions_ad7d3b() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ad7d3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ad7d3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl
new file mode 100644
index 0000000..ab3e076
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<u32>
+fn textureDimensions_af46ab() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_af46ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_af46ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_af46ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7b91231
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_af46ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_af46ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_af46ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7b91231
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_af46ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_af46ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_af46ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl
new file mode 100644
index 0000000..858e3b6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_af46ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_af46ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl
new file mode 100644
index 0000000..bea9ef2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_af46ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_af46ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_af46ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..fa916ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_af46ab "textureDimensions_af46ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_af46ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..33b86af
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/af46ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureDimensions_af46ab() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_af46ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_af46ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_af46ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl
deleted file mode 100644
index 4dbd457..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_b0e16d() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b0e16d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b0e16d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b0e16d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bb60d49..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_b0e16d() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b0e16d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b0e16d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bb60d49..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_b0e16d() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b0e16d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b0e16d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.glsl
deleted file mode 100644
index 44fcf0c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_b0e16d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_b0e16d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.msl
deleted file mode 100644
index 7f6dbc8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b0e16d(texture2d<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_b0e16d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b0e16d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b0e16d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.spvasm
deleted file mode 100644
index 438adfe..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b0e16d "textureDimensions_b0e16d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b0e16d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.wgsl
deleted file mode 100644
index b45ed44..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b0e16d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_b0e16d() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b0e16d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b0e16d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b0e16d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl
new file mode 100644
index 0000000..a7b36f4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_b3ab5e() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b3ab5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b3ab5e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..66e0fd5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_b3ab5e() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b3ab5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..66e0fd5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_b3ab5e() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b3ab5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl
new file mode 100644
index 0000000..0e8b1c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_b3ab5e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_b3ab5e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl
new file mode 100644
index 0000000..02aa62f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_b3ab5e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b3ab5e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b3ab5e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..0fd15b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b3ab5e "textureDimensions_b3ab5e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b3ab5e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..1869fbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b3ab5e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_b3ab5e() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b3ab5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b3ab5e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl
deleted file mode 100644
index 36a593a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>) -> vec2<i32>
-fn textureDimensions_b3c954() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3c954();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3c954();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3c954();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f0d031d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3c954() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3c954();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3c954();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f0d031d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3c954() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3c954();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3c954();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.glsl
deleted file mode 100644
index 855349f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_b3c954();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_b3c954();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.msl
deleted file mode 100644
index 33fc09a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b3c954(texturecube<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_b3c954(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b3c954(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b3c954(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.spvasm
deleted file mode 100644
index f8a392c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b3c954 "textureDimensions_b3c954"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b3c954 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.wgsl
deleted file mode 100644
index 8c36407..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3c954.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_b3c954() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3c954();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3c954();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3c954();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl
deleted file mode 100644
index 8bd0846..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>, level: i32) -> i32
-fn textureDimensions_b3e407() {
- var res: i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3e407();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3e407();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3e407();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cf433ad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3e407() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3e407();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3e407();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cf433ad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3e407() {
- int2 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3e407();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3e407();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.glsl
deleted file mode 100644
index 438d8fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_b3e407();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_b3e407();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.msl
deleted file mode 100644
index 86bd509..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b3e407(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_b3e407(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b3e407(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b3e407(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.spvasm
deleted file mode 100644
index 7878aab..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b3e407 "textureDimensions_b3e407"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b3e407 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %int %18 %int_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.wgsl
deleted file mode 100644
index 872385a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b3e407.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_b3e407() {
- var res : i32 = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3e407();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3e407();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3e407();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl
new file mode 100644
index 0000000..6f1c9aa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>, level: i32) -> u32
+fn textureDimensions_b46d97() {
+ var res: u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b46d97();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b46d97();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b46d97();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a9e0aee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_b46d97() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b46d97();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b46d97();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a9e0aee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_b46d97() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b46d97();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b46d97();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl
new file mode 100644
index 0000000..9b283fe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_b46d97();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_b46d97();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl
new file mode 100644
index 0000000..d13508c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_b46d97(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b46d97(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b46d97(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm
new file mode 100644
index 0000000..474bb46
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b46d97 "textureDimensions_b46d97"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int_1 = OpConstant %int 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b46d97 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %19 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl
new file mode 100644
index 0000000..696cbe9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b46d97.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_b46d97() {
+ var res : u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b46d97();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b46d97();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b46d97();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl
new file mode 100644
index 0000000..705df0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> u32
+fn textureDimensions_b51345() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b51345();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b51345();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b51345();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..83abb62
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_b51345() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b51345();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b51345();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..83abb62
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_b51345() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b51345();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b51345();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl
new file mode 100644
index 0000000..058e7ca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_b51345();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_b51345();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl
new file mode 100644
index 0000000..d1ee550
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_b51345(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b51345(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b51345(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm
new file mode 100644
index 0000000..ba366c8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b51345 "textureDimensions_b51345"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b51345 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl
new file mode 100644
index 0000000..4da1873
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/b51345.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32float, write>;
+
+fn textureDimensions_b51345() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b51345();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b51345();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b51345();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl
deleted file mode 100644
index 65a63e4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<i32>
-fn textureDimensions_b91240() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b91240();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b91240();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b91240();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7f3c930..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_b91240() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b91240();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b91240();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b91240();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7f3c930..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_b91240() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b91240();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b91240();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b91240();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.glsl
deleted file mode 100644
index 3976de3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_b91240();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_b91240();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_b91240();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.msl
deleted file mode 100644
index ee84ff1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b91240(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_b91240(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b91240(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b91240(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.spvasm
deleted file mode 100644
index a0757e4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b91240 "textureDimensions_b91240"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b91240 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_b91240
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_b91240
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_b91240
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.wgsl
deleted file mode 100644
index 7c88173..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/b91240.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8snorm, write>;
-
-fn textureDimensions_b91240() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b91240();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b91240();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b91240();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl
deleted file mode 100644
index e48c478..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_external;
-
-// fn textureDimensions(texture: texture_external) -> vec2<i32>
-fn textureDimensions_ba1481() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ba1481();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ba1481();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ba1481();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1761c01..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,38 +0,0 @@
-Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
-cbuffer cbuffer_ext_tex_params : register(b2, space1) {
- uint4 ext_tex_params[11];
-};
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ba1481() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ba1481();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ba1481();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1761c01..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,38 +0,0 @@
-Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
-cbuffer cbuffer_ext_tex_params : register(b2, space1) {
- uint4 ext_tex_params[11];
-};
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ba1481() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ba1481();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ba1481();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.glsl
deleted file mode 100644
index 7bb878e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.glsl
+++ /dev/null
@@ -1,112 +0,0 @@
-#version 310 es
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_ba1481();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_ba1481();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.msl
deleted file mode 100644
index f659868..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.msl
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-struct ExternalTextureParams {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- float3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- float3x3 gamutConversionMatrix;
-};
-
-void textureDimensions_ba1481(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_ba1481(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_ba1481(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_ba1481(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.spvasm
deleted file mode 100644
index a7eb76b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.spvasm
+++ /dev/null
@@ -1,127 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 47
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %ext_tex_plane_1 "ext_tex_plane_1"
- OpName %ExternalTextureParams "ExternalTextureParams"
- OpMemberName %ExternalTextureParams 0 "numPlanes"
- OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
- OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
- OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
- OpName %GammaTransferParams "GammaTransferParams"
- OpMemberName %GammaTransferParams 0 "G"
- OpMemberName %GammaTransferParams 1 "A"
- OpMemberName %GammaTransferParams 2 "B"
- OpMemberName %GammaTransferParams 3 "C"
- OpMemberName %GammaTransferParams 4 "D"
- OpMemberName %GammaTransferParams 5 "E"
- OpMemberName %GammaTransferParams 6 "F"
- OpMemberName %GammaTransferParams 7 "padding"
- OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
- OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpName %ext_tex_params "ext_tex_params"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_ba1481 "textureDimensions_ba1481"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %ext_tex_plane_1 DescriptorSet 1
- OpDecorate %ext_tex_plane_1 Binding 1
- OpDecorate %ExternalTextureParams Block
- OpMemberDecorate %ExternalTextureParams 0 Offset 0
- OpMemberDecorate %ExternalTextureParams 1 Offset 4
- OpMemberDecorate %ExternalTextureParams 2 Offset 16
- OpMemberDecorate %ExternalTextureParams 2 ColMajor
- OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
- OpMemberDecorate %ExternalTextureParams 3 Offset 64
- OpMemberDecorate %GammaTransferParams 0 Offset 0
- OpMemberDecorate %GammaTransferParams 1 Offset 4
- OpMemberDecorate %GammaTransferParams 2 Offset 8
- OpMemberDecorate %GammaTransferParams 3 Offset 12
- OpMemberDecorate %GammaTransferParams 4 Offset 16
- OpMemberDecorate %GammaTransferParams 5 Offset 20
- OpMemberDecorate %GammaTransferParams 6 Offset 24
- OpMemberDecorate %GammaTransferParams 7 Offset 28
- OpMemberDecorate %ExternalTextureParams 4 Offset 96
- OpMemberDecorate %ExternalTextureParams 5 Offset 128
- OpMemberDecorate %ExternalTextureParams 5 ColMajor
- OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
- OpDecorate %ext_tex_params NonWritable
- OpDecorate %ext_tex_params DescriptorSet 1
- OpDecorate %ext_tex_params Binding 2
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
-%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %uint = OpTypeInt 32 0
-%mat3v4float = OpTypeMatrix %v4float 3
-%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
- %v3float = OpTypeVector %float 3
-%mat3v3float = OpTypeMatrix %v3float 3
-%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float
-%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams
-%ext_tex_params = OpVariable %_ptr_Uniform_ExternalTextureParams Uniform
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %21 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %32 = OpConstantNull %v2int
- %33 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_ba1481 = OpFunction %void None %21
- %24 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %32
- %28 = OpLoad %11 %arg_0
- %25 = OpImageQuerySizeLod %v2int %28 %int_0
- OpStore %res %25
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %21
- %38 = OpLabel
- %39 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %39
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %21
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %21
- %45 = OpLabel
- %46 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.wgsl
deleted file mode 100644
index cbc8837..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ba1481.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_external;
-
-fn textureDimensions_ba1481() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ba1481();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ba1481();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ba1481();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl
deleted file mode 100644
index c251ab6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<i32>
-fn textureDimensions_bb3dde() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_bb3dde();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_bb3dde();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_bb3dde();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 48b980a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_bb3dde() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_bb3dde();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_bb3dde();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 48b980a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_bb3dde() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_bb3dde();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_bb3dde();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.glsl
deleted file mode 100644
index 8c5f740..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_bb3dde();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_bb3dde();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.msl
deleted file mode 100644
index 0f83742..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_bb3dde(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_bb3dde(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_bb3dde(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_bb3dde(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.spvasm
deleted file mode 100644
index 7d30072..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_bb3dde "textureDimensions_bb3dde"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_bb3dde = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.wgsl
deleted file mode 100644
index bd224fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/bb3dde.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32sint, write>;
-
-fn textureDimensions_bb3dde() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_bb3dde();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_bb3dde();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_bb3dde();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl
new file mode 100644
index 0000000..c30f0fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>) -> vec3<u32>
+fn textureDimensions_bb95d9() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bb95d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bb95d9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..abb88d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_bb95d9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bb95d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bb95d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..abb88d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_bb95d9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bb95d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bb95d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl
new file mode 100644
index 0000000..2222166
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_bb95d9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_bb95d9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl
new file mode 100644
index 0000000..7319205
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_bb95d9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bb95d9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bb95d9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm
new file mode 100644
index 0000000..4529549
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bb95d9 "textureDimensions_bb95d9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bb95d9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v3uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl
new file mode 100644
index 0000000..24fab7a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bb95d9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_bb95d9() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bb95d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bb95d9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl
new file mode 100644
index 0000000..14e3679
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<u32>
+fn textureDimensions_bbe285() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bbe285();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bbe285();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bbe285();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bc18dde
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_bbe285() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bbe285();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bbe285();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bc18dde
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_bbe285() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bbe285();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bbe285();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl
new file mode 100644
index 0000000..2464082
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_bbe285();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_bbe285();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl
new file mode 100644
index 0000000..35cf418
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_bbe285(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bbe285(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bbe285(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm
new file mode 100644
index 0000000..5613469
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bbe285 "textureDimensions_bbe285"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bbe285 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl
new file mode 100644
index 0000000..b74acdf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bbe285.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureDimensions_bbe285() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bbe285();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bbe285();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bbe285();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl
new file mode 100644
index 0000000..4a6d705
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array, level: u32) -> vec2<u32>
+fn textureDimensions_bd94c8() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bd94c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bd94c8();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..39364bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_bd94c8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bd94c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bd94c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..39364bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_bd94c8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bd94c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bd94c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl
new file mode 100644
index 0000000..9d2675d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_bd94c8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_bd94c8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl
new file mode 100644
index 0000000..5663ac1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_bd94c8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bd94c8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bd94c8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm
new file mode 100644
index 0000000..bdaa00d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bd94c8 "textureDimensions_bd94c8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bd94c8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl
new file mode 100644
index 0000000..abfd6d2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/bd94c8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_bd94c8() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bd94c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bd94c8();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl
new file mode 100644
index 0000000..3c783c2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<u32>
+fn textureDimensions_c1dbf6() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c1dbf6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c1dbf6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ec06df9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_c1dbf6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c1dbf6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ec06df9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_c1dbf6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c1dbf6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl
new file mode 100644
index 0000000..4c2ee10
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c1dbf6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_c1dbf6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl
new file mode 100644
index 0000000..04722f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_c1dbf6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c1dbf6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c1dbf6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm
new file mode 100644
index 0000000..ae9f484
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c1dbf6 "textureDimensions_c1dbf6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c1dbf6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl
new file mode 100644
index 0000000..590817f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c1dbf6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8uint, write>;
+
+fn textureDimensions_c1dbf6() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c1dbf6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c1dbf6();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl
new file mode 100644
index 0000000..6feb2e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
+fn textureDimensions_c2cdd3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c2cdd3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c2cdd3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..45db8ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_c2cdd3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c2cdd3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..45db8ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_c2cdd3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c2cdd3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl
new file mode 100644
index 0000000..ef3ef24
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c2cdd3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_c2cdd3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl
new file mode 100644
index 0000000..53a8299
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureDimensions_c2cdd3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c2cdd3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c2cdd3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm
new file mode 100644
index 0000000..c107a82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c2cdd3 "textureDimensions_c2cdd3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c2cdd3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl
new file mode 100644
index 0000000..503bc4d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c2cdd3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureDimensions_c2cdd3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c2cdd3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c2cdd3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl
deleted file mode 100644
index 6465afc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<i32>
-fn textureDimensions_c30e75() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c30e75();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c30e75();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c30e75();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e4ae382..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_c30e75() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c30e75();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c30e75();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e4ae382..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_c30e75() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c30e75();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c30e75();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.glsl
deleted file mode 100644
index 06b6108..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_c30e75();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_c30e75();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.msl
deleted file mode 100644
index 711f4aa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_c30e75(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_c30e75(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_c30e75(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_c30e75(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.spvasm
deleted file mode 100644
index 05cad7c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_c30e75 "textureDimensions_c30e75"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_c30e75 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.wgsl
deleted file mode 100644
index 121b2c3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c30e75.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32sint, write>;
-
-fn textureDimensions_c30e75() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c30e75();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c30e75();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c30e75();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl
new file mode 100644
index 0000000..51445e0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<u32>
+fn textureDimensions_c44fc1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c44fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c44fc1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..26b09c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_c44fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c44fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c44fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..26b09c0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_c44fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c44fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c44fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl
new file mode 100644
index 0000000..65da687
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_c44fc1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_c44fc1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl
new file mode 100644
index 0000000..bf13ca8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_c44fc1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c44fc1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c44fc1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..de28a79
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c44fc1 "textureDimensions_c44fc1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c44fc1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e9f662
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c44fc1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureDimensions_c44fc1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c44fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c44fc1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl
new file mode 100644
index 0000000..61e4f3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube) -> vec2<u32>
+fn textureDimensions_c5a36e() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c5a36e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c5a36e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2bfa274
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_c5a36e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c5a36e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c5a36e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2bfa274
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_c5a36e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c5a36e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c5a36e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl
new file mode 100644
index 0000000..8927ad3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c5a36e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_c5a36e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl
new file mode 100644
index 0000000..9d92d1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_c5a36e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c5a36e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c5a36e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm
new file mode 100644
index 0000000..0992548
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c5a36e "textureDimensions_c5a36e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c5a36e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f9256a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c5a36e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_c5a36e() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c5a36e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c5a36e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl
deleted file mode 100644
index 53293aa..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<i32>
-fn textureDimensions_c7943d() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c7943d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c7943d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c7943d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4b69252..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_c7943d() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c7943d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c7943d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4b69252..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_c7943d() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c7943d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c7943d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.glsl
deleted file mode 100644
index ec88d6e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_c7943d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_c7943d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.msl
deleted file mode 100644
index 39c32d1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_c7943d(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_c7943d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_c7943d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_c7943d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.spvasm
deleted file mode 100644
index 0f1070d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_c7943d "textureDimensions_c7943d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_c7943d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.wgsl
deleted file mode 100644
index 0d589b5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/c7943d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8uint, write>;
-
-fn textureDimensions_c7943d() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c7943d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c7943d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c7943d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl
new file mode 100644
index 0000000..64ae6c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>, level: u32) -> vec3<u32>
+fn textureDimensions_c871f3() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c871f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c871f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c871f3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..01d51cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_c871f3() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c871f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c871f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..01d51cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_c871f3() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c871f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c871f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl
new file mode 100644
index 0000000..1a1fc92
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c871f3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uvec3 res = uvec3(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_c871f3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl
new file mode 100644
index 0000000..2b1fdfc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_c871f3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c871f3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c871f3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..f6e86c4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c871f3 "textureDimensions_c871f3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c871f3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %20 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..627bb3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/c871f3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_c871f3() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c871f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c871f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c871f3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl
new file mode 100644
index 0000000..0f4624c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<u32>
+fn textureDimensions_cad3b7() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cad3b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cad3b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b26a056
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cad3b7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cad3b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cad3b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b26a056
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cad3b7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cad3b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cad3b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl
new file mode 100644
index 0000000..f133039
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cad3b7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_cad3b7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl
new file mode 100644
index 0000000..1fcfb3f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_cad3b7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cad3b7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cad3b7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm
new file mode 100644
index 0000000..0f7dfc3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cad3b7 "textureDimensions_cad3b7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cad3b7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl
new file mode 100644
index 0000000..24b1443
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cad3b7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32sint, write>;
+
+fn textureDimensions_cad3b7() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cad3b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cad3b7();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl
new file mode 100644
index 0000000..391a94c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<u32>
+fn textureDimensions_cc947b() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cc947b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cc947b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cc947b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a29d944
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cc947b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cc947b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc947b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a29d944
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cc947b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cc947b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc947b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl
new file mode 100644
index 0000000..3340606
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cc947b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_cc947b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl
new file mode 100644
index 0000000..4d1cb5d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_cc947b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cc947b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cc947b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a51f315
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cc947b "textureDimensions_cc947b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cc947b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5ca2ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cc947b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8snorm, write>;
+
+fn textureDimensions_cc947b() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cc947b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cc947b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cc947b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl
deleted file mode 100644
index db888ed..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> i32
-fn textureDimensions_cc968c() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cc968c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cc968c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cc968c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e20e81b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cc968c() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cc968c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cc968c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e20e81b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cc968c() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cc968c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cc968c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.glsl
deleted file mode 100644
index d7f3bec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cc968c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cc968c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.msl
deleted file mode 100644
index 2a4db09..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cc968c(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_cc968c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cc968c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cc968c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.spvasm
deleted file mode 100644
index 21f2dd1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cc968c "textureDimensions_cc968c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cc968c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.wgsl
deleted file mode 100644
index 8caceed..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cc968c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32sint, write>;
-
-fn textureDimensions_cc968c() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cc968c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cc968c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cc968c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl
deleted file mode 100644
index ac04914..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> i32
-fn textureDimensions_cccc8f() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cccc8f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cccc8f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cccc8f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8030a26..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cccc8f() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cccc8f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cccc8f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8030a26..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cccc8f() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cccc8f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cccc8f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.glsl
deleted file mode 100644
index 8ea9b9e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cccc8f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cccc8f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.msl
deleted file mode 100644
index f03ce0c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cccc8f(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_cccc8f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cccc8f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cccc8f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.spvasm
deleted file mode 100644
index ae7cb8d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cccc8f "textureDimensions_cccc8f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cccc8f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.wgsl
deleted file mode 100644
index 19570ad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cccc8f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8snorm, write>;
-
-fn textureDimensions_cccc8f() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cccc8f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cccc8f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cccc8f();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl
deleted file mode 100644
index 1bca07e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<i32>
-fn textureDimensions_cd76a7() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cd76a7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cd76a7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cd76a7();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 107e7e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cd76a7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cd76a7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cd76a7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 107e7e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cd76a7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cd76a7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cd76a7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.glsl
deleted file mode 100644
index 92b0dae..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cd76a7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cd76a7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.msl
deleted file mode 100644
index 14b141a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cd76a7(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_cd76a7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cd76a7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cd76a7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.spvasm
deleted file mode 100644
index 6d33337..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cd76a7 "textureDimensions_cd76a7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cd76a7 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.wgsl
deleted file mode 100644
index fa3b1a9..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cd76a7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8unorm, write>;
-
-fn textureDimensions_cd76a7() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cd76a7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cd76a7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cd76a7();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl
new file mode 100644
index 0000000..3fc78f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_external;
+
+// fn textureDimensions(texture: texture_external) -> vec2<u32>
+fn textureDimensions_cdc6c9() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cdc6c9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cdc6c9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..092b79e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,38 @@
+Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
+cbuffer cbuffer_ext_tex_params : register(b2, space1) {
+ uint4 ext_tex_params[11];
+};
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cdc6c9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cdc6c9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..092b79e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,38 @@
+Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
+cbuffer cbuffer_ext_tex_params : register(b2, space1) {
+ uint4 ext_tex_params[11];
+};
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cdc6c9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cdc6c9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
new file mode 100644
index 0000000..61f4523
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -0,0 +1,112 @@
+#version 310 es
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cdc6c9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_cdc6c9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
new file mode 100644
index 0000000..3808793
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -0,0 +1,53 @@
+#include <metal_stdlib>
+
+using namespace metal;
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+struct ExternalTextureParams {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ float3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ float3x3 gamutConversionMatrix;
+};
+
+void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_cdc6c9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cdc6c9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cdc6c9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2f0f94
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -0,0 +1,127 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 47
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %ext_tex_plane_1 "ext_tex_plane_1"
+ OpName %ExternalTextureParams "ExternalTextureParams"
+ OpMemberName %ExternalTextureParams 0 "numPlanes"
+ OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
+ OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
+ OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
+ OpName %GammaTransferParams "GammaTransferParams"
+ OpMemberName %GammaTransferParams 0 "G"
+ OpMemberName %GammaTransferParams 1 "A"
+ OpMemberName %GammaTransferParams 2 "B"
+ OpMemberName %GammaTransferParams 3 "C"
+ OpMemberName %GammaTransferParams 4 "D"
+ OpMemberName %GammaTransferParams 5 "E"
+ OpMemberName %GammaTransferParams 6 "F"
+ OpMemberName %GammaTransferParams 7 "padding"
+ OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
+ OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
+ OpName %ext_tex_params "ext_tex_params"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %ext_tex_plane_1 DescriptorSet 1
+ OpDecorate %ext_tex_plane_1 Binding 1
+ OpDecorate %ExternalTextureParams Block
+ OpMemberDecorate %ExternalTextureParams 0 Offset 0
+ OpMemberDecorate %ExternalTextureParams 1 Offset 4
+ OpMemberDecorate %ExternalTextureParams 2 Offset 16
+ OpMemberDecorate %ExternalTextureParams 2 ColMajor
+ OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
+ OpMemberDecorate %ExternalTextureParams 3 Offset 64
+ OpMemberDecorate %GammaTransferParams 0 Offset 0
+ OpMemberDecorate %GammaTransferParams 1 Offset 4
+ OpMemberDecorate %GammaTransferParams 2 Offset 8
+ OpMemberDecorate %GammaTransferParams 3 Offset 12
+ OpMemberDecorate %GammaTransferParams 4 Offset 16
+ OpMemberDecorate %GammaTransferParams 5 Offset 20
+ OpMemberDecorate %GammaTransferParams 6 Offset 24
+ OpMemberDecorate %GammaTransferParams 7 Offset 28
+ OpMemberDecorate %ExternalTextureParams 4 Offset 96
+ OpMemberDecorate %ExternalTextureParams 5 Offset 128
+ OpMemberDecorate %ExternalTextureParams 5 ColMajor
+ OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
+ OpDecorate %ext_tex_params NonWritable
+ OpDecorate %ext_tex_params DescriptorSet 1
+ OpDecorate %ext_tex_params Binding 2
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%mat3v4float = OpTypeMatrix %v4float 3
+%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
+ %v3float = OpTypeVector %float 3
+%mat3v3float = OpTypeMatrix %v3float 3
+%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float
+%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams
+%ext_tex_params = OpVariable %_ptr_Uniform_ExternalTextureParams Uniform
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %32 = OpConstantNull %v2uint
+ %33 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cdc6c9 = OpFunction %void None %21
+ %24 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %32
+ %27 = OpLoad %11 %arg_0
+ %25 = OpImageQuerySizeLod %v2uint %27 %int_0
+ OpStore %res %25
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %21
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %21
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %21
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..f4ef228
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cdc6c9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_external;
+
+fn textureDimensions_cdc6c9() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cdc6c9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cdc6c9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl
deleted file mode 100644
index f434881..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<i32>
-fn textureDimensions_cdf473() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cdf473();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cdf473();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cdf473();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 895f7d0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cdf473() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cdf473();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cdf473();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 895f7d0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cdf473() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cdf473();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cdf473();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.glsl
deleted file mode 100644
index ea5fe7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_cdf473();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_cdf473();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.msl
deleted file mode 100644
index fa50285..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cdf473(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_cdf473(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cdf473(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cdf473(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.spvasm
deleted file mode 100644
index 30caae8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cdf473 "textureDimensions_cdf473"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cdf473 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.wgsl
deleted file mode 100644
index a675dad..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cdf473.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
-
-fn textureDimensions_cdf473() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cdf473();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cdf473();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cdf473();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl
deleted file mode 100644
index dfdf759..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<i32>
-fn textureDimensions_cec841() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cec841();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cec841();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cec841();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8b892fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_cec841() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cec841();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cec841();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8b892fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_cec841() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cec841();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cec841();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.glsl
deleted file mode 100644
index 6c4ff13..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_cec841();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_cec841();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.msl
deleted file mode 100644
index 7c0b4ee..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cec841(texture2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_cec841(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cec841(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cec841(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.spvasm
deleted file mode 100644
index 34eb8ec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cec841 "textureDimensions_cec841"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cec841 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_cec841
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cec841
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_cec841
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.wgsl
deleted file mode 100644
index 7a92b37..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cec841.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_cec841() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cec841();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cec841();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cec841();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl
new file mode 100644
index 0000000..70f5149
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_cf2b50() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cf2b50();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cf2b50();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..78fe8b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cf2b50() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cf2b50();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf2b50();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..78fe8b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cf2b50() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cf2b50();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf2b50();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl
new file mode 100644
index 0000000..35d53088
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_cf2b50();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_cf2b50();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl
new file mode 100644
index 0000000..24eabd3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_cf2b50(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cf2b50(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cf2b50(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm
new file mode 100644
index 0000000..ac27386
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cf2b50 "textureDimensions_cf2b50"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cf2b50 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl
new file mode 100644
index 0000000..1caa120
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/cf2b50.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_cf2b50() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cf2b50();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cf2b50();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl
deleted file mode 100644
index 0d4830e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<i32>
-fn textureDimensions_cf7e43() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cf7e43();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cf7e43();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cf7e43();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f8b6211..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cf7e43() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cf7e43();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cf7e43();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f8b6211..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cf7e43() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cf7e43();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cf7e43();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.glsl
deleted file mode 100644
index 8b491fb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cf7e43();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cf7e43();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.msl
deleted file mode 100644
index 2103642..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cf7e43(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_cf7e43(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cf7e43(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cf7e43(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.spvasm
deleted file mode 100644
index 62a64df..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cf7e43 "textureDimensions_cf7e43"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cf7e43 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.wgsl
deleted file mode 100644
index 38c9845..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/cf7e43.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8snorm, write>;
-
-fn textureDimensions_cf7e43() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cf7e43();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cf7e43();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cf7e43();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl
new file mode 100644
index 0000000..70e0536
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> u32
+fn textureDimensions_d08a94() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d08a94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d08a94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d08a94();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..033da1ff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_d08a94() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d08a94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d08a94();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..033da1ff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_d08a94() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d08a94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d08a94();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl
new file mode 100644
index 0000000..58a0a3b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d08a94();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d08a94();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl
new file mode 100644
index 0000000..c416401
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_d08a94(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d08a94(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d08a94(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm
new file mode 100644
index 0000000..cffbbe5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d08a94 "textureDimensions_d08a94"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d08a94 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl
new file mode 100644
index 0000000..8a49fb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d08a94.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16sint, write>;
+
+fn textureDimensions_d08a94() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d08a94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d08a94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d08a94();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl
deleted file mode 100644
index 1dbf074..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>) -> vec2<i32>
-fn textureDimensions_d125bc() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d125bc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d125bc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d125bc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bf2c107..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_d125bc() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d125bc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d125bc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bf2c107..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_d125bc() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d125bc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d125bc();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.glsl
deleted file mode 100644
index 0debada..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_d125bc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_d125bc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.msl
deleted file mode 100644
index 67f0abc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d125bc(texturecube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_d125bc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d125bc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d125bc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.spvasm
deleted file mode 100644
index 3d3b32a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d125bc "textureDimensions_d125bc"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d125bc = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.wgsl
deleted file mode 100644
index 21f8b05..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d125bc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_d125bc() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d125bc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d125bc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d125bc();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl
deleted file mode 100644
index adef2a5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array, level: u32) -> vec2<i32>
-fn textureDimensions_d1a23d() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d1a23d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d1a23d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d1a23d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6c343f2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_d1a23d() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d1a23d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d1a23d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6c343f2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_d1a23d() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d1a23d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d1a23d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.glsl
deleted file mode 100644
index 7cd9cbc..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_d1a23d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_d1a23d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.msl
deleted file mode 100644
index 047e514..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d1a23d(depthcube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_d1a23d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d1a23d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d1a23d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.spvasm
deleted file mode 100644
index 76d262c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d1a23d "textureDimensions_d1a23d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d1a23d = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %uint_1
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.wgsl
deleted file mode 100644
index 59389d8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d1a23d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_d1a23d() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d1a23d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d1a23d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d1a23d();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl
new file mode 100644
index 0000000..7c7607e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube, level: u32) -> vec2<u32>
+fn textureDimensions_d3accd() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d3accd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d3accd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d3accd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ed7a614
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_d3accd() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d3accd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d3accd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ed7a614
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_d3accd() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d3accd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d3accd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl
new file mode 100644
index 0000000..5e121ce
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d3accd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_d3accd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl
new file mode 100644
index 0000000..2b150ef
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_d3accd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d3accd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d3accd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm
new file mode 100644
index 0000000..db36476
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d3accd "textureDimensions_d3accd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d3accd = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl
new file mode 100644
index 0000000..66f05f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d3accd.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_d3accd() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d3accd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d3accd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d3accd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl
new file mode 100644
index 0000000..0188d69
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<u32>
+fn textureDimensions_d63c28() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d63c28();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d63c28();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d63c28();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e004506
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_d63c28() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d63c28();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d63c28();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e004506
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_d63c28() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d63c28();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d63c28();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl
new file mode 100644
index 0000000..e4679a4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_d63c28();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_d63c28();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl
new file mode 100644
index 0000000..9afba4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_d63c28(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d63c28(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d63c28(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm
new file mode 100644
index 0000000..72b6139
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d63c28 "textureDimensions_d63c28"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d63c28 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl
new file mode 100644
index 0000000..5e08214
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d63c28.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureDimensions_d63c28() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d63c28();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d63c28();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d63c28();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl
deleted file mode 100644
index d613137..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_d83c45() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d83c45();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d83c45();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d83c45();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 416cef0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_d83c45() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d83c45();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d83c45();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 416cef0..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_d83c45() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d83c45();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d83c45();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.glsl
deleted file mode 100644
index 94aef0c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_d83c45();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_d83c45();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.msl
deleted file mode 100644
index cefe431..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d83c45(texturecube_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_d83c45(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d83c45(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d83c45(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.spvasm
deleted file mode 100644
index 4a6f7f8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d83c45 "textureDimensions_d83c45"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d83c45 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_1
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.wgsl
deleted file mode 100644
index 08c37ba..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/d83c45.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_d83c45() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d83c45();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d83c45();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d83c45();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl
new file mode 100644
index 0000000..291f651
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<u32>
+fn textureDimensions_d8ba68() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8ba68();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8ba68();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..81ffa6c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8ba68() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8ba68();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8ba68();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..81ffa6c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8ba68() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8ba68();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8ba68();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl
new file mode 100644
index 0000000..fd4d413
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d8ba68();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d8ba68();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl
new file mode 100644
index 0000000..933e158
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_d8ba68(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d8ba68(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d8ba68(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c846eb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d8ba68 "textureDimensions_d8ba68"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d8ba68 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0908ff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8ba68.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32uint, write>;
+
+fn textureDimensions_d8ba68() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8ba68();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8ba68();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl
new file mode 100644
index 0000000..9c7bc22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<u32>
+fn textureDimensions_d8f887() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8f887();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8f887();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8f887();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..917113f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8f887() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8f887();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8f887();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..917113f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8f887() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8f887();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8f887();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl
new file mode 100644
index 0000000..c175bda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d8f887();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d8f887();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl
new file mode 100644
index 0000000..8210fd2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_d8f887(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d8f887(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d8f887(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm
new file mode 100644
index 0000000..a7f40d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d8f887 "textureDimensions_d8f887"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d8f887 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl
new file mode 100644
index 0000000..3b0a6fd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/d8f887.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8uint, write>;
+
+fn textureDimensions_d8f887() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8f887();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8f887();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8f887();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl
new file mode 100644
index 0000000..72b05e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> u32
+fn textureDimensions_da30d2() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_da30d2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_da30d2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_da30d2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..db53401
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_da30d2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_da30d2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_da30d2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..db53401
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_da30d2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_da30d2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_da30d2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl
new file mode 100644
index 0000000..15c9df4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_da30d2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_da30d2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl
new file mode 100644
index 0000000..46c48ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_da30d2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_da30d2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_da30d2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm
new file mode 100644
index 0000000..e7b2b01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_da30d2 "textureDimensions_da30d2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_da30d2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl
new file mode 100644
index 0000000..fb066ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/da30d2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32float, write>;
+
+fn textureDimensions_da30d2() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_da30d2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_da30d2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_da30d2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl
deleted file mode 100644
index 5eb5422..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<i32>
-fn textureDimensions_daf7c0() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_daf7c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_daf7c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_daf7c0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b44a6b8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_daf7c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_daf7c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_daf7c0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b44a6b8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_daf7c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_daf7c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_daf7c0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.glsl
deleted file mode 100644
index 5cfbb47..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_daf7c0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_daf7c0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.msl
deleted file mode 100644
index 9f811af..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_daf7c0(texture2d_ms<int, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
- textureDimensions_daf7c0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_daf7c0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_daf7c0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.spvasm
deleted file mode 100644
index 05b6fe7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_daf7c0 "textureDimensions_daf7c0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_daf7c0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.wgsl
deleted file mode 100644
index cf81583..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/daf7c0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
-
-fn textureDimensions_daf7c0() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_daf7c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_daf7c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_daf7c0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl
deleted file mode 100644
index ff016eb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> i32
-fn textureDimensions_dc2dd0() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc2dd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc2dd0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 20e9146..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_dc2dd0() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc2dd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc2dd0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 20e9146..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_dc2dd0() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc2dd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc2dd0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.glsl
deleted file mode 100644
index 3d7ac14..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_dc2dd0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_dc2dd0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.msl
deleted file mode 100644
index 9e5082a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_dc2dd0(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_dc2dd0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_dc2dd0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_dc2dd0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.spvasm
deleted file mode 100644
index 074de23..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_dc2dd0 "textureDimensions_dc2dd0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_dc2dd0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.wgsl
deleted file mode 100644
index 53eaf8f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc2dd0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8uint, write>;
-
-fn textureDimensions_dc2dd0() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc2dd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc2dd0();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl
deleted file mode 100644
index 064b0b8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_dc7798() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc7798();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc7798();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc7798();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ccc7f18..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_dc7798() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc7798();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc7798();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ccc7f18..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_dc7798() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc7798();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc7798();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.glsl
deleted file mode 100644
index aa97b96..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_dc7798();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_dc7798();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.msl
deleted file mode 100644
index 01e28d2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_dc7798(texture2d_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_dc7798(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_dc7798(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_dc7798(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.spvasm
deleted file mode 100644
index fbd3442..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_dc7798 "textureDimensions_dc7798"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_dc7798 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %uint_1
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.wgsl
deleted file mode 100644
index 14e5b16..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/dc7798.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_dc7798() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc7798();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc7798();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc7798();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl
new file mode 100644
index 0000000..9f76364
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<u32>
+fn textureDimensions_dc83ce() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dc83ce();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dc83ce();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8f9d770
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_dc83ce() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dc83ce();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dc83ce();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8f9d770
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_dc83ce() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dc83ce();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dc83ce();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl
new file mode 100644
index 0000000..81558b4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_dc83ce();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_dc83ce();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl
new file mode 100644
index 0000000..f65454f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_dc83ce(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dc83ce(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dc83ce(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm
new file mode 100644
index 0000000..77a8eae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dc83ce "textureDimensions_dc83ce"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dc83ce = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl
new file mode 100644
index 0000000..696ed4f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dc83ce.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32uint, write>;
+
+fn textureDimensions_dc83ce() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dc83ce();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dc83ce();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl
new file mode 100644
index 0000000..bdb1c2b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<u32>
+fn textureDimensions_dee461() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dee461();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dee461();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dee461();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a745fb1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_dee461() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dee461();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dee461();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a745fb1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_dee461() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dee461();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dee461();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl
new file mode 100644
index 0000000..d608c49
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_dee461();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_dee461();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl
new file mode 100644
index 0000000..ed5309b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_dee461(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dee461(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dee461(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm
new file mode 100644
index 0000000..5a31cb4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dee461 "textureDimensions_dee461"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dee461 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl
new file mode 100644
index 0000000..52b68e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dee461.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8snorm, write>;
+
+fn textureDimensions_dee461() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dee461();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dee461();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dee461();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl
new file mode 100644
index 0000000..954f430
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2<u32>
+fn textureDimensions_dfdc32() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dfdc32();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dfdc32();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9ca9867
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_dfdc32() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dfdc32();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dfdc32();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9ca9867
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_dfdc32() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dfdc32();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dfdc32();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl
new file mode 100644
index 0000000..57cf5c6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_dfdc32();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_dfdc32();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl
new file mode 100644
index 0000000..d1bcb69
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_dfdc32(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dfdc32(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dfdc32(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm
new file mode 100644
index 0000000..2ecbfe2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dfdc32 "textureDimensions_dfdc32"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dfdc32 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl
new file mode 100644
index 0000000..41332c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/dfdc32.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_dfdc32() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dfdc32();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dfdc32();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl
new file mode 100644
index 0000000..e09efc0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> u32
+fn textureDimensions_e122fe() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e122fe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e122fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e122fe();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..051139d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_e122fe() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e122fe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e122fe();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..051139d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_e122fe() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e122fe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e122fe();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl
new file mode 100644
index 0000000..5c766e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e122fe();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e122fe();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl
new file mode 100644
index 0000000..a069344
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_e122fe(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e122fe(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e122fe(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2f8217
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e122fe "textureDimensions_e122fe"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e122fe = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c63426
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e122fe.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8snorm, write>;
+
+fn textureDimensions_e122fe() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e122fe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e122fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e122fe();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl
deleted file mode 100644
index deca2cb..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_e17db8() {
- var res: vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e17db8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e17db8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e17db8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5012db7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_e17db8() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e17db8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e17db8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5012db7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_e17db8() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e17db8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e17db8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.glsl
deleted file mode 100644
index f97ce9b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e17db8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- ivec2 res = textureSize(arg_0_1, int(1u)).xy;
-}
-
-void compute_main() {
- textureDimensions_e17db8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.msl
deleted file mode 100644
index a823db1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e17db8(texturecube_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_e17db8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e17db8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e17db8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.spvasm
deleted file mode 100644
index 07a61ee..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e17db8 "textureDimensions_e17db8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e17db8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %uint_1
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.wgsl
deleted file mode 100644
index ed7d8d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e17db8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_e17db8() {
- var res : vec2<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e17db8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e17db8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e17db8();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl
new file mode 100644
index 0000000..17d67b4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_e18a8b() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e18a8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e18a8b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..98ef751
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e18a8b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e18a8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e18a8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..98ef751
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e18a8b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e18a8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e18a8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl
new file mode 100644
index 0000000..8e89734
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e18a8b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)));
+}
+
+void compute_main() {
+ textureDimensions_e18a8b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl
new file mode 100644
index 0000000..90a66c3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_e18a8b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e18a8b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e18a8b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm
new file mode 100644
index 0000000..62e58b8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e18a8b "textureDimensions_e18a8b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e18a8b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %uint_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl
new file mode 100644
index 0000000..b2ff2ee
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e18a8b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_e18a8b() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e18a8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e18a8b();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl
new file mode 100644
index 0000000..551b92b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<u32>
+fn textureDimensions_e4bfd2() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4bfd2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4bfd2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a3ba5e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4bfd2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4bfd2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a3ba5e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4bfd2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4bfd2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl
new file mode 100644
index 0000000..7e8bd57
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e4bfd2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_e4bfd2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl
new file mode 100644
index 0000000..a80135e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureDimensions_e4bfd2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e4bfd2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e4bfd2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm
new file mode 100644
index 0000000..8f34ad1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e4bfd2 "textureDimensions_e4bfd2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e4bfd2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d5b8bc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4bfd2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureDimensions_e4bfd2() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4bfd2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4bfd2();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl
new file mode 100644
index 0000000..9d3a840
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_e4e310() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4e310();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4e310();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4e310();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4ba4ed9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4e310() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4e310();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4e310();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4ba4ed9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4e310() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4e310();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4e310();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl
new file mode 100644
index 0000000..2b3a9e6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_e4e310();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_e4e310();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl
new file mode 100644
index 0000000..bf3b201
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_e4e310(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e4e310(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e4e310(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm
new file mode 100644
index 0000000..f30d4e1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e4e310 "textureDimensions_e4e310"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e4e310 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %uint_1
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl
new file mode 100644
index 0000000..459e57f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e4e310.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_e4e310() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4e310();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4e310();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4e310();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl
new file mode 100644
index 0000000..06043a3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>, level: i32) -> vec3<u32>
+fn textureDimensions_e5a203() {
+ var res: vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e5a203();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e5a203();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e5a203();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fdaee20
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e5a203() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e5a203();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e5a203();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fdaee20
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e5a203() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e5a203();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e5a203();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl
new file mode 100644
index 0000000..5123678
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e5a203();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_e5a203();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl
new file mode 100644
index 0000000..d985a40
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_e5a203(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e5a203(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e5a203(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm
new file mode 100644
index 0000000..502d5be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e5a203 "textureDimensions_e5a203"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e5a203 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %19 %int_1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl
new file mode 100644
index 0000000..e1a7631
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e5a203.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_e5a203() {
+ var res : vec3<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e5a203();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e5a203();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e5a203();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl
new file mode 100644
index 0000000..e60e2db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<u32>
+fn textureDimensions_e738f4() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e738f4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e738f4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e738f4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..32c9a19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_e738f4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e738f4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e738f4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..32c9a19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_e738f4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e738f4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e738f4();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl
new file mode 100644
index 0000000..4100c6f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e738f4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e738f4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl
new file mode 100644
index 0000000..4f00a61
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_e738f4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e738f4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e738f4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm
new file mode 100644
index 0000000..f47fb82
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e738f4 "textureDimensions_e738f4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e738f4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl
new file mode 100644
index 0000000..d6b582c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e738f4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32sint, write>;
+
+fn textureDimensions_e738f4() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e738f4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e738f4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e738f4();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl
deleted file mode 100644
index 5650d35..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<i32>
-fn textureDimensions_e927be() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e927be();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e927be();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e927be();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3be868f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_e927be() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e927be();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e927be();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3be868f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_e927be() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e927be();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e927be();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.glsl
deleted file mode 100644
index a476da2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e927be();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_e927be();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.msl
deleted file mode 100644
index 709257f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e927be(texturecube_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_e927be(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e927be(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e927be(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.spvasm
deleted file mode 100644
index 021901e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e927be "textureDimensions_e927be"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e927be = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_e927be
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_e927be
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_e927be
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.wgsl
deleted file mode 100644
index 1c420a1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e927be.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_e927be() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e927be();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e927be();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e927be();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl
new file mode 100644
index 0000000..e5025f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<u32>
+fn textureDimensions_e99308() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e99308();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e99308();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e99308();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2085764
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_e99308() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e99308();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e99308();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2085764
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_e99308() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e99308();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e99308();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl
new file mode 100644
index 0000000..51d74f1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e99308();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e99308();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl
new file mode 100644
index 0000000..e74a4e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_e99308(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e99308(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e99308(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm
new file mode 100644
index 0000000..212b7e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e99308 "textureDimensions_e99308"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e99308 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl
new file mode 100644
index 0000000..b3346dc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/e99308.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16uint, write>;
+
+fn textureDimensions_e99308() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e99308();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e99308();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e99308();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl
deleted file mode 100644
index 4399a36..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<i32>
-fn textureDimensions_e9e96c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e9e96c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e9e96c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e9e96c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 510eef8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_e9e96c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e9e96c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e9e96c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 510eef8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_e9e96c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e9e96c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e9e96c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.glsl
deleted file mode 100644
index c167c24..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e9e96c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_e9e96c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.msl
deleted file mode 100644
index d512809..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e9e96c(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_e9e96c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e9e96c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e9e96c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.spvasm
deleted file mode 100644
index 3bc1dd4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e9e96c "textureDimensions_e9e96c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e9e96c = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.wgsl
deleted file mode 100644
index 4c37479..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/e9e96c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
-
-fn textureDimensions_e9e96c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e9e96c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e9e96c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e9e96c();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl
new file mode 100644
index 0000000..ec3f376
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> u32
+fn textureDimensions_ea066c() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea066c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea066c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea066c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e0b777
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea066c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea066c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea066c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e0b777
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea066c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea066c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea066c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl
new file mode 100644
index 0000000..70bc37d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ea066c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ea066c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl
new file mode 100644
index 0000000..9da6c0d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_ea066c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ea066c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ea066c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm
new file mode 100644
index 0000000..7644858
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ea066c "textureDimensions_ea066c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ea066c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl
new file mode 100644
index 0000000..dd5fb14
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea066c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32float, write>;
+
+fn textureDimensions_ea066c() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea066c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea066c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea066c();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl
new file mode 100644
index 0000000..ffb3521
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> u32
+fn textureDimensions_ea25bc() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea25bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea25bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..11fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea25bc() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea25bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea25bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..11fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea25bc() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea25bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea25bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl
new file mode 100644
index 0000000..46e8cb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ea25bc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ea25bc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl
new file mode 100644
index 0000000..884b655
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_ea25bc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ea25bc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ea25bc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..04dabbf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ea25bc "textureDimensions_ea25bc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ea25bc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c96ea0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ea25bc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32uint, write>;
+
+fn textureDimensions_ea25bc() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea25bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea25bc();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl
new file mode 100644
index 0000000..1713f9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array, level: u32) -> vec2<u32>
+fn textureDimensions_eafe19() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eafe19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eafe19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eafe19();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1a85539
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_eafe19() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eafe19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eafe19();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1a85539
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_eafe19() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eafe19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eafe19();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl
new file mode 100644
index 0000000..6155e58
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_eafe19();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uvec2 res = uvec2(textureSize(arg_0_1, int(1u)).xy);
+}
+
+void compute_main() {
+ textureDimensions_eafe19();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl
new file mode 100644
index 0000000..e6df145
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_eafe19(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_eafe19(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_eafe19(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm
new file mode 100644
index 0000000..f43b927
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_eafe19 "textureDimensions_eafe19"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_eafe19 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %uint_1
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl
new file mode 100644
index 0000000..592b61f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eafe19.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_eafe19() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1u);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eafe19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eafe19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eafe19();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl
new file mode 100644
index 0000000..05adc5b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<u32>
+fn textureDimensions_eb03b1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eb03b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eb03b1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cbab187
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_eb03b1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eb03b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eb03b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cbab187
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_eb03b1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eb03b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eb03b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl
new file mode 100644
index 0000000..dfc6512
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_eb03b1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_eb03b1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl
new file mode 100644
index 0000000..4cfae71
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_eb03b1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_eb03b1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_eb03b1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1685567
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_eb03b1 "textureDimensions_eb03b1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_eb03b1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..3eefe24
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/eb03b1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureDimensions_eb03b1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eb03b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eb03b1();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl
new file mode 100644
index 0000000..8dec9e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<u32>
+fn textureDimensions_ef2e58() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ef2e58();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ef2e58();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..574ab12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_ef2e58() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ef2e58();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ef2e58();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..574ab12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_ef2e58() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ef2e58();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ef2e58();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl
new file mode 100644
index 0000000..15d4aaf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ef2e58();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ef2e58();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl
new file mode 100644
index 0000000..d52234e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_ef2e58(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ef2e58(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ef2e58(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm
new file mode 100644
index 0000000..70ed829
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ef2e58 "textureDimensions_ef2e58"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ef2e58 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl
new file mode 100644
index 0000000..0a1bbc4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/ef2e58.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32sint, write>;
+
+fn textureDimensions_ef2e58() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ef2e58();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ef2e58();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl
deleted file mode 100644
index 40048ce..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<i32>
-fn textureDimensions_ef5b89() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ef5b89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ef5b89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ef5b89();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4bc53da..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ef5b89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ef5b89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ef5b89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4bc53da..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ef5b89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ef5b89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ef5b89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.glsl
deleted file mode 100644
index c0c1d74..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_ef5b89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_ef5b89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.msl
deleted file mode 100644
index a0d18a7..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_ef5b89(texture2d_ms<float, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
- textureDimensions_ef5b89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_ef5b89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_ef5b89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.spvasm
deleted file mode 100644
index 2cb1a7f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_ef5b89 "textureDimensions_ef5b89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_ef5b89 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.wgsl
deleted file mode 100644
index 32a0325..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/ef5b89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
-
-fn textureDimensions_ef5b89() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ef5b89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ef5b89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ef5b89();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl
deleted file mode 100644
index 2228f7f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>, level: i32) -> vec3<i32>
-fn textureDimensions_efc8a4() {
- var res: vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_efc8a4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_efc8a4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_efc8a4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 27d844c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_efc8a4() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_efc8a4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_efc8a4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 27d844c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_efc8a4() {
- int4 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_efc8a4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_efc8a4();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.glsl
deleted file mode 100644
index 17eeee4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_efc8a4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- ivec3 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_efc8a4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.msl
deleted file mode 100644
index b4d3afd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_efc8a4(texture3d<int, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1), tint_symbol_1.get_depth(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_efc8a4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_efc8a4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_efc8a4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.spvasm
deleted file mode 100644
index 4b18dd8..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_efc8a4 "textureDimensions_efc8a4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_1 = OpConstant %int 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_efc8a4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %19 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.wgsl
deleted file mode 100644
index 8208f0e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/efc8a4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_efc8a4() {
- var res : vec3<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_efc8a4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_efc8a4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_efc8a4();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl
new file mode 100644
index 0000000..061300a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>, level: i32) -> u32
+fn textureDimensions_f17acd() {
+ var res: u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f17acd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f17acd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f17acd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8242f9c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f17acd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f17acd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f17acd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8242f9c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f17acd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f17acd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f17acd();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl
new file mode 100644
index 0000000..1e1f79b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f17acd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ uint res = uint(textureSize(arg_0_1, 1));
+}
+
+void compute_main() {
+ textureDimensions_f17acd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl
new file mode 100644
index 0000000..6b12c74
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_f17acd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f17acd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f17acd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c18cb7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f17acd "textureDimensions_f17acd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f17acd = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %uint %18 %int_1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl
new file mode 100644
index 0000000..640de3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f17acd.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_f17acd() {
+ var res : u32 = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f17acd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f17acd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f17acd();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl
new file mode 100644
index 0000000..25f67e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> u32
+fn textureDimensions_f264a3() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f264a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f264a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f264a3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bed8fd8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_f264a3() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f264a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f264a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bed8fd8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_f264a3() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f264a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f264a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl
new file mode 100644
index 0000000..93568a0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f264a3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f264a3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl
new file mode 100644
index 0000000..5feaa3c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_f264a3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f264a3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f264a3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b148981
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f264a3 "textureDimensions_f264a3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f264a3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl
new file mode 100644
index 0000000..06c76194
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f264a3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32sint, write>;
+
+fn textureDimensions_f264a3() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f264a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f264a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f264a3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl
deleted file mode 100644
index dfee32c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>, level: u32) -> vec3<i32>
-fn textureDimensions_f32242() {
- var res: vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f32242();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f32242();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f32242();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c90e9c1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f32242() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f32242();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f32242();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f32242();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c90e9c1..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f32242() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f32242();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f32242();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f32242();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.glsl
deleted file mode 100644
index 67a1990..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_f32242();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_f32242();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_f32242();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.msl
deleted file mode 100644
index fa7482b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f32242(texture3d<uint, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_f32242(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f32242(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f32242(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.spvasm
deleted file mode 100644
index 21d3c38..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f32242 "textureDimensions_f32242"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f32242 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %20 %uint_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f32242
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_f32242
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_f32242
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.wgsl
deleted file mode 100644
index cfe186d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f32242.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_f32242() {
- var res : vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f32242();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f32242();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f32242();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl
new file mode 100644
index 0000000..8c973e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<u32>
+fn textureDimensions_f3a2ac() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f3a2ac();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f3a2ac();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..13201fc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f3a2ac() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f3a2ac();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..13201fc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f3a2ac() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f3a2ac();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl
new file mode 100644
index 0000000..3d3366f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f3a2ac();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f3a2ac();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl
new file mode 100644
index 0000000..1550808
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_f3a2ac(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f3a2ac(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f3a2ac(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm
new file mode 100644
index 0000000..17304eb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f3a2ac "textureDimensions_f3a2ac"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f3a2ac = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl
new file mode 100644
index 0000000..4173903
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f3a2ac.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16float, write>;
+
+fn textureDimensions_f3a2ac() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f3a2ac();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f3a2ac();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl
new file mode 100644
index 0000000..7ea7cbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<u32>
+fn textureDimensions_f4e469() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f4e469();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f4e469();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f4e469();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ae5bd7a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f4e469() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f4e469();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f4e469();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ae5bd7a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f4e469() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f4e469();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f4e469();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl
new file mode 100644
index 0000000..07ed54b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f4e469();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f4e469();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl
new file mode 100644
index 0000000..9fba981
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_f4e469(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f4e469(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f4e469(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm
new file mode 100644
index 0000000..dbf3eb3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f4e469 "textureDimensions_f4e469"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f4e469 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl
new file mode 100644
index 0000000..fb9261d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f4e469.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32float, write>;
+
+fn textureDimensions_f4e469() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f4e469();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f4e469();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f4e469();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl
deleted file mode 100644
index 836def2..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
-
-// fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32>
-fn textureDimensions_f60bdb() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f60bdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f60bdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f60bdb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1609032..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_f60bdb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f60bdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f60bdb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1609032..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_f60bdb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f60bdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f60bdb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.glsl
deleted file mode 100644
index 9431956..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_f60bdb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_f60bdb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.msl
deleted file mode 100644
index 1ec0626..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f60bdb(depth2d_ms<float, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
- textureDimensions_f60bdb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f60bdb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f60bdb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.spvasm
deleted file mode 100644
index e43fe0b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f60bdb "textureDimensions_f60bdb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f60bdb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.wgsl
deleted file mode 100644
index f22008d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f60bdb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
-
-fn textureDimensions_f60bdb() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f60bdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f60bdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f60bdb();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl
new file mode 100644
index 0000000..8c49681
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>) -> vec2<u32>
+fn textureDimensions_f626b3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f626b3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f626b3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f626b3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9c15fdd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f626b3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f626b3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f626b3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9c15fdd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f626b3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f626b3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f626b3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl
new file mode 100644
index 0000000..9e55087
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f626b3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_f626b3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl
new file mode 100644
index 0000000..3c7807b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_f626b3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f626b3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f626b3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb0bca3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f626b3 "textureDimensions_f626b3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f626b3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..25acd3f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f626b3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_f626b3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f626b3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f626b3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f626b3();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl
deleted file mode 100644
index 653e30f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_f7145b() {
- var res: vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f7145b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f7145b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f7145b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5f0d7b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f7145b() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f7145b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f7145b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5f0d7b3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f7145b() {
- int3 tint_tmp;
- arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f7145b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f7145b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.glsl
deleted file mode 100644
index 465dd5a..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-vec4 vertex_main() {
- textureDimensions_f7145b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- ivec2 res = textureSize(arg_0_1, 1);
-}
-
-void compute_main() {
- textureDimensions_f7145b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.msl
deleted file mode 100644
index d54ae55..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f7145b(texture2d<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_f7145b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f7145b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f7145b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.spvasm
deleted file mode 100644
index 259dcec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f7145b "textureDimensions_f7145b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_1 = OpConstant %int 1
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f7145b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.wgsl
deleted file mode 100644
index 7a90743..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f7145b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_f7145b() {
- var res : vec2<i32> = textureDimensions(arg_0, 1i);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f7145b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f7145b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f7145b();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl
new file mode 100644
index 0000000..a80d3ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>) -> vec2<u32>
+fn textureDimensions_f8522e() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f8522e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f8522e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f8522e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c6710be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f8522e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f8522e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f8522e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c6710be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f8522e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f8522e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f8522e();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl
new file mode 100644
index 0000000..ae80518
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f8522e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_f8522e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl
new file mode 100644
index 0000000..8a65be1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_f8522e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f8522e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f8522e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm
new file mode 100644
index 0000000..f912b4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f8522e "textureDimensions_f8522e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f8522e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl
new file mode 100644
index 0000000..a9491d4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/f8522e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_f8522e() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f8522e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f8522e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f8522e();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl
deleted file mode 100644
index e7304f5..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<i32>
-fn textureDimensions_f931c7() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f931c7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f931c7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f931c7();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9e231e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_f931c7() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f931c7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f931c7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9e231e6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_f931c7() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f931c7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f931c7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.glsl
deleted file mode 100644
index 016f679..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_f931c7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_f931c7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.msl
deleted file mode 100644
index 7b39e0f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f931c7(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_f931c7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f931c7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f931c7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.spvasm
deleted file mode 100644
index 2375b4d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f931c7 "textureDimensions_f931c7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f931c7 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.wgsl
deleted file mode 100644
index 041ed4c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/f931c7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32float, write>;
-
-fn textureDimensions_f931c7() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f931c7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f931c7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f931c7();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl
deleted file mode 100644
index 0f438d3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>) -> vec2<i32>
-fn textureDimensions_fa9859() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fa9859();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fa9859();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fa9859();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4bfdddf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_fa9859() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fa9859();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fa9859();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4bfdddf..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_fa9859() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fa9859();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fa9859();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.glsl
deleted file mode 100644
index d8e8370..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_fa9859();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_fa9859();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.msl
deleted file mode 100644
index 5fca056..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fa9859(texture2d<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_fa9859(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fa9859(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fa9859(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.spvasm
deleted file mode 100644
index 769c44e..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fa9859 "textureDimensions_fa9859"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fa9859 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.wgsl
deleted file mode 100644
index 3acbf7d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fa9859.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_fa9859() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fa9859();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fa9859();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fa9859();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl
deleted file mode 100644
index da81f0d..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<i32>
-fn textureDimensions_fb5670() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fb5670();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fb5670();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fb5670();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3f6c71f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_fb5670() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fb5670();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fb5670();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3f6c71f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_fb5670() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fb5670();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fb5670();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.glsl
deleted file mode 100644
index 5c3bd40..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_fb5670();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_fb5670();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.msl
deleted file mode 100644
index fed740f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fb5670(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_fb5670(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fb5670(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fb5670(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.spvasm
deleted file mode 100644
index c870194..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fb5670 "textureDimensions_fb5670"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fb5670 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.wgsl
deleted file mode 100644
index 199f355..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fb5670.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
-
-fn textureDimensions_fb5670() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fb5670();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fb5670();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fb5670();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl
deleted file mode 100644
index 87397ec..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>, level: u32) -> vec3<i32>
-fn textureDimensions_fbdfb6() {
- var res: vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fbdfb6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fbdfb6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9ea42e4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_fbdfb6() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fbdfb6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fbdfb6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9ea42e4..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_fbdfb6() {
- int4 tint_tmp;
- arg_0.GetDimensions(1u, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fbdfb6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fbdfb6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.glsl
deleted file mode 100644
index ca657c6..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-vec4 vertex_main() {
- textureDimensions_fbdfb6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- ivec3 res = textureSize(arg_0_1, int(1u));
-}
-
-void compute_main() {
- textureDimensions_fbdfb6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.msl
deleted file mode 100644
index 4b1a68f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fbdfb6(texture3d<float, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(1u), tint_symbol_1.get_height(1u), tint_symbol_1.get_depth(1u));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_fbdfb6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fbdfb6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fbdfb6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.spvasm
deleted file mode 100644
index 32f2237..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fbdfb6 "textureDimensions_fbdfb6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fbdfb6 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v3int %19 %uint_1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.wgsl
deleted file mode 100644
index 91ba137..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fbdfb6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_fbdfb6() {
- var res : vec3<i32> = textureDimensions(arg_0, 1u);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fbdfb6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fbdfb6();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl
deleted file mode 100644
index f99ff3f..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<i32>
-fn textureDimensions_fcac78() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fcac78();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fcac78();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fcac78();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f02946b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_fcac78() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fcac78();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fcac78();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f02946b..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_fcac78() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fcac78();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fcac78();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.glsl
deleted file mode 100644
index 9226dcd..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_fcac78();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_fcac78();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.msl
deleted file mode 100644
index 3c6340c..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fcac78(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_fcac78(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fcac78(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fcac78(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.spvasm
deleted file mode 100644
index 2b1c5c3..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fcac78 "textureDimensions_fcac78"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fcac78 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.wgsl
deleted file mode 100644
index 3e13671..0000000
--- a/test/tint/builtins/gen/literal/textureDimensions/fcac78.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8uint, write>;
-
-fn textureDimensions_fcac78() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fcac78();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fcac78();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fcac78();
-}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl
new file mode 100644
index 0000000..2b4cc4c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_fdf6e9() {
+ var res: vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdf6e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdf6e9();
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0308538
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_fdf6e9() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdf6e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0308538
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_fdf6e9() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdf6e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl
new file mode 100644
index 0000000..4a03d8b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_fdf6e9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 1).xy);
+}
+
+void compute_main() {
+ textureDimensions_fdf6e9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl
new file mode 100644
index 0000000..e6a4cf8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(1), tint_symbol_1.get_height(1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_fdf6e9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_fdf6e9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_fdf6e9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm
new file mode 100644
index 0000000..f61ed6f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fdf6e9 "textureDimensions_fdf6e9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_1 = OpConstant %int 1
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_fdf6e9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_1
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl
new file mode 100644
index 0000000..0af7ec9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureDimensions/fdf6e9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_fdf6e9() {
+ var res : vec2<u32> = textureDimensions(arg_0, 1i);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdf6e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdf6e9();
+}
diff --git a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
index 7cc7768..ab254c7 100644
--- a/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/10c554.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
index 2ef4ce5..c577b44 100644
--- a/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/1f7f6b.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
index 4f47345..ba2383e 100644
--- a/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/22e930.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
index 6ab89be..fba78db 100644
--- a/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2cc066.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
index dd85da6..d73af28 100644
--- a/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/2e0ed5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
index 9a6a20d..8bbf3b2 100644
--- a/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/32c4e8.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
index b17ed6e..2abaafe 100644
--- a/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/3b32cc.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
index 037e0ab..e8221d5 100644
--- a/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/43025d.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
index ea7d898..633899dc 100644
--- a/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/49b07f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
index 6a5a81e..b88180b 100644
--- a/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/4b8103.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
index b69002a..db02a44 100644
--- a/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5266da.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
index 88c4503..c4a4e35 100644
--- a/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5ba85f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
index 9b9a7ea..3205508 100644
--- a/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/5bd491.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
index 1a54bb5..20e5226 100644
--- a/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/751f8a.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
index 2ab98cc..24c4da3 100644
--- a/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/7c3828.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
index 446d5d5..acc65ae 100644
--- a/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/8b754c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
index 7f2b8c4..06ca1b8 100644
--- a/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/9a6358.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
index 7abfc75..fff2898 100644
--- a/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/af55b3.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
index 981675f..44b5d3d 100644
--- a/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/bb3ac5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
index dea00ca..cb2ef99 100644
--- a/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/c0640c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
index bcc0db0..2552e7d 100644
--- a/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d1f187.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
index 4a7983e..88a3639 100644
--- a/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/d90605.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
index 817e5a9..5f2f74b 100644
--- a/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/e9d390.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
index c7fded4..42582b1 100644
--- a/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
+++ b/test/tint/builtins/gen/literal/textureGather/f2c6e3.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
index c90295e..bbf1123 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/182fd4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
index 7c49d09..bd87b46 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/313add.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
index c56f8db..1d1b90e 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/60d2d1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
index f5aab74..5ca1268 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/6d9352.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
index 7ca01d9..655e44c 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/783e65.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
index 2264490..3b15c8a 100644
--- a/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureGatherCompare/f585cc.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
index a5e2917..20a8cd8 100644
--- a/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/19cf87.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
index 96c27ea..6ab674c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
index 3645132..ec4fb7f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1b8588.wgsl.expected.glsl
@@ -4,7 +4,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
- uvec4 res = texelFetch(arg_0_1, 1, 0);
+ uvec4 res = texelFetch(arg_0_1, 1, 1);
}
vec4 vertex_main() {
@@ -32,7 +32,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
- uvec4 res = texelFetch(arg_0_1, 1, 0);
+ uvec4 res = texelFetch(arg_0_1, 1, 1);
}
void fragment_main() {
@@ -54,7 +54,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
- uvec4 res = texelFetch(arg_0_1, 1, 0);
+ uvec4 res = texelFetch(arg_0_1, 1, 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
index 91c131c..b81858c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/1f2016.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
index cd23d3d..e7383c5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/484344.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
index 45d0101..fcc4f40 100644
--- a/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/4fd803.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
index 08bd12d..23e75f1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
index e934bb1..0774d37 100644
--- a/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/5a2f9d.wgsl.expected.glsl
@@ -4,7 +4,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
- ivec4 res = texelFetch(arg_0_1, 1, 0);
+ ivec4 res = texelFetch(arg_0_1, 1, 1);
}
vec4 vertex_main() {
@@ -32,7 +32,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
- ivec4 res = texelFetch(arg_0_1, 1, 0);
+ ivec4 res = texelFetch(arg_0_1, 1, 1);
}
void fragment_main() {
@@ -54,7 +54,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
- ivec4 res = texelFetch(arg_0_1, 1, 0);
+ ivec4 res = texelFetch(arg_0_1, 1, 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
index adb0eb9..0e460bb 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6154d4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
index b7d1e1d..988633f 100644
--- a/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/6273b1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
index c1a6c10..5e359e3 100644
--- a/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/79e697.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
index c5386cb..83f84c1 100644
--- a/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/7c90e5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
index 14ef6d8..4263395 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
index 3063669..93e1046 100644
--- a/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureLoad/81c381.wgsl.expected.glsl
@@ -4,7 +4,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
- vec4 res = texelFetch(arg_0_1, 1, 0);
+ vec4 res = texelFetch(arg_0_1, 1, 1);
}
vec4 vertex_main() {
@@ -32,7 +32,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
- vec4 res = texelFetch(arg_0_1, 1, 0);
+ vec4 res = texelFetch(arg_0_1, 1, 1);
}
void fragment_main() {
@@ -54,7 +54,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
- vec4 res = texelFetch(arg_0_1, 1, 0);
+ vec4 res = texelFetch(arg_0_1, 1, 1);
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
index 8824832..764a1c5 100644
--- a/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/87be85.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
index f30b283..c0a16ad 100644
--- a/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/8acf41.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
index fdabf50..5949f7d 100644
--- a/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/9b2667.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
index 735f125..5a7af60 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a583c9.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
index 9b962fa..8618d3c 100644
--- a/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/a9a9f5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
index b08d732..5b373ac 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c2a480.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
index 788eda1..618ca49 100644
--- a/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/c378ee.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
index 1500bf5..1869efe 100644
--- a/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
+++ b/test/tint/builtins/gen/literal/textureLoad/e3d2cc.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl
new file mode 100644
index 0000000..ddc52ad
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> u32
+fn textureNumLayers_014a3b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_014a3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_014a3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..470f2ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_014a3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_014a3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_014a3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..470f2ac
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_014a3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_014a3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_014a3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl
new file mode 100644
index 0000000..c1c9781
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_014a3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_014a3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl
new file mode 100644
index 0000000..4a03eda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_014a3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_014a3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_014a3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..2acde0b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_014a3b "textureNumLayers_014a3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_014a3b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..9c87b00
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/014a3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureNumLayers_014a3b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_014a3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_014a3b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl
deleted file mode 100644
index 2abd10d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureNumLayers(texture: texture_2d_array<f32>) -> i32
-fn textureNumLayers_024820() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_024820();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_024820();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_024820();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c54de32..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_024820() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_024820();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_024820();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c54de32..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_024820() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_024820();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_024820();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.glsl
deleted file mode 100644
index 9e3639f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_024820();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_024820();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.msl
deleted file mode 100644
index 62c3cda..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_024820(texture2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_024820(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_024820(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_024820(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.spvasm
deleted file mode 100644
index 5c65a19..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_024820 "textureNumLayers_024820"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_024820 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_024820
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_024820
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_024820
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.wgsl
deleted file mode 100644
index eaa9cc7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/024820.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureNumLayers_024820() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_024820();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_024820();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_024820();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl
deleted file mode 100644
index e4ee7aa..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureNumLayers(texture: texture_cube_array<u32>) -> i32
-fn textureNumLayers_053df7() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_053df7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_053df7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_053df7();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ec08652..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_053df7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_053df7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_053df7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ec08652..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_053df7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_053df7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_053df7();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.glsl
deleted file mode 100644
index e995abb..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_053df7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_053df7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.msl
deleted file mode 100644
index 68ceeb4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_053df7(texturecube_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureNumLayers_053df7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_053df7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_053df7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.spvasm
deleted file mode 100644
index a8336ca..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_053df7 "textureNumLayers_053df7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %25 = OpConstantNull %int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_053df7 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.wgsl
deleted file mode 100644
index 06592ac..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/053df7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureNumLayers_053df7() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_053df7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_053df7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_053df7();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl
deleted file mode 100644
index 205475f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> i32
-fn textureNumLayers_058cc3() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_058cc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_058cc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_058cc3();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0f9f61a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_058cc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_058cc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_058cc3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0f9f61a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_058cc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_058cc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_058cc3();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.glsl
deleted file mode 100644
index 0730d3a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_058cc3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_058cc3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.msl
deleted file mode 100644
index f89aa00..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_058cc3(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_058cc3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_058cc3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_058cc3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.spvasm
deleted file mode 100644
index 4737d7e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_058cc3 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.wgsl
deleted file mode 100644
index a39583b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/058cc3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
-
-fn textureNumLayers_058cc3() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_058cc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_058cc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_058cc3();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl
new file mode 100644
index 0000000..4ffee75
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> u32
+fn textureNumLayers_071ebc() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_071ebc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_071ebc();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..11a36cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_071ebc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_071ebc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_071ebc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..11a36cc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_071ebc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_071ebc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_071ebc();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl
new file mode 100644
index 0000000..ca8029c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_071ebc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_071ebc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl
new file mode 100644
index 0000000..f9657e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_071ebc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_071ebc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_071ebc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a70e26
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_071ebc "textureNumLayers_071ebc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_071ebc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl
new file mode 100644
index 0000000..61626de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/071ebc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureNumLayers_071ebc() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_071ebc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_071ebc();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl
deleted file mode 100644
index 58e1dba..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> i32
-fn textureNumLayers_09d05d() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_09d05d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_09d05d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_09d05d();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c52cd47..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_09d05d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_09d05d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_09d05d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c52cd47..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_09d05d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_09d05d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_09d05d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.glsl
deleted file mode 100644
index 25b7ded..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_09d05d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_09d05d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.msl
deleted file mode 100644
index 6666c52..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_09d05d(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_09d05d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_09d05d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_09d05d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.spvasm
deleted file mode 100644
index e70fdfc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_09d05d "textureNumLayers_09d05d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_09d05d = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.wgsl
deleted file mode 100644
index cede280..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/09d05d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
-
-fn textureNumLayers_09d05d() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_09d05d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_09d05d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_09d05d();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl
new file mode 100644
index 0000000..bba0167
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureNumLayers(texture: texture_2d_array<f32>) -> u32
+fn textureNumLayers_0ec222() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_0ec222();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_0ec222();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ff2543
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_0ec222() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_0ec222();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_0ec222();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ff2543
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_0ec222() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_0ec222();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_0ec222();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl
new file mode 100644
index 0000000..37ecbb1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_0ec222();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_0ec222();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl
new file mode 100644
index 0000000..63e8634
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_0ec222(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_0ec222(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_0ec222(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm
new file mode 100644
index 0000000..b6d7c2b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_0ec222 "textureNumLayers_0ec222"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_0ec222 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl
new file mode 100644
index 0000000..3f18e09
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/0ec222.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLayers_0ec222() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_0ec222();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_0ec222();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl
deleted file mode 100644
index c67abfb..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> i32
-fn textureNumLayers_13b4ce() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_13b4ce();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_13b4ce();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4d9ac8a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_13b4ce() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_13b4ce();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_13b4ce();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4d9ac8a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_13b4ce() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_13b4ce();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_13b4ce();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.glsl
deleted file mode 100644
index f090067..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_13b4ce();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_13b4ce();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.msl
deleted file mode 100644
index bb33ae6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_13b4ce(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_13b4ce(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_13b4ce(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_13b4ce(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.spvasm
deleted file mode 100644
index 651790d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_13b4ce = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.wgsl
deleted file mode 100644
index 15c0d55..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/13b4ce.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
-
-fn textureNumLayers_13b4ce() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_13b4ce();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_13b4ce();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl
deleted file mode 100644
index 97c27df..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> i32
-fn textureNumLayers_22e53b() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_22e53b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_22e53b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_22e53b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8611a52..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_22e53b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_22e53b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_22e53b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8611a52..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_22e53b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_22e53b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_22e53b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.glsl
deleted file mode 100644
index 3902bb3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_22e53b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_22e53b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.msl
deleted file mode 100644
index 5c5fa33..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_22e53b(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_22e53b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_22e53b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_22e53b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.spvasm
deleted file mode 100644
index 953a4a4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_22e53b "textureNumLayers_22e53b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_22e53b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.wgsl
deleted file mode 100644
index 2ac3057..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/22e53b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
-
-fn textureNumLayers_22e53b() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_22e53b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_22e53b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_22e53b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl
new file mode 100644
index 0000000..376f70d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> u32
+fn textureNumLayers_3465ec() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3465ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3465ec();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b8ba0b2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3465ec() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3465ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3465ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b8ba0b2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3465ec() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3465ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3465ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl
new file mode 100644
index 0000000..0e7b8e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_3465ec();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_3465ec();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl
new file mode 100644
index 0000000..356deb4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_3465ec(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_3465ec(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_3465ec(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm
new file mode 100644
index 0000000..fae4592
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_3465ec "textureNumLayers_3465ec"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_3465ec = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl
new file mode 100644
index 0000000..409c7e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3465ec.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureNumLayers_3465ec() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3465ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3465ec();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl
new file mode 100644
index 0000000..ba4649d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureNumLayers(texture: texture_cube_array<f32>) -> u32
+fn textureNumLayers_34cefa() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_34cefa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_34cefa();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..aafeb23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_34cefa() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_34cefa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_34cefa();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..aafeb23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_34cefa() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_34cefa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_34cefa();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl
new file mode 100644
index 0000000..6cf0e2a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_34cefa();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_34cefa();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.msl
new file mode 100644
index 0000000..4939f4e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_34cefa(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_34cefa(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_34cefa(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_34cefa(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.spvasm
new file mode 100644
index 0000000..56da867
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_34cefa "textureNumLayers_34cefa"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_34cefa = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f82af9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/34cefa.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLayers_34cefa() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_34cefa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_34cefa();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl
new file mode 100644
index 0000000..881a6d3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> u32
+fn textureNumLayers_3580ab() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3580ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3580ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ff6e3c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3580ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3580ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3580ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ff6e3c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3580ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3580ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3580ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl
new file mode 100644
index 0000000..1c54488
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_3580ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_3580ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl
new file mode 100644
index 0000000..e6235c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_3580ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_3580ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_3580ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..2e0c867
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_3580ab "textureNumLayers_3580ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_3580ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..6434d12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/3580ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureNumLayers_3580ab() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3580ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3580ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl
new file mode 100644
index 0000000..d110c44
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureNumLayers(texture: texture_depth_cube_array) -> u32
+fn textureNumLayers_48ef47() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_48ef47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_48ef47();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..16898b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLayers_48ef47() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_48ef47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_48ef47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..16898b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLayers_48ef47() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_48ef47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_48ef47();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl
new file mode 100644
index 0000000..406b57c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_48ef47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_48ef47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.msl
new file mode 100644
index 0000000..5fd51cb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_48ef47(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_48ef47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_48ef47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_48ef47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e2bf03
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_48ef47 "textureNumLayers_48ef47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_48ef47 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.wgsl
new file mode 100644
index 0000000..c39479b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/48ef47.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureNumLayers_48ef47() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_48ef47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_48ef47();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl
new file mode 100644
index 0000000..5b17e29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> u32
+fn textureNumLayers_4c4333() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_4c4333();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_4c4333();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f4f07a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_4c4333() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_4c4333();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_4c4333();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f4f07a9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_4c4333() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_4c4333();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_4c4333();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl
new file mode 100644
index 0000000..0fef0c7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_4c4333();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_4c4333();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl
new file mode 100644
index 0000000..e7e878d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_4c4333(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_4c4333(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_4c4333(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm
new file mode 100644
index 0000000..942e442
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_4c4333 "textureNumLayers_4c4333"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_4c4333 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl
new file mode 100644
index 0000000..3217266
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/4c4333.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureNumLayers_4c4333() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_4c4333();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_4c4333();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl
deleted file mode 100644
index 740fc82..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> i32
-fn textureNumLayers_562013() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_562013();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_562013();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_562013();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 59664cc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_562013() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_562013();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_562013();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 59664cc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_562013() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_562013();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_562013();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.glsl
deleted file mode 100644
index 713a325..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_562013();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_562013();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.msl
deleted file mode 100644
index 97a5498..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_562013(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_562013(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_562013(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_562013(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.spvasm
deleted file mode 100644
index 96b0fc2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_562013 "textureNumLayers_562013"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_562013 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_562013
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_562013
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_562013
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.wgsl
deleted file mode 100644
index c82f593..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/562013.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
-
-fn textureNumLayers_562013() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_562013();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_562013();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_562013();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl
new file mode 100644
index 0000000..6d37cbd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> u32
+fn textureNumLayers_59eb57() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59eb57();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59eb57();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ac9329
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_59eb57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59eb57();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59eb57();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ac9329
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_59eb57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59eb57();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59eb57();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl
new file mode 100644
index 0000000..5d27d74
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_59eb57();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_59eb57();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl
new file mode 100644
index 0000000..bc42953
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_59eb57(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_59eb57(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_59eb57(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm
new file mode 100644
index 0000000..8fdfad3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_59eb57 "textureNumLayers_59eb57"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_59eb57 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb6df73
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/59eb57.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureNumLayers_59eb57() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59eb57();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59eb57();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl
deleted file mode 100644
index 538aee4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureNumLayers(texture: texture_cube_array<f32>) -> i32
-fn textureNumLayers_5d59cd() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_5d59cd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_5d59cd();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 063ac3b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_5d59cd() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_5d59cd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_5d59cd();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 063ac3b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_5d59cd() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_5d59cd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_5d59cd();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.glsl
deleted file mode 100644
index c469183..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_5d59cd();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_5d59cd();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.msl
deleted file mode 100644
index aa7890e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_5d59cd(texturecube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_5d59cd(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_5d59cd(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_5d59cd(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.spvasm
deleted file mode 100644
index e7f1f9e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_5d59cd = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.wgsl
deleted file mode 100644
index 28bcd65..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/5d59cd.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureNumLayers_5d59cd() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_5d59cd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_5d59cd();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl
new file mode 100644
index 0000000..ef61c18
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> u32
+fn textureNumLayers_61bd23() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_61bd23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_61bd23();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..89f3e18
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_61bd23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_61bd23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_61bd23();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..89f3e18
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_61bd23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_61bd23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_61bd23();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl
new file mode 100644
index 0000000..c709957
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_61bd23();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_61bd23();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl
new file mode 100644
index 0000000..cee795a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_61bd23(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_61bd23(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_61bd23(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm
new file mode 100644
index 0000000..ca56085
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_61bd23 "textureNumLayers_61bd23"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_61bd23 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl
new file mode 100644
index 0000000..9a53a59
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/61bd23.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureNumLayers_61bd23() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_61bd23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_61bd23();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl
deleted file mode 100644
index e7c4f20..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> i32
-fn textureNumLayers_68a65b() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_68a65b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_68a65b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_68a65b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cefd820..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_68a65b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_68a65b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_68a65b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cefd820..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_68a65b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_68a65b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_68a65b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.glsl
deleted file mode 100644
index 38cd9e7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_68a65b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_68a65b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.msl
deleted file mode 100644
index 906ffc5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_68a65b(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_68a65b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_68a65b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_68a65b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.spvasm
deleted file mode 100644
index 53d6ff2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_68a65b "textureNumLayers_68a65b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_68a65b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.wgsl
deleted file mode 100644
index f7cfa50..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/68a65b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
-
-fn textureNumLayers_68a65b() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_68a65b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_68a65b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_68a65b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl
new file mode 100644
index 0000000..31e32f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureNumLayers(texture: texture_cube_array<i32>) -> u32
+fn textureNumLayers_6b4321() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_6b4321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_6b4321();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e6ebad8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_6b4321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_6b4321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_6b4321();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e6ebad8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_6b4321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_6b4321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_6b4321();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl
new file mode 100644
index 0000000..9fd427f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_6b4321();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_6b4321();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.msl
new file mode 100644
index 0000000..ee31186
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_6b4321(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureNumLayers_6b4321(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_6b4321(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_6b4321(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.spvasm
new file mode 100644
index 0000000..3504ed0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_6b4321 "textureNumLayers_6b4321"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_6b4321 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.wgsl
new file mode 100644
index 0000000..952e831
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/6b4321.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLayers_6b4321() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_6b4321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_6b4321();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl
deleted file mode 100644
index 06508d7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureNumLayers(texture: texture_depth_cube_array) -> i32
-fn textureNumLayers_778bd1() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_778bd1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_778bd1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_778bd1();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 198c36b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLayers_778bd1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_778bd1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_778bd1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 198c36b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLayers_778bd1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_778bd1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_778bd1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.glsl
deleted file mode 100644
index 40debcc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_778bd1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_778bd1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.msl
deleted file mode 100644
index fc13fba..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_778bd1(depthcube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_778bd1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_778bd1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_778bd1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.spvasm
deleted file mode 100644
index b1fd36b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_778bd1 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.wgsl
deleted file mode 100644
index 8274e1e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/778bd1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureNumLayers_778bd1() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_778bd1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_778bd1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_778bd1();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl
new file mode 100644
index 0000000..a5ece22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureNumLayers(texture: texture_2d_array<i32>) -> u32
+fn textureNumLayers_77be7b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_77be7b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_77be7b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..baad1e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_77be7b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_77be7b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_77be7b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..baad1e8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_77be7b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_77be7b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_77be7b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl
new file mode 100644
index 0000000..6af1d4b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_77be7b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_77be7b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl
new file mode 100644
index 0000000..bb749fd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureNumLayers_77be7b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_77be7b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_77be7b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5d95de
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_77be7b "textureNumLayers_77be7b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_77be7b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl
new file mode 100644
index 0000000..e61657d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/77be7b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLayers_77be7b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_77be7b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_77be7b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl
deleted file mode 100644
index cf29588..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> i32
-fn textureNumLayers_7f1937() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_7f1937();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_7f1937();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_7f1937();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl
deleted file mode 100644
index edd423a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_7f1937() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_7f1937();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_7f1937();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl
deleted file mode 100644
index edd423a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_7f1937() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_7f1937();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_7f1937();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.glsl
deleted file mode 100644
index f6fdbf0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_7f1937();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_7f1937();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.msl
deleted file mode 100644
index 05239da..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_7f1937(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_7f1937(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_7f1937(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_7f1937(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.spvasm
deleted file mode 100644
index 59d909d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_7f1937 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.wgsl
deleted file mode 100644
index 27ba412..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/7f1937.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
-
-fn textureNumLayers_7f1937() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_7f1937();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_7f1937();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_7f1937();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl
new file mode 100644
index 0000000..9184fe8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> u32
+fn textureNumLayers_7f28cf() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_7f28cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_7f28cf();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ffe3a19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_7f28cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_7f28cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ffe3a19
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_7f28cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_7f28cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl
new file mode 100644
index 0000000..6b98fb4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_7f28cf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_7f28cf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl
new file mode 100644
index 0000000..dfa6427
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_7f28cf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_7f28cf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_7f28cf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..fae74c5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_7f28cf "textureNumLayers_7f28cf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_7f28cf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..9315c01
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/7f28cf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureNumLayers_7f28cf() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_7f28cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_7f28cf();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl
deleted file mode 100644
index 38bb36e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureNumLayers(texture: texture_cube_array<i32>) -> i32
-fn textureNumLayers_85f980() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_85f980();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_85f980();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_85f980();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bd6cdc4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_85f980() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_85f980();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_85f980();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bd6cdc4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_85f980() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_85f980();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_85f980();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.glsl
deleted file mode 100644
index 529bfb3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_85f980();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_85f980();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.msl
deleted file mode 100644
index e1b10eb..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_85f980(texturecube_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureNumLayers_85f980(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_85f980(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_85f980(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.spvasm
deleted file mode 100644
index 4484cad..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_85f980 "textureNumLayers_85f980"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_85f980 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.wgsl
deleted file mode 100644
index 5206f51..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/85f980.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureNumLayers_85f980() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_85f980();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_85f980();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_85f980();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl
new file mode 100644
index 0000000..95d81a8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> u32
+fn textureNumLayers_878dea() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_878dea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_878dea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_878dea();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60c70b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_878dea() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_878dea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_878dea();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60c70b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_878dea() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_878dea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_878dea();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl
new file mode 100644
index 0000000..e29de3e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_878dea();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_878dea();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl
new file mode 100644
index 0000000..7b10509
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_878dea(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_878dea(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_878dea(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm
new file mode 100644
index 0000000..8426d4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_878dea "textureNumLayers_878dea"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_878dea = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl
new file mode 100644
index 0000000..c164c88
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/878dea.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureNumLayers_878dea() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_878dea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_878dea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_878dea();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl
deleted file mode 100644
index b982487..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureNumLayers(texture: texture_2d_array<u32>) -> i32
-fn textureNumLayers_87953e() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_87953e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_87953e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_87953e();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5c563c4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_87953e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_87953e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_87953e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5c563c4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_87953e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_87953e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_87953e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.glsl
deleted file mode 100644
index 83bae63..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_87953e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_87953e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.msl
deleted file mode 100644
index 971482f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_87953e(texture2d_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureNumLayers_87953e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_87953e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_87953e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.spvasm
deleted file mode 100644
index 109f2d0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_87953e "textureNumLayers_87953e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %25 = OpConstantNull %int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_87953e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.wgsl
deleted file mode 100644
index 55d0f9d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/87953e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureNumLayers_87953e() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_87953e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_87953e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_87953e();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl
new file mode 100644
index 0000000..4939ab3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> u32
+fn textureNumLayers_87faad() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_87faad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_87faad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_87faad();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..04ccdcf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_87faad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_87faad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_87faad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..04ccdcf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_87faad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_87faad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_87faad();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl
new file mode 100644
index 0000000..00057ca
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_87faad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_87faad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl
new file mode 100644
index 0000000..acf16b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_87faad(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_87faad(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_87faad(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm
new file mode 100644
index 0000000..4a12d33
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_87faad "textureNumLayers_87faad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_87faad = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcd265c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/87faad.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureNumLayers_87faad() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_87faad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_87faad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_87faad();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl
deleted file mode 100644
index 533a86f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureNumLayers(texture: texture_2d_array<i32>) -> i32
-fn textureNumLayers_893e7c() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_893e7c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_893e7c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_893e7c();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0991385..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_893e7c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_893e7c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_893e7c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0991385..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_893e7c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_893e7c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_893e7c();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.glsl
deleted file mode 100644
index e2d0eb6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_893e7c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_893e7c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.msl
deleted file mode 100644
index 66d329d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_893e7c(texture2d_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureNumLayers_893e7c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_893e7c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_893e7c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.spvasm
deleted file mode 100644
index 22bfd83..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_893e7c "textureNumLayers_893e7c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_893e7c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.wgsl
deleted file mode 100644
index 1ef4610..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/893e7c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureNumLayers_893e7c() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_893e7c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_893e7c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_893e7c();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl
new file mode 100644
index 0000000..b3f969b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureNumLayers(texture: texture_2d_array<u32>) -> u32
+fn textureNumLayers_8ac32a() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8ac32a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8ac32a();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..92e4a10
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_8ac32a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8ac32a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..92e4a10
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_8ac32a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8ac32a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl
new file mode 100644
index 0000000..083cd13
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8ac32a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8ac32a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl
new file mode 100644
index 0000000..218af14
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureNumLayers_8ac32a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8ac32a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8ac32a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm
new file mode 100644
index 0000000..febad27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8ac32a "textureNumLayers_8ac32a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8ac32a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl
new file mode 100644
index 0000000..65a1ae2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8ac32a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLayers_8ac32a() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8ac32a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8ac32a();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl
new file mode 100644
index 0000000..95138eb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> u32
+fn textureNumLayers_8bd987() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8bd987();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8bd987();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dcf3497
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8bd987() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8bd987();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8bd987();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dcf3497
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8bd987() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8bd987();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8bd987();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl
new file mode 100644
index 0000000..9c3f6ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8bd987();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8bd987();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl
new file mode 100644
index 0000000..004cbbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_8bd987(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8bd987(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8bd987(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm
new file mode 100644
index 0000000..bebc91d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8bd987 "textureNumLayers_8bd987"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8bd987 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl
new file mode 100644
index 0000000..7183fb6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8bd987.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureNumLayers_8bd987() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8bd987();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8bd987();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl
new file mode 100644
index 0000000..3f42b29
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> u32
+fn textureNumLayers_8dbf23() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8dbf23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8dbf23();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4f752ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8dbf23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8dbf23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4f752ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8dbf23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8dbf23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl
new file mode 100644
index 0000000..9015e24
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8dbf23();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8dbf23();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl
new file mode 100644
index 0000000..8643e42
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_8dbf23(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8dbf23(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8dbf23(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c3631f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8dbf23 "textureNumLayers_8dbf23"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8dbf23 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl
new file mode 100644
index 0000000..a64feba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/8dbf23.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureNumLayers_8dbf23() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8dbf23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8dbf23();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl
new file mode 100644
index 0000000..d7a18ea
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> u32
+fn textureNumLayers_9695c6() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_9695c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_9695c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ff2f32
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_9695c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_9695c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_9695c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ff2f32
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_9695c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_9695c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_9695c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl
new file mode 100644
index 0000000..f8c145d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_9695c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_9695c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl
new file mode 100644
index 0000000..827321c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_9695c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_9695c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_9695c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d2ffb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_9695c6 "textureNumLayers_9695c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_9695c6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..117a723
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/9695c6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureNumLayers_9695c6() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_9695c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_9695c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl
deleted file mode 100644
index 442d50b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> i32
-fn textureNumLayers_9700fb() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_9700fb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_9700fb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_9700fb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 63205b7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_9700fb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_9700fb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_9700fb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 63205b7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_9700fb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_9700fb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_9700fb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.glsl
deleted file mode 100644
index 24b2d5d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_9700fb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_9700fb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.msl
deleted file mode 100644
index 1b296c7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_9700fb(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_9700fb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_9700fb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_9700fb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.spvasm
deleted file mode 100644
index 4986494..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_9700fb "textureNumLayers_9700fb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_9700fb = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.wgsl
deleted file mode 100644
index d260e36..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/9700fb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
-
-fn textureNumLayers_9700fb() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_9700fb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_9700fb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_9700fb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl
new file mode 100644
index 0000000..b455e68
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> u32
+fn textureNumLayers_98a9cf() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_98a9cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_98a9cf();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..572767c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_98a9cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_98a9cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..572767c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_98a9cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_98a9cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl
new file mode 100644
index 0000000..b8ccb95
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_98a9cf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_98a9cf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl
new file mode 100644
index 0000000..b8c1954
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_98a9cf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_98a9cf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_98a9cf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..1908b56
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_98a9cf "textureNumLayers_98a9cf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_98a9cf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..aa0b1f9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/98a9cf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureNumLayers_98a9cf() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_98a9cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_98a9cf();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl
deleted file mode 100644
index 634b16d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> i32
-fn textureNumLayers_a216d2() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_a216d2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_a216d2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_a216d2();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d9cf500..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_a216d2() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_a216d2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_a216d2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d9cf500..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_a216d2() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_a216d2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_a216d2();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.glsl
deleted file mode 100644
index a6deec3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_a216d2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_a216d2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.msl
deleted file mode 100644
index 427fe4f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_a216d2(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_a216d2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_a216d2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_a216d2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.spvasm
deleted file mode 100644
index 2d82417..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_a216d2 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.wgsl
deleted file mode 100644
index ef09e0b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/a216d2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
-
-fn textureNumLayers_a216d2() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_a216d2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_a216d2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_a216d2();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl
new file mode 100644
index 0000000..9c1cbc6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureNumLayers(texture: texture_depth_2d_array) -> u32
+fn textureNumLayers_a9d3f5() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_a9d3f5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_a9d3f5();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fca4556
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLayers_a9d3f5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_a9d3f5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fca4556
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLayers_a9d3f5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_a9d3f5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl
new file mode 100644
index 0000000..9e5f8bc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_a9d3f5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_a9d3f5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl
new file mode 100644
index 0000000..74a0acb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_a9d3f5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_a9d3f5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_a9d3f5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm
new file mode 100644
index 0000000..7d3120e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_a9d3f5 "textureNumLayers_a9d3f5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_a9d3f5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl
new file mode 100644
index 0000000..83afd90
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/a9d3f5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureNumLayers_a9d3f5() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_a9d3f5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_a9d3f5();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl
new file mode 100644
index 0000000..7d67267
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureNumLayers(texture: texture_cube_array<u32>) -> u32
+fn textureNumLayers_c1eca9() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_c1eca9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_c1eca9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2a8173c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c1eca9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_c1eca9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2a8173c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c1eca9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_c1eca9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl
new file mode 100644
index 0000000..367aaab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_c1eca9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_c1eca9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.msl
new file mode 100644
index 0000000..49ce989
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_c1eca9(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureNumLayers_c1eca9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_c1eca9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_c1eca9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.spvasm
new file mode 100644
index 0000000..a80fd6a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_c1eca9 "textureNumLayers_c1eca9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_c1eca9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd0368e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/c1eca9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLayers_c1eca9() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_c1eca9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_c1eca9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl
deleted file mode 100644
index b58bc74..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> i32
-fn textureNumLayers_cd5dc8() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_cd5dc8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_cd5dc8();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ca5a80c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_cd5dc8() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_cd5dc8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_cd5dc8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ca5a80c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_cd5dc8() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_cd5dc8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_cd5dc8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.glsl
deleted file mode 100644
index 95fdcf4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_cd5dc8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_cd5dc8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.msl
deleted file mode 100644
index bff98ca..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_cd5dc8(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_cd5dc8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_cd5dc8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_cd5dc8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.spvasm
deleted file mode 100644
index 996f85e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_cd5dc8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.wgsl
deleted file mode 100644
index 7fa1228..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/cd5dc8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
-
-fn textureNumLayers_cd5dc8() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_cd5dc8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_cd5dc8();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl
deleted file mode 100644
index 91ac33b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> i32
-fn textureNumLayers_d5b228() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_d5b228();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_d5b228();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_d5b228();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a8c82b0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_d5b228() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_d5b228();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_d5b228();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a8c82b0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_d5b228() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_d5b228();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_d5b228();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.glsl
deleted file mode 100644
index 0daa0a3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_d5b228();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_d5b228();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.msl
deleted file mode 100644
index d2a1011..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_d5b228(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_d5b228(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_d5b228(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_d5b228(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.spvasm
deleted file mode 100644
index 08a45ee..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_d5b228 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.wgsl
deleted file mode 100644
index 9cf3683..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/d5b228.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
-
-fn textureNumLayers_d5b228() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_d5b228();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_d5b228();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_d5b228();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl
new file mode 100644
index 0000000..979ac02
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> u32
+fn textureNumLayers_d75a0b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_d75a0b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_d75a0b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f358a3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_d75a0b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_d75a0b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f358a3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_d75a0b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_d75a0b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl
new file mode 100644
index 0000000..597783b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_d75a0b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_d75a0b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl
new file mode 100644
index 0000000..dfc443c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_d75a0b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_d75a0b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_d75a0b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a3a47f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_d75a0b "textureNumLayers_d75a0b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_d75a0b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5e7e0e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/d75a0b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureNumLayers_d75a0b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_d75a0b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_d75a0b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl
new file mode 100644
index 0000000..647b9db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> u32
+fn textureNumLayers_de8087() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_de8087();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_de8087();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_de8087();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4502c30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_de8087() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_de8087();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_de8087();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4502c30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_de8087() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_de8087();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_de8087();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl
new file mode 100644
index 0000000..6fb197a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_de8087();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_de8087();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl
new file mode 100644
index 0000000..cd677f5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_de8087(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_de8087(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_de8087(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm
new file mode 100644
index 0000000..3065daf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_de8087 "textureNumLayers_de8087"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_de8087 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl
new file mode 100644
index 0000000..fdab8ff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLayers/de8087.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureNumLayers_de8087() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_de8087();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_de8087();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_de8087();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl
deleted file mode 100644
index 5de9836..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> i32
-fn textureNumLayers_e31be1() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e31be1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e31be1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e31be1();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6aca3c5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_e31be1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e31be1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e31be1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6aca3c5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_e31be1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e31be1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e31be1();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.glsl
deleted file mode 100644
index e5e4797..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_e31be1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_e31be1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.msl
deleted file mode 100644
index 3b5b47f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_e31be1(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_e31be1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_e31be1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_e31be1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.spvasm
deleted file mode 100644
index 192aa63..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_e31be1 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.wgsl
deleted file mode 100644
index c930384..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e31be1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
-
-fn textureNumLayers_e31be1() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e31be1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e31be1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e31be1();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl
deleted file mode 100644
index c4a290d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureNumLayers(texture: texture_depth_2d_array) -> i32
-fn textureNumLayers_e653c0() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e653c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e653c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e653c0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 07d21c4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLayers_e653c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e653c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e653c0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 07d21c4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLayers_e653c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e653c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e653c0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.glsl
deleted file mode 100644
index c622a34..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_e653c0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_e653c0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.msl
deleted file mode 100644
index ade75dd..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_e653c0(depth2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_e653c0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_e653c0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_e653c0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.spvasm
deleted file mode 100644
index 52ed923..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_e653c0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.wgsl
deleted file mode 100644
index 601ce1f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/e653c0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureNumLayers_e653c0() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e653c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e653c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e653c0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl
deleted file mode 100644
index f47b3a2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> i32
-fn textureNumLayers_ee942f() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ee942f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ee942f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ee942f();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6b49235..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ee942f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ee942f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ee942f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6b49235..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ee942f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ee942f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ee942f();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.glsl
deleted file mode 100644
index f5996d3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_ee942f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_ee942f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.msl
deleted file mode 100644
index d8f0821..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_ee942f(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_ee942f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_ee942f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_ee942f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.spvasm
deleted file mode 100644
index e0a11d9..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_ee942f "textureNumLayers_ee942f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_ee942f = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.wgsl
deleted file mode 100644
index c6d26dd..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ee942f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
-
-fn textureNumLayers_ee942f() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ee942f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ee942f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ee942f();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl
deleted file mode 100644
index 97533d2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> i32
-fn textureNumLayers_f33005() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_f33005();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_f33005();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_f33005();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4f341b1..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_f33005() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_f33005();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_f33005();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4f341b1..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_f33005() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_f33005();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_f33005();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.glsl
deleted file mode 100644
index 541d029..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_f33005();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_f33005();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.msl
deleted file mode 100644
index d415304..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_f33005(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_f33005(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_f33005(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_f33005(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.spvasm
deleted file mode 100644
index a6a6224..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_f33005 "textureNumLayers_f33005"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_f33005 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.wgsl
deleted file mode 100644
index 8d7eee4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/f33005.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
-
-fn textureNumLayers_f33005() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_f33005();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_f33005();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_f33005();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl
deleted file mode 100644
index eafec6d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> i32
-fn textureNumLayers_fcec98() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_fcec98();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_fcec98();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_fcec98();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5ded29d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_fcec98() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_fcec98();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_fcec98();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5ded29d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_fcec98() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_fcec98();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_fcec98();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.glsl
deleted file mode 100644
index bfaa76f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_fcec98();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_fcec98();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.msl
deleted file mode 100644
index 6233574..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_fcec98(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_fcec98(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_fcec98(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_fcec98(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.spvasm
deleted file mode 100644
index b33d57b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_fcec98 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.wgsl
deleted file mode 100644
index 1c1e179..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/fcec98.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
-
-fn textureNumLayers_fcec98() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_fcec98();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_fcec98();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_fcec98();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl
deleted file mode 100644
index 1c14665..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> i32
-fn textureNumLayers_ff5e89() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ff5e89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ff5e89();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4ff6d2c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ff5e89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ff5e89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ff5e89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4ff6d2c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ff5e89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ff5e89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ff5e89();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.glsl
deleted file mode 100644
index 76ca5cc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_ff5e89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_ff5e89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.msl
deleted file mode 100644
index 2fb0509..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_ff5e89(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_ff5e89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_ff5e89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_ff5e89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.spvasm
deleted file mode 100644
index ae6e277..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_ff5e89 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.wgsl
deleted file mode 100644
index e7b51b4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLayers/ff5e89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
-
-fn textureNumLayers_ff5e89() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ff5e89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ff5e89();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl
deleted file mode 100644
index adec74f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureNumLevels(texture: texture_depth_cube) -> i32
-fn textureNumLevels_076cb5() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_076cb5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_076cb5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_076cb5();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7688db9..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureNumLevels_076cb5() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_076cb5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_076cb5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7688db9..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureNumLevels_076cb5() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_076cb5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_076cb5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.glsl
deleted file mode 100644
index 6b93674..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_076cb5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_076cb5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.msl
deleted file mode 100644
index db09bf4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_076cb5(depthcube<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureNumLevels_076cb5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_076cb5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_076cb5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.spvasm
deleted file mode 100644
index 7b36c19..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_076cb5 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.wgsl
deleted file mode 100644
index 0470c75..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/076cb5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureNumLevels_076cb5() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_076cb5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_076cb5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_076cb5();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl
deleted file mode 100644
index 8ef73a7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureNumLevels(texture: texture_cube<i32>) -> i32
-fn textureNumLevels_080d95() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_080d95();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_080d95();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_080d95();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 633e7be..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_080d95() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_080d95();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_080d95();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 633e7be..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_080d95() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_080d95();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_080d95();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.glsl
deleted file mode 100644
index 367bb7a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_080d95();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_080d95();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.msl
deleted file mode 100644
index c592ea2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_080d95(texturecube<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureNumLevels_080d95(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_080d95(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_080d95(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.spvasm
deleted file mode 100644
index bcbd3c7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_080d95 "textureNumLevels_080d95"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_080d95 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.wgsl
deleted file mode 100644
index f6f058f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/080d95.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureNumLevels_080d95() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_080d95();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_080d95();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_080d95();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl
deleted file mode 100644
index f9f4d80..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureNumLevels(texture: texture_2d<u32>) -> i32
-fn textureNumLevels_09ddd0() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_09ddd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_09ddd0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index fa2c673..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_09ddd0() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_09ddd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_09ddd0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index fa2c673..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_09ddd0() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_09ddd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_09ddd0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.glsl
deleted file mode 100644
index 0691d9b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_09ddd0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_09ddd0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.msl
deleted file mode 100644
index 43e4904..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_09ddd0(texture2d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_09ddd0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_09ddd0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_09ddd0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.spvasm
deleted file mode 100644
index 13e73f5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_09ddd0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.wgsl
deleted file mode 100644
index 4cebcab..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/09ddd0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureNumLevels_09ddd0() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_09ddd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_09ddd0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl
deleted file mode 100644
index 61e6a3f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureNumLevels(texture: texture_2d_array<f32>) -> i32
-fn textureNumLevels_105988() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_105988();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_105988();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_105988();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 608355f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_105988() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_105988();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_105988();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_105988();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 608355f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_105988() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_105988();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_105988();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_105988();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.glsl
deleted file mode 100644
index 90e28da..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_105988();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_105988();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_105988();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.msl
deleted file mode 100644
index c27305e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_105988(texture2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_105988(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_105988(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_105988(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.spvasm
deleted file mode 100644
index fd629e8..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_105988 "textureNumLevels_105988"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_105988 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_105988
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_105988
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_105988
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.wgsl
deleted file mode 100644
index 8eb140d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/105988.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureNumLevels_105988() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_105988();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_105988();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_105988();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl
new file mode 100644
index 0000000..6068edc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureNumLevels(texture: texture_2d_array<u32>) -> u32
+fn textureNumLevels_181090() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_181090();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_181090();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_181090();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fa19226
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_181090() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_181090();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_181090();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fa19226
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_181090() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_181090();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_181090();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.glsl
new file mode 100644
index 0000000..c7664b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_181090();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_181090();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl
new file mode 100644
index 0000000..b685d58
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_181090(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_181090(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_181090(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm
new file mode 100644
index 0000000..b2fba9b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_181090 "textureNumLevels_181090"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_181090 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl
new file mode 100644
index 0000000..cca5c8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/181090.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLevels_181090() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_181090();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_181090();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_181090();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl
new file mode 100644
index 0000000..4aaac8f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureNumLevels(texture: texture_2d<i32>) -> u32
+fn textureNumLevels_1a3fa9() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a3fa9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a3fa9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b613075
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a3fa9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a3fa9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b613075
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a3fa9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a3fa9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.glsl
new file mode 100644
index 0000000..fbcdb5a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_1a3fa9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_1a3fa9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl
new file mode 100644
index 0000000..a5903ae
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_1a3fa9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_1a3fa9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_1a3fa9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm
new file mode 100644
index 0000000..21e699e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_1a3fa9 "textureNumLevels_1a3fa9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_1a3fa9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5ad42c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a3fa9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureNumLevels_1a3fa9() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a3fa9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a3fa9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl
new file mode 100644
index 0000000..f08517f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureNumLevels(texture: texture_1d<u32>) -> u32
+fn textureNumLevels_1a7fc3() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a7fc3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a7fc3();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..72945be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a7fc3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a7fc3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..72945be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a7fc3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a7fc3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.glsl
new file mode 100644
index 0000000..a0dc02a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_1a7fc3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_1a7fc3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl
new file mode 100644
index 0000000..7acfb61
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_1a7fc3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_1a7fc3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_1a7fc3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm
new file mode 100644
index 0000000..0a2fd38
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_1a7fc3 "textureNumLevels_1a7fc3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_1a7fc3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl
new file mode 100644
index 0000000..d092a9f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/1a7fc3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureNumLevels_1a7fc3() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a7fc3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a7fc3();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl
deleted file mode 100644
index ae28bc6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureNumLevels(texture: texture_1d<u32>) -> i32
-fn textureNumLevels_1e6f3b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_1e6f3b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_1e6f3b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 938309a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_1e6f3b() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_1e6f3b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_1e6f3b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 938309a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_1e6f3b() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_1e6f3b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_1e6f3b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.glsl
deleted file mode 100644
index 50f6f13..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_1e6f3b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_1e6f3b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.msl
deleted file mode 100644
index 00356f0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_1e6f3b(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_1e6f3b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_1e6f3b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_1e6f3b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.spvasm
deleted file mode 100644
index 80c21ea..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_1e6f3b "textureNumLevels_1e6f3b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_1e6f3b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.wgsl
deleted file mode 100644
index 58a28d7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/1e6f3b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureNumLevels_1e6f3b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_1e6f3b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_1e6f3b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl
new file mode 100644
index 0000000..6086ab5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureNumLevels(texture: texture_cube<i32>) -> u32
+fn textureNumLevels_2267d8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2267d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2267d8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0ada818
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2267d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2267d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2267d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0ada818
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2267d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2267d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2267d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.glsl
new file mode 100644
index 0000000..8ba1aa1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2267d8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2267d8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl
new file mode 100644
index 0000000..082aa8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureNumLevels_2267d8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2267d8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2267d8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..0f18866
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2267d8 "textureNumLevels_2267d8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2267d8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..5714150
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2267d8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureNumLevels_2267d8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2267d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2267d8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl
deleted file mode 100644
index 046b0a8..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureNumLevels(texture: texture_2d<i32>) -> i32
-fn textureNumLevels_23f750() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_23f750();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_23f750();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_23f750();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 230c77c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_23f750() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_23f750();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_23f750();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 230c77c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_23f750() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_23f750();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_23f750();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.glsl
deleted file mode 100644
index 8b96498..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_23f750();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_23f750();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.msl
deleted file mode 100644
index 571d0a4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_23f750(texture2d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureNumLevels_23f750(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_23f750(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_23f750(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.spvasm
deleted file mode 100644
index 8dd3517..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_23f750 "textureNumLevels_23f750"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_23f750 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.wgsl
deleted file mode 100644
index 1ce13f7..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/23f750.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureNumLevels_23f750() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_23f750();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_23f750();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_23f750();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl
new file mode 100644
index 0000000..1a638e9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureNumLevels(texture: texture_2d<f32>) -> u32
+fn textureNumLevels_24b2c6() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_24b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_24b2c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..47607cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_24b2c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_24b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..47607cf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_24b2c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_24b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.glsl
new file mode 100644
index 0000000..a355d45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_24b2c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_24b2c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl
new file mode 100644
index 0000000..a532f60
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_24b2c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_24b2c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_24b2c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..5e5b33c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_24b2c6 "textureNumLevels_24b2c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_24b2c6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ffcb78
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/24b2c6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureNumLevels_24b2c6() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_24b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_24b2c6();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl
new file mode 100644
index 0000000..07b2473
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureNumLevels(texture: texture_depth_cube_array) -> u32
+fn textureNumLevels_2bea6c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2bea6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2bea6c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..62d1125
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLevels_2bea6c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2bea6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..62d1125
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLevels_2bea6c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2bea6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.glsl
new file mode 100644
index 0000000..2cc5e70
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2bea6c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2bea6c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl
new file mode 100644
index 0000000..480e5f0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_2bea6c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2bea6c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2bea6c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm
new file mode 100644
index 0000000..e4cf270
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2bea6c "textureNumLevels_2bea6c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2bea6c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl
new file mode 100644
index 0000000..b37c0d6
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2bea6c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureNumLevels_2bea6c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2bea6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2bea6c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl
deleted file mode 100644
index 98cf2c6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureNumLevels(texture: texture_depth_cube_array) -> i32
-fn textureNumLevels_2c3575() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_2c3575();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_2c3575();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_2c3575();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 969b67a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLevels_2c3575() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_2c3575();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_2c3575();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 969b67a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLevels_2c3575() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_2c3575();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_2c3575();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.glsl
deleted file mode 100644
index 2de59fc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_2c3575();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_2c3575();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.msl
deleted file mode 100644
index 8f7ed02..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_2c3575(depthcube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_2c3575(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_2c3575(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_2c3575(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.spvasm
deleted file mode 100644
index ef03d8a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_2c3575 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.wgsl
deleted file mode 100644
index 8e01960..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/2c3575.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureNumLevels_2c3575() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_2c3575();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_2c3575();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_2c3575();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl
new file mode 100644
index 0000000..ddc2d13
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureNumLevels(texture: texture_cube<f32>) -> u32
+fn textureNumLevels_2df1ab() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2df1ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2df1ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..10020ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2df1ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2df1ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..10020ec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2df1ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2df1ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.glsl
new file mode 100644
index 0000000..980291b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2df1ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2df1ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl
new file mode 100644
index 0000000..ecf68db
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureNumLevels_2df1ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2df1ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2df1ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..edaef1a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2df1ab "textureNumLevels_2df1ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2df1ab = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..769cb30
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/2df1ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureNumLevels_2df1ab() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2df1ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2df1ab();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl
deleted file mode 100644
index 9773aa4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureNumLevels(texture: texture_1d<i32>) -> i32
-fn textureNumLevels_32a0ae() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_32a0ae();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_32a0ae();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8caa756..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_32a0ae() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_32a0ae();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_32a0ae();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8caa756..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_32a0ae() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_32a0ae();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_32a0ae();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.glsl
deleted file mode 100644
index b0cdc31..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_32a0ae();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_32a0ae();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.msl
deleted file mode 100644
index 11c0362..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_32a0ae(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureNumLevels_32a0ae(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_32a0ae(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_32a0ae(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.spvasm
deleted file mode 100644
index 283d160..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_32a0ae "textureNumLevels_32a0ae"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_32a0ae = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.wgsl
deleted file mode 100644
index 13377ce..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/32a0ae.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureNumLevels_32a0ae() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_32a0ae();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_32a0ae();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl
new file mode 100644
index 0000000..9da74a3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureNumLevels(texture: texture_2d_array<f32>) -> u32
+fn textureNumLevels_46dbd8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_46dbd8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_46dbd8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..496e96a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_46dbd8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_46dbd8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..496e96a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_46dbd8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_46dbd8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.glsl
new file mode 100644
index 0000000..bf08402
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_46dbd8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_46dbd8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl
new file mode 100644
index 0000000..e8b2b34
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_46dbd8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_46dbd8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_46dbd8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ddaa69f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_46dbd8 "textureNumLevels_46dbd8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_46dbd8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2e380d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/46dbd8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLevels_46dbd8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_46dbd8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_46dbd8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl
deleted file mode 100644
index d92d07f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureNumLevels(texture: texture_2d_array<u32>) -> i32
-fn textureNumLevels_5101cf() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_5101cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_5101cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_5101cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f638579..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_5101cf() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_5101cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_5101cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f638579..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_5101cf() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_5101cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_5101cf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.glsl
deleted file mode 100644
index e372765..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_5101cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_5101cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.msl
deleted file mode 100644
index 4a17faa..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_5101cf(texture2d_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureNumLevels_5101cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_5101cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_5101cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.spvasm
deleted file mode 100644
index 321f409..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_5101cf "textureNumLevels_5101cf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_5101cf = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.wgsl
deleted file mode 100644
index 3425bb2..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/5101cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureNumLevels_5101cf() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_5101cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_5101cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_5101cf();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl
deleted file mode 100644
index ec4aa99..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureNumLevels(texture: texture_1d<f32>) -> i32
-fn textureNumLevels_51b5bb() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_51b5bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_51b5bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e41c4df..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_51b5bb() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_51b5bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_51b5bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e41c4df..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_51b5bb() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_51b5bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_51b5bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.glsl
deleted file mode 100644
index 8969352..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_51b5bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_51b5bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.msl
deleted file mode 100644
index 7acc809..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_51b5bb(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureNumLevels_51b5bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_51b5bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_51b5bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.spvasm
deleted file mode 100644
index 2fa2c76..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_51b5bb "textureNumLevels_51b5bb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_51b5bb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.wgsl
deleted file mode 100644
index 71883b0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/51b5bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureNumLevels_51b5bb() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_51b5bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_51b5bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl
new file mode 100644
index 0000000..3de5217
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureNumLevels(texture: texture_3d<u32>) -> u32
+fn textureNumLevels_60d9b8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_60d9b8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_60d9b8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..354f39f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_60d9b8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_60d9b8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..354f39f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_60d9b8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_60d9b8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.glsl
new file mode 100644
index 0000000..4709283
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_60d9b8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_60d9b8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl
new file mode 100644
index 0000000..663fb4b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_60d9b8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_60d9b8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_60d9b8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm
new file mode 100644
index 0000000..3aed187
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_60d9b8 "textureNumLevels_60d9b8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_60d9b8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl
new file mode 100644
index 0000000..70615e2
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/60d9b8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureNumLevels_60d9b8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_60d9b8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_60d9b8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl
deleted file mode 100644
index 5c1e1a3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureNumLevels(texture: texture_cube<f32>) -> i32
-fn textureNumLevels_897aaf() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_897aaf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_897aaf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_897aaf();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1dc79b1..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_897aaf() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_897aaf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_897aaf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1dc79b1..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_897aaf() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_897aaf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_897aaf();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.glsl
deleted file mode 100644
index f7d707e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_897aaf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_897aaf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.msl
deleted file mode 100644
index 5f6ffc4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_897aaf(texturecube<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureNumLevels_897aaf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_897aaf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_897aaf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.spvasm
deleted file mode 100644
index 2daa6e8..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_897aaf "textureNumLevels_897aaf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_897aaf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.wgsl
deleted file mode 100644
index 473da66..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/897aaf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureNumLevels_897aaf() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_897aaf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_897aaf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_897aaf();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl
new file mode 100644
index 0000000..178aec9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureNumLevels(texture: texture_cube_array<i32>) -> u32
+fn textureNumLevels_903920() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_903920();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_903920();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_903920();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c70af53
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_903920() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_903920();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_903920();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c70af53
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_903920() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_903920();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_903920();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.glsl
new file mode 100644
index 0000000..337fd1f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_903920();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_903920();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl
new file mode 100644
index 0000000..883fee7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureNumLevels_903920(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_903920(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_903920(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm
new file mode 100644
index 0000000..ac2e7d7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_903920 "textureNumLevels_903920"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_903920 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl
new file mode 100644
index 0000000..b924f23
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/903920.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLevels_903920() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_903920();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_903920();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_903920();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl
new file mode 100644
index 0000000..410ef17
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureNumLevels(texture: texture_3d<i32>) -> u32
+fn textureNumLevels_9a1a65() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_9a1a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_9a1a65();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9c9b0cd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_9a1a65() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_9a1a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9c9b0cd
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_9a1a65() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_9a1a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.glsl
new file mode 100644
index 0000000..5f05e9a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_9a1a65();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_9a1a65();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl
new file mode 100644
index 0000000..548d2fa
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_9a1a65(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_9a1a65(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_9a1a65(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm
new file mode 100644
index 0000000..c308aff
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_9a1a65 "textureNumLevels_9a1a65"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_9a1a65 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl
new file mode 100644
index 0000000..e6d5452
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/9a1a65.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureNumLevels_9a1a65() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_9a1a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_9a1a65();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl
deleted file mode 100644
index a297fa0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureNumLevels(texture: texture_3d<i32>) -> i32
-fn textureNumLevels_9da7a5() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_9da7a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_9da7a5();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 621c547..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_9da7a5() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_9da7a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_9da7a5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 621c547..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_9da7a5() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_9da7a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_9da7a5();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.glsl
deleted file mode 100644
index 83706c6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_9da7a5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_9da7a5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.msl
deleted file mode 100644
index f813901..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_9da7a5(texture3d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureNumLevels_9da7a5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_9da7a5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_9da7a5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.spvasm
deleted file mode 100644
index 522fe68..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_9da7a5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.wgsl
deleted file mode 100644
index 13135d5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/9da7a5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureNumLevels_9da7a5() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_9da7a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_9da7a5();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl
deleted file mode 100644
index 2d2b3e9..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureNumLevels(texture: texture_cube_array<i32>) -> i32
-fn textureNumLevels_a91c03() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_a91c03();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_a91c03();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_a91c03();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 97c379d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_a91c03() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_a91c03();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_a91c03();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 97c379d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_a91c03() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_a91c03();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_a91c03();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.glsl
deleted file mode 100644
index 684bc1b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_a91c03();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_a91c03();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.msl
deleted file mode 100644
index 4a151f0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_a91c03(texturecube_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureNumLevels_a91c03(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_a91c03(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_a91c03(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.spvasm
deleted file mode 100644
index ba04989..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_a91c03 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.wgsl
deleted file mode 100644
index 69e569b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/a91c03.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureNumLevels_a91c03() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_a91c03();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_a91c03();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_a91c03();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl
new file mode 100644
index 0000000..19188f3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureNumLevels(texture: texture_2d_array<i32>) -> u32
+fn textureNumLevels_adc783() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_adc783();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_adc783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_adc783();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2ec43ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_adc783() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_adc783();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_adc783();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2ec43ed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_adc783() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_adc783();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_adc783();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.glsl
new file mode 100644
index 0000000..2eab57c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_adc783();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_adc783();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl
new file mode 100644
index 0000000..47f6910
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureNumLevels_adc783(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_adc783(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_adc783(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm
new file mode 100644
index 0000000..30e6a8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_adc783 "textureNumLevels_adc783"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_adc783 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl
new file mode 100644
index 0000000..b9595bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/adc783.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLevels_adc783() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_adc783();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_adc783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_adc783();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl
new file mode 100644
index 0000000..f279f4d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureNumLevels(texture: texture_depth_2d_array) -> u32
+fn textureNumLevels_ae911c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ae911c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ae911c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f17da78
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLevels_ae911c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ae911c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ae911c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f17da78
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLevels_ae911c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ae911c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ae911c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.glsl
new file mode 100644
index 0000000..93d9256
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_ae911c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_ae911c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl
new file mode 100644
index 0000000..24d1b4a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_ae911c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_ae911c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_ae911c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c50b3b7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_ae911c "textureNumLevels_ae911c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_ae911c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl
new file mode 100644
index 0000000..de4db0c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ae911c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureNumLevels_ae911c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ae911c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ae911c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl
deleted file mode 100644
index 3f14e55..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureNumLevels(texture: texture_cube_array<f32>) -> i32
-fn textureNumLevels_aee7c8() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_aee7c8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_aee7c8();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6511a2d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_aee7c8() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_aee7c8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_aee7c8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6511a2d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_aee7c8() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_aee7c8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_aee7c8();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.glsl
deleted file mode 100644
index 6fbe762..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_aee7c8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_aee7c8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.msl
deleted file mode 100644
index a4627cd..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_aee7c8(texturecube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_aee7c8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_aee7c8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_aee7c8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.spvasm
deleted file mode 100644
index d5f9d13..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_aee7c8 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.wgsl
deleted file mode 100644
index a9336a0..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/aee7c8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureNumLevels_aee7c8() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_aee7c8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_aee7c8();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl
deleted file mode 100644
index 9f8cbc5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureNumLevels(texture: texture_depth_2d) -> i32
-fn textureNumLevels_b1b12b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b1b12b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b1b12b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cd908dc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureNumLevels_b1b12b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b1b12b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b1b12b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cd908dc..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureNumLevels_b1b12b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b1b12b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b1b12b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.glsl
deleted file mode 100644
index 2a2119a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_b1b12b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_b1b12b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.msl
deleted file mode 100644
index cdda66a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_b1b12b(depth2d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureNumLevels_b1b12b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_b1b12b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_b1b12b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.spvasm
deleted file mode 100644
index dcd4a66..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_b1b12b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.wgsl
deleted file mode 100644
index cfb7e4b..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureNumLevels_b1b12b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b1b12b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b1b12b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl
deleted file mode 100644
index 978bbde..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureNumLevels(texture: texture_3d<u32>) -> i32
-fn textureNumLevels_b4f5ea() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b4f5ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b4f5ea();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 92162ad..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_b4f5ea() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b4f5ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b4f5ea();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 92162ad..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_b4f5ea() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b4f5ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b4f5ea();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.glsl
deleted file mode 100644
index a857a8a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_b4f5ea();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_b4f5ea();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.msl
deleted file mode 100644
index 8c251ea..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_b4f5ea(texture3d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_b4f5ea(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_b4f5ea(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_b4f5ea(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.spvasm
deleted file mode 100644
index 6508bca..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_b4f5ea = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.wgsl
deleted file mode 100644
index d1f829a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/b4f5ea.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureNumLevels_b4f5ea() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b4f5ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b4f5ea();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl
new file mode 100644
index 0000000..c2befb8
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureNumLevels(texture: texture_cube<u32>) -> u32
+fn textureNumLevels_c386c8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c386c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c386c8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..09ec1bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c386c8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c386c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c386c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..09ec1bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c386c8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c386c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c386c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.glsl
new file mode 100644
index 0000000..f5f25b1
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c386c8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c386c8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl
new file mode 100644
index 0000000..0aa6d50
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_c386c8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c386c8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c386c8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ae0b33e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c386c8 "textureNumLevels_c386c8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c386c8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl
new file mode 100644
index 0000000..a5df507
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c386c8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureNumLevels_c386c8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c386c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c386c8();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl
new file mode 100644
index 0000000..81e95be
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureNumLevels(texture: texture_1d<f32>) -> u32
+fn textureNumLevels_c399f9() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c399f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c399f9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b0e7a2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c399f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c399f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c399f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b0e7a2c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c399f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c399f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c399f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.glsl
new file mode 100644
index 0000000..91caecf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c399f9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c399f9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl
new file mode 100644
index 0000000..1b81eda
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_c399f9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c399f9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c399f9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad86c06
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c399f9 "textureNumLevels_c399f9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c399f9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl
new file mode 100644
index 0000000..b3bd844
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c399f9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureNumLevels_c399f9() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c399f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c399f9();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl
new file mode 100644
index 0000000..814ecdf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureNumLevels(texture: texture_depth_cube) -> u32
+fn textureNumLevels_c8c25c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c8c25c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c8c25c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..82cd2ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureNumLevels_c8c25c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c8c25c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..82cd2ba
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureNumLevels_c8c25c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c8c25c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.glsl
new file mode 100644
index 0000000..a2e9ed3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c8c25c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c8c25c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl
new file mode 100644
index 0000000..3373867
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureNumLevels_c8c25c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c8c25c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c8c25c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm
new file mode 100644
index 0000000..302f9ab
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c8c25c "textureNumLevels_c8c25c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c8c25c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl
new file mode 100644
index 0000000..e04b76d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/c8c25c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureNumLevels_c8c25c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c8c25c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c8c25c();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl
deleted file mode 100644
index 17c58e1..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureNumLevels(texture: texture_2d_array<i32>) -> i32
-fn textureNumLevels_d004a9() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_d004a9();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_d004a9();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_d004a9();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 34731d5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_d004a9() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_d004a9();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_d004a9();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 34731d5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_d004a9() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_d004a9();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_d004a9();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.glsl
deleted file mode 100644
index 926ded3..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_d004a9();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_d004a9();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.msl
deleted file mode 100644
index d0d19fe..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_d004a9(texture2d_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureNumLevels_d004a9(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_d004a9(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_d004a9(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.spvasm
deleted file mode 100644
index 48fe3de..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_d004a9 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.wgsl
deleted file mode 100644
index ce8d24d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/d004a9.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureNumLevels_d004a9() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_d004a9();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_d004a9();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_d004a9();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl
new file mode 100644
index 0000000..dac0818
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureNumLevels(texture: texture_depth_2d) -> u32
+fn textureNumLevels_d63126() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d63126();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d63126();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d63126();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3ff9634
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureNumLevels_d63126() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d63126();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d63126();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3ff9634
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureNumLevels_d63126() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d63126();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d63126();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.glsl
new file mode 100644
index 0000000..1c2e0fc
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_d63126();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_d63126();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl
new file mode 100644
index 0000000..dbfdf59
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_d63126(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_d63126(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_d63126(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm
new file mode 100644
index 0000000..897b81c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_d63126 "textureNumLevels_d63126"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_d63126 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl
new file mode 100644
index 0000000..29d43d5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d63126.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureNumLevels_d63126() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d63126();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d63126();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d63126();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl
new file mode 100644
index 0000000..fc67fd5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureNumLevels(texture: texture_cube_array<f32>) -> u32
+fn textureNumLevels_d8f73b() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d8f73b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d8f73b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..168d30f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_d8f73b() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d8f73b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..168d30f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_d8f73b() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d8f73b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.glsl
new file mode 100644
index 0000000..642af9e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_d8f73b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_d8f73b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl
new file mode 100644
index 0000000..235bcec
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_d8f73b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_d8f73b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_d8f73b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm
new file mode 100644
index 0000000..aac36d9
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_d8f73b "textureNumLevels_d8f73b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_d8f73b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl
new file mode 100644
index 0000000..3aa9f91
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/d8f73b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLevels_d8f73b() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d8f73b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d8f73b();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl
deleted file mode 100644
index e7b032c..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureNumLevels(texture: texture_3d<f32>) -> i32
-fn textureNumLevels_dca09e() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_dca09e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_dca09e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_dca09e();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 01307a4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_dca09e() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_dca09e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_dca09e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 01307a4..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_dca09e() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_dca09e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_dca09e();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.glsl
deleted file mode 100644
index ba0c815..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_dca09e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_dca09e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.msl
deleted file mode 100644
index e7813c5..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_dca09e(texture3d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureNumLevels_dca09e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_dca09e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_dca09e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.spvasm
deleted file mode 100644
index 3ee917e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_dca09e "textureNumLevels_dca09e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_dca09e = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.wgsl
deleted file mode 100644
index d5e1e54..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/dca09e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureNumLevels_dca09e() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_dca09e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_dca09e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_dca09e();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl
deleted file mode 100644
index bfec435..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureNumLevels(texture: texture_2d<f32>) -> i32
-fn textureNumLevels_e67231() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_e67231();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_e67231();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_e67231();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a6f8a6f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_e67231() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_e67231();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_e67231();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a6f8a6f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_e67231() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_e67231();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_e67231();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.glsl
deleted file mode 100644
index 5345038..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_e67231();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_e67231();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.msl
deleted file mode 100644
index 0a9f1ef..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_e67231(texture2d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureNumLevels_e67231(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_e67231(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_e67231(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.spvasm
deleted file mode 100644
index f2974bb..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_e67231 "textureNumLevels_e67231"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_e67231 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.wgsl
deleted file mode 100644
index a42349d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/e67231.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureNumLevels_e67231() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_e67231();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_e67231();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_e67231();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl
deleted file mode 100644
index 9ad4dca..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureNumLevels(texture: texture_cube<u32>) -> i32
-fn textureNumLevels_ed078b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_ed078b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_ed078b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_ed078b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 75d40ea..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_ed078b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_ed078b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_ed078b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 75d40ea..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_ed078b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_ed078b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_ed078b();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.glsl
deleted file mode 100644
index 3293d1e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_ed078b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_ed078b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.msl
deleted file mode 100644
index 74d6563..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_ed078b(texturecube<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureNumLevels_ed078b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_ed078b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_ed078b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.spvasm
deleted file mode 100644
index 78cf143..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_ed078b "textureNumLevels_ed078b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_ed078b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.wgsl
deleted file mode 100644
index 3a95130..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/ed078b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureNumLevels_ed078b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_ed078b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_ed078b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_ed078b();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl
new file mode 100644
index 0000000..3904443
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureNumLevels(texture: texture_3d<f32>) -> u32
+fn textureNumLevels_ef7944() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ef7944();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ef7944();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4b71eed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_ef7944() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ef7944();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ef7944();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4b71eed
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_ef7944() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ef7944();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ef7944();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.glsl
new file mode 100644
index 0000000..3e6a49a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_ef7944();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_ef7944();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl
new file mode 100644
index 0000000..e63ad5f
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_ef7944(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_ef7944(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_ef7944(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1b27b3
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_ef7944 "textureNumLevels_ef7944"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_ef7944 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl
new file mode 100644
index 0000000..cdf4c05
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/ef7944.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureNumLevels_ef7944() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ef7944();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ef7944();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl
new file mode 100644
index 0000000..3304810
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureNumLevels(texture: texture_2d<u32>) -> u32
+fn textureNumLevels_efd6df() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_efd6df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_efd6df();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d053690
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_efd6df() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_efd6df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_efd6df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d053690
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_efd6df() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_efd6df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_efd6df();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.glsl
new file mode 100644
index 0000000..21c3943
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_efd6df();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_efd6df();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl
new file mode 100644
index 0000000..d0e4baf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_efd6df(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_efd6df(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_efd6df(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm
new file mode 100644
index 0000000..818380b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_efd6df "textureNumLevels_efd6df"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_efd6df = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl
new file mode 100644
index 0000000..2f962e4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/efd6df.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureNumLevels_efd6df() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_efd6df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_efd6df();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl
deleted file mode 100644
index f32f53f..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureNumLevels(texture: texture_cube_array<u32>) -> i32
-fn textureNumLevels_f46ec6() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f46ec6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f46ec6();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3a16309..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_f46ec6() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f46ec6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f46ec6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3a16309..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_f46ec6() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f46ec6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f46ec6();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.glsl
deleted file mode 100644
index 1da3a81..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_f46ec6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_f46ec6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.msl
deleted file mode 100644
index 83873b6..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_f46ec6(texturecube_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureNumLevels_f46ec6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_f46ec6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_f46ec6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.spvasm
deleted file mode 100644
index 7650c28..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_f46ec6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.wgsl
deleted file mode 100644
index b162138..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f46ec6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureNumLevels_f46ec6() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f46ec6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f46ec6();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl
deleted file mode 100644
index 009134e..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureNumLevels(texture: texture_depth_2d_array) -> i32
-fn textureNumLevels_f5828d() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f5828d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f5828d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f5828d();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 05d604d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLevels_f5828d() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f5828d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f5828d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 05d604d..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLevels_f5828d() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f5828d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f5828d();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.glsl
deleted file mode 100644
index e810a1a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_f5828d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_f5828d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.msl
deleted file mode 100644
index 0a15025..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_f5828d(depth2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_f5828d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_f5828d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_f5828d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.spvasm
deleted file mode 100644
index 6af2f4a..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_f5828d "textureNumLevels_f5828d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_f5828d = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.wgsl
deleted file mode 100644
index 02fdd80..0000000
--- a/test/tint/builtins/gen/literal/textureNumLevels/f5828d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureNumLevels_f5828d() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f5828d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f5828d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f5828d();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl
new file mode 100644
index 0000000..8dbf86d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureNumLevels(texture: texture_1d<i32>) -> u32
+fn textureNumLevels_f742c0() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_f742c0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_f742c0();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e909b27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_f742c0() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_f742c0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f742c0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e909b27
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_f742c0() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_f742c0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f742c0();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.glsl
new file mode 100644
index 0000000..c34994e
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_f742c0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_f742c0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl
new file mode 100644
index 0000000..e4bd743
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_f742c0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_f742c0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_f742c0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..2cbb0e7
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_f742c0 "textureNumLevels_f742c0"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_f742c0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..37f7f4c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/f742c0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureNumLevels_f742c0() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_f742c0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_f742c0();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl
new file mode 100644
index 0000000..2a5c129
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureNumLevels(texture: texture_cube_array<u32>) -> u32
+fn textureNumLevels_fe2171() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_fe2171();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_fe2171();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..622e968
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_fe2171() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_fe2171();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_fe2171();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..622e968
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_fe2171() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_fe2171();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_fe2171();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.glsl
new file mode 100644
index 0000000..f768306
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_fe2171();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_fe2171();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl
new file mode 100644
index 0000000..a8221bf
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_fe2171(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_fe2171(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_fe2171(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm
new file mode 100644
index 0000000..1382ffe
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_fe2171 "textureNumLevels_fe2171"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_fe2171 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl
new file mode 100644
index 0000000..8a0ab54
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumLevels/fe2171.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLevels_fe2171() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_fe2171();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_fe2171();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl
deleted file mode 100644
index 208dec8..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> i32
-fn textureNumSamples_2c6f14() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_2c6f14();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_2c6f14();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6c3feaf..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_2c6f14() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_2c6f14();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_2c6f14();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6c3feaf..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_2c6f14() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_2c6f14();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_2c6f14();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.glsl
deleted file mode 100644
index 5abe128..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_2c6f14();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_2c6f14();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.msl
deleted file mode 100644
index b062129..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_2c6f14(texture2d_ms<float, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
- textureNumSamples_2c6f14(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_2c6f14(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_2c6f14(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.spvasm
deleted file mode 100644
index f1b55e4..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_2c6f14 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySamples %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.wgsl
deleted file mode 100644
index 460b4e2..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/2c6f14.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
-
-fn textureNumSamples_2c6f14() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_2c6f14();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_2c6f14();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl
deleted file mode 100644
index a308412..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> i32
-fn textureNumSamples_42f8bb() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_42f8bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_42f8bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 415abda..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureNumSamples_42f8bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_42f8bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_42f8bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 415abda..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureNumSamples_42f8bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_42f8bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_42f8bb();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.glsl
deleted file mode 100644
index 8a06334..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_42f8bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_42f8bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.msl
deleted file mode 100644
index d951a7e..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_42f8bb(texture2d_ms<uint, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
- textureNumSamples_42f8bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_42f8bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_42f8bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.spvasm
deleted file mode 100644
index a8b6504..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_42f8bb = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySamples %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.wgsl
deleted file mode 100644
index e62f047..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/42f8bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
-
-fn textureNumSamples_42f8bb() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_42f8bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_42f8bb();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl
deleted file mode 100644
index 9680606..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> i32
-fn textureNumSamples_449d23() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_449d23();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_449d23();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_449d23();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4dbf2f0..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureNumSamples_449d23() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_449d23();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_449d23();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4dbf2f0..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureNumSamples_449d23() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_449d23();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_449d23();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.glsl
deleted file mode 100644
index 2b60dd5..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_449d23();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_449d23();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.msl
deleted file mode 100644
index 18e0ad7..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_449d23(texture2d_ms<int, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
- textureNumSamples_449d23(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_449d23(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_449d23(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.spvasm
deleted file mode 100644
index f89f901..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_449d23 "textureNumSamples_449d23"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_449d23 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySamples %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.wgsl
deleted file mode 100644
index 0c9fd1f..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/449d23.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
-
-fn textureNumSamples_449d23() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_449d23();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_449d23();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_449d23();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl
new file mode 100644
index 0000000..47d2f3d
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> u32
+fn textureNumSamples_50f399() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_50f399();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_50f399();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_50f399();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bfe4d22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureNumSamples_50f399() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_50f399();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_50f399();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bfe4d22
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureNumSamples_50f399() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_50f399();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_50f399();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.glsl
new file mode 100644
index 0000000..d971b8c
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_50f399();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_50f399();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl
new file mode 100644
index 0000000..4de37b0
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureNumSamples_50f399(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_50f399(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_50f399(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm
new file mode 100644
index 0000000..57be983
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_50f399 "textureNumSamples_50f399"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_50f399 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySamples %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl
new file mode 100644
index 0000000..a2d6199
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/50f399.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureNumSamples_50f399() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_50f399();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_50f399();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_50f399();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl
deleted file mode 100644
index bddc529..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
-
-// fn textureNumSamples(texture: texture_depth_multisampled_2d) -> i32
-fn textureNumSamples_a3c8a0() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_a3c8a0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_a3c8a0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0eb375a..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_a3c8a0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_a3c8a0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_a3c8a0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0eb375a..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_a3c8a0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_a3c8a0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_a3c8a0();
- return;
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.glsl
deleted file mode 100644
index 826c680..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_a3c8a0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_a3c8a0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.msl
deleted file mode 100644
index c3db04e..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_a3c8a0(depth2d_ms<float, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
- textureNumSamples_a3c8a0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_a3c8a0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_a3c8a0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.spvasm
deleted file mode 100644
index a6f64b1..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_a3c8a0 "textureNumSamples_a3c8a0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_a3c8a0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySamples %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.wgsl
deleted file mode 100644
index c78e101..0000000
--- a/test/tint/builtins/gen/literal/textureNumSamples/a3c8a0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
-
-fn textureNumSamples_a3c8a0() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_a3c8a0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_a3c8a0();
-}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl
new file mode 100644
index 0000000..dbae081
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> u32
+fn textureNumSamples_c1a777() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_c1a777();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_c1a777();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4998404
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureNumSamples_c1a777() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_c1a777();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_c1a777();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4998404
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureNumSamples_c1a777() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_c1a777();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_c1a777();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.glsl
new file mode 100644
index 0000000..1c6ab36
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_c1a777();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_c1a777();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl
new file mode 100644
index 0000000..a8cdede
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureNumSamples_c1a777(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_c1a777(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_c1a777(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb9cc2a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_c1a777 "textureNumSamples_c1a777"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_c1a777 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySamples %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl
new file mode 100644
index 0000000..564ccf5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/c1a777.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureNumSamples_c1a777() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_c1a777();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_c1a777();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl
new file mode 100644
index 0000000..5c9fcbb
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> u32
+fn textureNumSamples_dbb799() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_dbb799();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_dbb799();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1878090
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_dbb799() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_dbb799();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_dbb799();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1878090
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_dbb799() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_dbb799();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_dbb799();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.glsl
new file mode 100644
index 0000000..642c5e5
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_dbb799();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_dbb799();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl
new file mode 100644
index 0000000..2d6f774
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureNumSamples_dbb799(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_dbb799(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_dbb799(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm
new file mode 100644
index 0000000..b48af47
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_dbb799 "textureNumSamples_dbb799"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_dbb799 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySamples %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl
new file mode 100644
index 0000000..79ad99b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/dbb799.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureNumSamples_dbb799() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_dbb799();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_dbb799();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl
new file mode 100644
index 0000000..9389a95
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32
+fn textureNumSamples_ecd321() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_ecd321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_ecd321();
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9015e45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_ecd321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_ecd321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_ecd321();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9015e45
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_ecd321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_ecd321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_ecd321();
+ return;
+}
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.glsl
new file mode 100644
index 0000000..746dd12
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_ecd321();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_ecd321();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl
new file mode 100644
index 0000000..95ee5b4
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureNumSamples_ecd321(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_ecd321(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_ecd321(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm
new file mode 100644
index 0000000..41ea05b
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_ecd321 "textureNumSamples_ecd321"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_ecd321 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySamples %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl
new file mode 100644
index 0000000..881972a
--- /dev/null
+++ b/test/tint/builtins/gen/literal/textureNumSamples/ecd321.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureNumSamples_ecd321() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_ecd321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_ecd321();
+}
diff --git a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
index 90fce86..99f28fb 100644
--- a/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/0dff6c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
index f3caea4..75d604c 100644
--- a/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/17e988.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
index 71df6c5..ccab6e5 100644
--- a/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/2149ec.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
index 03480aa..373481c 100644
--- a/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/38bbb9.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
index 897a54c..bbfc116 100644
--- a/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/3b50bd.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
index d1f689c..2bb8379 100644
--- a/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/4dd1bf.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
index cd0e902..e3eed03 100644
--- a/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/51b514.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
index df45e49..b6c5824 100644
--- a/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/60bf45.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
index b58ee34..a4919ef 100644
--- a/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6717ca.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
index 3fb9705..20676b9 100644
--- a/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/6e64fb.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
index c043255..f774b5e 100644
--- a/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/7e9ffd.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
index a4fb732..da9893c 100644
--- a/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/85c4ba.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
index 536ecb2..94a4b8c 100644
--- a/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/c2f4e8.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
index dafb3ae..35b2e9e 100644
--- a/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/e53267.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
index 0a0eadc..d35b7a4 100644
--- a/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
+++ b/test/tint/builtins/gen/literal/textureSample/ea7030.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
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 4d4b0ee..8bc33df 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -33,10 +33,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
@@ -110,10 +110,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
@@ -181,10 +181,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
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 0379375..70af2f8 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -43,10 +43,10 @@
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
- float2 const plane0_dims = float2(int2(plane0.get_width(0), plane0.get_height(0)));
+ float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0)));
float2 const plane0_half_texel = (float2(0.5f) / plane0_dims);
float2 const plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- float2 const plane1_dims = float2(int2(plane1.get_width(0), plane1.get_height(0)));
+ float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0)));
float2 const plane1_half_texel = (float2(0.5f) / plane1_dims);
float2 const plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = 0.0f;
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 ec3e590..9490a32 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -114,8 +114,8 @@
%45 = OpConstantNull %v3float
%v2float = OpTypeVector %float 2
%65 = OpTypeFunction %v4float %11 %11 %24 %v2float %ExternalTextureParams
+ %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
%78 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5
%80 = OpConstantComposite %v2float %float_0_5 %float_0_5
@@ -177,14 +177,14 @@
%85 = OpVariable %_ptr_Function_v2float Function %87
%94 = OpVariable %_ptr_Function_v2float Function %87
%color = OpVariable %_ptr_Function_v3float Function %45
- %75 = OpImageQuerySizeLod %v2int %plane0 %78
- %74 = OpConvertSToF %v2float %75
+ %75 = OpImageQuerySizeLod %v2uint %plane0 %78
+ %74 = OpConvertUToF %v2float %75
%81 = OpFDiv %v2float %80 %74
%88 = OpCompositeConstruct %v2float %float_1 %float_1
%84 = OpFSub %v2float %88 %81
%82 = OpExtInst %v2float %31 NClamp %coord %81 %84
- %90 = OpImageQuerySizeLod %v2int %plane1 %78
- %89 = OpConvertSToF %v2float %90
+ %90 = OpImageQuerySizeLod %v2uint %plane1 %78
+ %89 = OpConvertUToF %v2float %90
%91 = OpFDiv %v2float %80 %89
%95 = OpCompositeConstruct %v2float %float_1 %float_1
%93 = OpFSub %v2float %95 %91
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
index 7db5473..baa94b2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
@@ -2,7 +2,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
@@ -32,7 +32,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
@@ -56,7 +56,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
index f0f7da3..221a88d 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
float4 tint_textureSampleBaseClampToEdge(texture2d<float, access::sample> t, sampler s, float2 coord) {
- float2 const dims = float2(int2(t.get_width(0), t.get_height(0)));
+ float2 const dims = float2(uint2(t.get_width(0), t.get_height(0)));
float2 const half_texel = (float2(0.5f) / dims);
float2 const clamped = clamp(coord, half_texel, (1.0f - half_texel));
return t.sample(s, clamped, level(0.0f));
diff --git a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
index 29da434..154fae2 100644
--- a/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/literal/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 63
+; Bound: 64
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
- %31 = OpExtInstImport "GLSL.std.450"
+ %32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -48,63 +48,64 @@
%arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
%v2float = OpTypeVector %float 2
%15 = OpTypeFunction %v4float %11 %14 %v2float
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %26 = OpConstantNull %int
+ %27 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5
- %28 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %29 = OpConstantComposite %v2float %float_0_5 %float_0_5
%float_1 = OpConstant %float 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %36 = OpConstantNull %v2float
- %39 = OpTypeSampledImage %11
+ %37 = OpConstantNull %v2float
+ %40 = OpTypeSampledImage %11
%void = OpTypeVoid
- %41 = OpTypeFunction %void
+ %42 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %50 = OpTypeFunction %v4float
+ %51 = OpTypeFunction %v4float
%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %15
%t = OpFunctionParameter %11
%s = OpFunctionParameter %14
%coord = OpFunctionParameter %v2float
%21 = OpLabel
- %34 = OpVariable %_ptr_Function_v2float Function %36
- %23 = OpImageQuerySizeLod %v2int %t %26
- %22 = OpConvertSToF %v2float %23
- %29 = OpFDiv %v2float %28 %22
- %37 = OpCompositeConstruct %v2float %float_1 %float_1
- %33 = OpFSub %v2float %37 %29
- %30 = OpExtInst %v2float %31 NClamp %coord %29 %33
- %40 = OpSampledImage %39 %t %s
- %38 = OpImageSampleExplicitLod %v4float %40 %30 Lod %8
- OpReturnValue %38
+ %35 = OpVariable %_ptr_Function_v2float Function %37
+ %23 = OpImageQuerySizeLod %v2uint %t %27
+ %22 = OpConvertUToF %v2float %23
+ %30 = OpFDiv %v2float %29 %22
+ %38 = OpCompositeConstruct %v2float %float_1 %float_1
+ %34 = OpFSub %v2float %38 %30
+ %31 = OpExtInst %v2float %32 NClamp %coord %30 %34
+ %41 = OpSampledImage %40 %t %s
+ %39 = OpImageSampleExplicitLod %v4float %41 %31 Lod %8
+ OpReturnValue %39
OpFunctionEnd
-%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %41
- %44 = OpLabel
+%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %42
+ %45 = OpLabel
%res = OpVariable %_ptr_Function_v4float Function %5
- %46 = OpLoad %11 %arg_0
- %47 = OpLoad %14 %arg_1
- %45 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %46 %47 %36
- OpStore %res %45
+ %47 = OpLoad %11 %arg_0
+ %48 = OpLoad %14 %arg_1
+ %46 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %47 %48 %37
+ OpStore %res %46
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %50
- %52 = OpLabel
- %53 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%vertex_main_inner = OpFunction %v4float None %51
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturnValue %5
OpFunctionEnd
-%vertex_main = OpFunction %void None %41
- %55 = OpLabel
- %56 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %56
+%vertex_main = OpFunction %void None %42
+ %56 = OpLabel
+ %57 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %57
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %41
- %58 = OpLabel
- %59 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%fragment_main = OpFunction %void None %42
+ %59 = OpLabel
+ %60 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %41
- %61 = OpLabel
- %62 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%compute_main = OpFunction %void None %42
+ %62 = OpLabel
+ %63 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
index 6de9215..5300171 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/53b9f7.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
index ca0f3a1..32eafc4 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/594824.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
index 089c1c9..b47bcdf 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/6a9113.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
index ac5345b..20389f5 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/80e579.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
index f604de6..45cb35f 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/9dbb51.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
index f179d0b..e236889 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/a161cf.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
index 194d8bd..9fc2800 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/d3fa1b.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
index 6ac4b73..59b8491 100644
--- a/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleBias/eed7c4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
index cee7034..891c420 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/3a5923.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
index c8641e3..c73015c 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/63fb83.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
index f51f3ea..68d1f2f 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/a3ca7e.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
index 4a18997..329e2f9 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/af1051.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
index bd50de0..ea5645b 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dd431d.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
index 58482d5..74168e1 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompare/dec064.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
index 89ad4ab..7742bf3 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1116ed.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
index 285b9a3..f3a75dd 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/1568e3.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
index 2dda0ce..a8308e3 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/2ad2b1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
index 5e17a1b..75f7335 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/4cf3a2.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
index e8e100b..6cc8a39 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/7f2b9a.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
index c7d95fe..7b3f48b 100644
--- a/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleCompareLevel/b6e47c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
index 2ed1691..c84adf0 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/21402b.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
index 549f394..bcb2593 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/2ecd8f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
index 37562f0..6b6b77c 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/521263.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
index 6c17ac9..5bdc21b 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5312f4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
index 0dd5898..743623a 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/5884dd.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
index 3618f2c..40ce7dd 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d4e3c5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
index d7af55e..e287fbe 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/d65515.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
index 9bcad7f..3efc537 100644
--- a/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleGrad/e383db.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
index 85a523d..ffa7af3 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/02be59.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
index 0d7681a..31146d2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0b0a1b.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
index 9ab157c..6129b9c 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/0bdd9a.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
index 8735b1b..34cbdc1 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
index 5fddb81..7d733ee 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1b0291.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp samplerCubeShadow arg_0_arg_1;
void textureSampleLevel_1b0291() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(1));
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp samplerCubeShadow arg_0_arg_1;
void textureSampleLevel_1b0291() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(1));
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp samplerCubeShadow arg_0_arg_1;
void textureSampleLevel_1b0291() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, 0.0f), float(1));
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
index 5cadcbe..98e0763 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
index b3a3c22..377cb1b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/1bf73e.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_1bf73e() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1));
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_1bf73e() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1));
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_1bf73e() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1));
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
index b7be828..8673fe7 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/302be4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
index 031cd4a..250369f 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
index 39c836f..1010584 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/36780e.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_36780e() {
- float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0), ivec2(0));
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1), ivec2(0));
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_36780e() {
- float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0), ivec2(0));
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1), ivec2(0));
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp sampler2DArrayShadow arg_0_arg_1;
void textureSampleLevel_36780e() {
- float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(0), ivec2(0));
+ float res = textureLodOffset(arg_0_arg_1, vec4(0.0f, 0.0f, float(1), 0.0f), float(1), ivec2(0));
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
index 54ae58d..b89cce6 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/749baf.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/979816.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/979816.wgsl
index 34367ee..943d287 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/979816.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/979816.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
index 9a44eac..25468bf 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/abfcc0.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
index 9160e56..1321449 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
index d619a9b..7c367c4 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/ae5e39.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp samplerCubeArrayShadow arg_0_arg_1;
void textureSampleLevel_ae5e39() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1));
}
vec4 vertex_main() {
@@ -34,7 +34,7 @@
uniform highp samplerCubeArrayShadow arg_0_arg_1;
void textureSampleLevel_ae5e39() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1));
}
void fragment_main() {
@@ -57,7 +57,7 @@
uniform highp samplerCubeArrayShadow arg_0_arg_1;
void textureSampleLevel_ae5e39() {
- float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(0));
+ float res = textureLod(arg_0_arg_1, vec4(0.0f, 0.0f, 0.0f, float(1)), float(1));
}
void compute_main() {
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
index ef0b2ca..d8fefee 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/b7c55c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
index 271fcc2..bb02ef2 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c32df7.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
index 32f687a..7874b9b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/c6aca6.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
index f4852ba..3390f5b 100644
--- a/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
+++ b/test/tint/builtins/gen/literal/textureSampleLevel/dcbecb.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
index d7c656b..dac61fd 100644
--- a/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/05ce15.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
index 43766a5..fa8db6a 100644
--- a/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/064c7f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/068641.wgsl b/test/tint/builtins/gen/literal/textureStore/068641.wgsl
index 58871d9..813eec3 100644
--- a/test/tint/builtins/gen/literal/textureStore/068641.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/068641.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
index c53f356..f94740e 100644
--- a/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0af6b5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
index d3f825a..c2c0cd8 100644
--- a/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/0c3dff.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/102722.wgsl b/test/tint/builtins/gen/literal/textureStore/102722.wgsl
index 78f795b..1bd0839 100644
--- a/test/tint/builtins/gen/literal/textureStore/102722.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/102722.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
index 4f3ca4d..b0103e8 100644
--- a/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1bbd08.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
index 7bea7c2..cc58e9a 100644
--- a/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/1c02e7.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/22d955.wgsl b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
index e657ad4..2f1f79b 100644
--- a/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/22d955.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
index 1f5b032..8edb0ae 100644
--- a/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/26bf70.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
index faeb4ce..ada88c1 100644
--- a/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2796b4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
index 6f52734..d69d314 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2ac6c7.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
index eda0e93..945cd47 100644
--- a/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2eb2a4.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
index 40095c5..89188ea 100644
--- a/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/2ed2a3.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
index c05fab4..2cec898 100644
--- a/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/31745b.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/32f368.wgsl b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
index 8b2a2fa..8b66228 100644
--- a/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/32f368.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/331aee.wgsl b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
index bc09879..0db96c1 100644
--- a/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/331aee.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
index 91ea85b..a7bf084 100644
--- a/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/38e8d7.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
index 2e7b06b..028ac8a 100644
--- a/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3a52ac.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
index 570de49..170257b 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3bb7a1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
index 5ae429a..e6050ab 100644
--- a/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/3bec15.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
index 41a440c..a81a84b 100644
--- a/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/441ba8.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
index 5470d5a..d79d3d2 100644
--- a/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/4fc057.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
index 30fffd9..cc7d1ac 100644
--- a/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/5a2f8f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
index 80d908b..bbc6c40 100644
--- a/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/60975f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
index 0328dbf..7920724 100644
--- a/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/682fd6.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
index ba822b7..1c97c4c 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6b75c3.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
index 567f88e..bc36f22 100644
--- a/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6b80d2.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
index 47766ae..fe20069 100644
--- a/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6cff2e.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/6da692.wgsl b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
index 1a4399a..a50c0f3 100644
--- a/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/6da692.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/731349.wgsl b/test/tint/builtins/gen/literal/textureStore/731349.wgsl
index 0a020be..feaede0 100644
--- a/test/tint/builtins/gen/literal/textureStore/731349.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/731349.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/752da6.wgsl b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
index 1bd23fb..ddb2812 100644
--- a/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/752da6.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
index 089ccf0..8cfde02 100644
--- a/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/77c0ae.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
index 1edcb8f..c22261a 100644
--- a/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7cec8d.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
index 6b08397..edc32c8 100644
--- a/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/7f7fae.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/804942.wgsl b/test/tint/builtins/gen/literal/textureStore/804942.wgsl
index 4ca2ffc..0f067ae 100644
--- a/test/tint/builtins/gen/literal/textureStore/804942.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/804942.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
index 9a73354..6ae5db8 100644
--- a/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/805dae.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
index 387e5ad..4f8e627 100644
--- a/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/83bcc1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/872747.wgsl b/test/tint/builtins/gen/literal/textureStore/872747.wgsl
index d457c12..eb4d490 100644
--- a/test/tint/builtins/gen/literal/textureStore/872747.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/872747.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
index b3326b9..d2873c5 100644
--- a/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8e0479.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
index 36d6ecd..9424ac8 100644
--- a/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/8f71a1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/969534.wgsl b/test/tint/builtins/gen/literal/textureStore/969534.wgsl
index 478498c..a51a043 100644
--- a/test/tint/builtins/gen/literal/textureStore/969534.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/969534.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
index 40a6654..d38ba03 100644
--- a/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9a3ecc.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
index 981614a..689372f 100644
--- a/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9d9cd5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
index 0fd320e..12480b4 100644
--- a/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/9e3ec5.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
index d703f12..99c466d 100644
--- a/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ac67aa.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
index 6004410..2cc6a65 100644
--- a/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/b706b1.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
index 6c102b4..5474078 100644
--- a/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/bbcb7f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
index 92f15fe8..2ec8e59 100644
--- a/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/be6e30.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
index 1a07707..2169dff 100644
--- a/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/bf775c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
index f8bcd69..bee0ccf 100644
--- a/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c5af1e.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
index ba68f66..32ab308 100644
--- a/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/c863be.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
index df60956..94fa33e 100644
--- a/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/d73b5c.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
index 11b2a3d..b974b11 100644
--- a/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dd7d81.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
index 0648c2c..65fa8b5 100644
--- a/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/dde364.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
index f13fd8d..68ab40b 100644
--- a/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/e885e8.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
index ac35f5b..35292f6 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/eb702f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
index 5e22edf..4393ba0 100644
--- a/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/eb78b9.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
index 3335d0e..9e299d1 100644
--- a/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ee6acc.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
index ace68ce..83185c7 100644
--- a/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/ef9f2f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
index be2f064..431978d 100644
--- a/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/f8dead.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
index 7be33f9..d8343c1 100644
--- a/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/f9be83.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
index e9e4958..37421d8 100644
--- a/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fb9a8f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
index c9b7a1d..5b66de8 100644
--- a/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
+++ b/test/tint/builtins/gen/literal/textureStore/fbf53f.wgsl
@@ -1,4 +1,4 @@
-// Copyright 2021 The Tint Authors.
+// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl
deleted file mode 100644
index 8ca4261..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>) -> i32
-fn textureDimensions_002b2a() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_002b2a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_002b2a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_002b2a();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 29d0c12..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_002b2a() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_002b2a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_002b2a();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 29d0c12..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_002b2a() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_002b2a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_002b2a();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.glsl
deleted file mode 100644
index 9ee3490..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_002b2a();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_002b2a();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_002b2a() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_002b2a();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.msl
deleted file mode 100644
index b5b2121..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_002b2a(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_002b2a(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_002b2a(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_002b2a(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.spvasm
deleted file mode 100644
index 178d73b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_002b2a "textureDimensions_002b2a"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_002b2a = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %int %18 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_002b2a
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.wgsl
deleted file mode 100644
index 5f09068..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/002b2a.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_002b2a() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_002b2a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_002b2a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_002b2a();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl
new file mode 100644
index 0000000..2079209
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<u32>
+fn textureDimensions_00348c() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00348c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00348c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00348c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e613aa1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_00348c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00348c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00348c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e613aa1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_00348c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_00348c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_00348c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl
new file mode 100644
index 0000000..dd2e0ef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_00348c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_00348c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureDimensions_00348c() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_00348c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl
new file mode 100644
index 0000000..cf3f493
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_00348c(texture2d_ms<int, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureDimensions_00348c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_00348c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_00348c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm
new file mode 100644
index 0000000..5045f2d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_00348c "textureDimensions_00348c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_00348c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_00348c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl
new file mode 100644
index 0000000..17daeec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/00348c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureDimensions_00348c() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_00348c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_00348c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_00348c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl
deleted file mode 100644
index 3fd6388..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<i32>
-fn textureDimensions_012b82() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_012b82();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_012b82();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_012b82();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 56fb818..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_012b82() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_012b82();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_012b82();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 56fb818..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_012b82() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_012b82();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_012b82();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.glsl
deleted file mode 100644
index 9ae3c1b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_012b82();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_012b82();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_012b82() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_012b82();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.msl
deleted file mode 100644
index f53807b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_012b82(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_012b82(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_012b82(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_012b82(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.spvasm
deleted file mode 100644
index 4e8d502..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_012b82 "textureDimensions_012b82"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_012b82 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_012b82
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_012b82
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_012b82
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.wgsl
deleted file mode 100644
index 216df4f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/012b82.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
-
-fn textureDimensions_012b82() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_012b82();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_012b82();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_012b82();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl
new file mode 100644
index 0000000..1f251f3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>, level: u32) -> u32
+fn textureDimensions_022903() {
+ var arg_1 = 1u;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_022903();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_022903();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_022903();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bd4bed3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_022903() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_022903();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_022903();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bd4bed3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_022903() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_022903();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_022903();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl
new file mode 100644
index 0000000..5a365cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_022903();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_022903();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_022903() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_022903();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl
new file mode 100644
index 0000000..e5800b7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_022903(texture1d<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_022903(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_022903(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_022903(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm
new file mode 100644
index 0000000..3cf4046
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.spvasm
@@ -0,0 +1,81 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_022903 "textureDimensions_022903"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_022903 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_uint Function %21
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %22 = OpImageQuerySizeLod %uint %23 %24
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_022903
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_022903
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_022903
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl
new file mode 100644
index 0000000..d3eea65
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/022903.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_022903() {
+ var arg_1 = 1u;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_022903();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_022903();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_022903();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl
deleted file mode 100644
index 2b1e057..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> i32
-fn textureDimensions_08753d() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_08753d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_08753d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_08753d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 83011ff..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_08753d() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_08753d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_08753d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_08753d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 83011ff..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_08753d() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_08753d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_08753d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_08753d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.glsl
deleted file mode 100644
index 0b0f9e3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_08753d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_08753d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_08753d() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_08753d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.msl
deleted file mode 100644
index a1fa2f3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_08753d(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_08753d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_08753d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_08753d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.spvasm
deleted file mode 100644
index 8854f38..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_08753d "textureDimensions_08753d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_08753d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_08753d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_08753d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_08753d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.wgsl
deleted file mode 100644
index 443a678..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/08753d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16sint, write>;
-
-fn textureDimensions_08753d() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_08753d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_08753d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_08753d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl
new file mode 100644
index 0000000..15aa62d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>, level: u32) -> vec3<u32>
+fn textureDimensions_0890c6() {
+ var arg_1 = 1u;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0890c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0890c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0890c6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..deb887d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_0890c6() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0890c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0890c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..deb887d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_0890c6() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0890c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0890c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl
new file mode 100644
index 0000000..7b2d34c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0890c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_0890c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_0890c6() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_0890c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl
new file mode 100644
index 0000000..15b653c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0890c6(texture3d<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_0890c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0890c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0890c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..1d35261
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0890c6 "textureDimensions_0890c6"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %27 = OpConstantNull %v3uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0890c6 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v3uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v3uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_0890c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f688e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0890c6.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_0890c6() {
+ var arg_1 = 1u;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0890c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0890c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0890c6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl
new file mode 100644
index 0000000..6a49738
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> u32
+fn textureDimensions_09140b() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_09140b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_09140b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_09140b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f718b0a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_09140b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_09140b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_09140b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f718b0a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_09140b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_09140b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_09140b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl
new file mode 100644
index 0000000..67cfd46
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_09140b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_09140b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_09140b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_09140b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl
new file mode 100644
index 0000000..5294978
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_09140b(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_09140b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_09140b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_09140b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5cdeef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_09140b "textureDimensions_09140b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_09140b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_09140b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl
new file mode 100644
index 0000000..a07543a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/09140b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32uint, write>;
+
+fn textureDimensions_09140b() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_09140b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_09140b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_09140b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl
deleted file mode 100644
index 5f926ae..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array, level: u32) -> vec2<i32>
-fn textureDimensions_0a1ce8() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0a1ce8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0a1ce8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6a8a99e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_0a1ce8() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0a1ce8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0a1ce8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6a8a99e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_0a1ce8() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0a1ce8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0a1ce8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.glsl
deleted file mode 100644
index ef24d5e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0a1ce8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_0a1ce8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_0a1ce8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.msl
deleted file mode 100644
index da0abf0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0a1ce8(depth2d_array<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_0a1ce8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0a1ce8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0a1ce8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.spvasm
deleted file mode 100644
index 9e9dc56..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0a1ce8 "textureDimensions_0a1ce8"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0a1ce8 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_0a1ce8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.wgsl
deleted file mode 100644
index cec85de..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0a1ce8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_0a1ce8() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0a1ce8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0a1ce8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0a1ce8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl
new file mode 100644
index 0000000..c3117f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<u32>
+fn textureDimensions_0baa0d() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0baa0d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0baa0d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b1a4736
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0baa0d() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0baa0d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0baa0d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b1a4736
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0baa0d() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0baa0d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0baa0d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl
new file mode 100644
index 0000000..52bbc21
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0baa0d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_0baa0d() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_0baa0d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl
new file mode 100644
index 0000000..3776c05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0baa0d(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_0baa0d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0baa0d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0baa0d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm
new file mode 100644
index 0000000..f1c67a7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0baa0d "textureDimensions_0baa0d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0baa0d = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_0baa0d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl
new file mode 100644
index 0000000..8099e09
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0baa0d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32float, write>;
+
+fn textureDimensions_0baa0d() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0baa0d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0baa0d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0baa0d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl
new file mode 100644
index 0000000..79bc102
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> u32
+fn textureDimensions_0c0b0c() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0c0b0c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0c0b0c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5fb29dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0c0b0c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0c0b0c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5fb29dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_0c0b0c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0c0b0c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0c0b0c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl
new file mode 100644
index 0000000..a3815af
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_0c0b0c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image1D arg_0;
+void textureDimensions_0c0b0c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_0c0b0c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl
new file mode 100644
index 0000000..c100b1a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0c0b0c(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_0c0b0c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0c0b0c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0c0b0c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm
new file mode 100644
index 0000000..8ae986f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0c0b0c "textureDimensions_0c0b0c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0c0b0c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_0c0b0c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl
new file mode 100644
index 0000000..c7aab96
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0c0b0c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16float, write>;
+
+fn textureDimensions_0c0b0c() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0c0b0c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0c0b0c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0c0b0c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl
deleted file mode 100644
index 6341954..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<i32>
-fn textureDimensions_0c4772() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0c4772();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0c4772();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0c4772();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3de620c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_0c4772() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0c4772();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0c4772();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3de620c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_0c4772() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0c4772();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0c4772();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.glsl
deleted file mode 100644
index f58182c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0c4772();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0c4772();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image3D arg_0;
-void textureDimensions_0c4772() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0c4772();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.msl
deleted file mode 100644
index cc675e6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0c4772(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_0c4772(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0c4772(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0c4772(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.spvasm
deleted file mode 100644
index 77d91d5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0c4772 "textureDimensions_0c4772"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0c4772 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0c4772
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.wgsl
deleted file mode 100644
index fc2907d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0c4772.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16float, write>;
-
-fn textureDimensions_0c4772() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0c4772();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0c4772();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0c4772();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl
deleted file mode 100644
index 9b72fc3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> i32
-fn textureDimensions_0cce40() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cce40();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cce40();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cce40();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e10fdf6f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cce40() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cce40();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cce40();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e10fdf6f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cce40() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cce40();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cce40();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.glsl
deleted file mode 100644
index a0df901..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0cce40();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0cce40();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_0cce40() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0cce40();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.msl
deleted file mode 100644
index e955048..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0cce40(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_0cce40(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0cce40(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0cce40(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.spvasm
deleted file mode 100644
index 51c3c14..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0cce40 "textureDimensions_0cce40"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0cce40 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_0cce40
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.wgsl
deleted file mode 100644
index 5193665..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cce40.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32sint, write>;
-
-fn textureDimensions_0cce40() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cce40();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cce40();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cce40();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl
deleted file mode 100644
index 82980ef..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<i32>
-fn textureDimensions_0cf2ff() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cf2ff();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cf2ff();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3b9fd52..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cf2ff() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cf2ff();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cf2ff();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3b9fd52..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0cf2ff() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0cf2ff();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0cf2ff();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.glsl
deleted file mode 100644
index d91c9db..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0cf2ff();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_0cf2ff() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0cf2ff();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.msl
deleted file mode 100644
index 875a388..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0cf2ff(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_0cf2ff(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0cf2ff(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0cf2ff(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.spvasm
deleted file mode 100644
index aece9956..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0cf2ff "textureDimensions_0cf2ff"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0cf2ff = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0cf2ff
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.wgsl
deleted file mode 100644
index a13b916..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0cf2ff.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16uint, write>;
-
-fn textureDimensions_0cf2ff() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0cf2ff();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0cf2ff();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0cf2ff();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl
deleted file mode 100644
index dbc0ee9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>, level: u32) -> i32
-fn textureDimensions_0d7633() {
- var arg_1 = 1u;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d7633();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d7633();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d7633();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5653b0e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0d7633() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d7633();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d7633();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5653b0e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0d7633() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d7633();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d7633();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.glsl
deleted file mode 100644
index 91d58d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_0d7633();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_0d7633();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_0d7633() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_0d7633();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.msl
deleted file mode 100644
index 5e838d2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0d7633(texture1d<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_0d7633(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0d7633(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0d7633(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.spvasm
deleted file mode 100644
index 4991015..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0d7633 "textureDimensions_0d7633"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
-%_ptr_Function_int = OpTypePointer Function %int
- %27 = OpConstantNull %int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0d7633 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_int Function %27
- OpStore %arg_1 %uint_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %uint %arg_1
- %22 = OpImageQuerySizeLod %int %23 %24
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_0d7633
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.wgsl
deleted file mode 100644
index 0c00e85..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d7633.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_0d7633() {
- var arg_1 = 1u;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d7633();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d7633();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d7633();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl
deleted file mode 100644
index 1a88f86..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<i32>
-fn textureDimensions_0d8b7e() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d8b7e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d8b7e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 848d8b7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0d8b7e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d8b7e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d8b7e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 848d8b7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0d8b7e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0d8b7e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0d8b7e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.glsl
deleted file mode 100644
index 19bb91a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0d8b7e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_0d8b7e() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_0d8b7e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.msl
deleted file mode 100644
index d07d72a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0d8b7e(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_0d8b7e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0d8b7e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0d8b7e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.spvasm
deleted file mode 100644
index c5406d7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0d8b7e "textureDimensions_0d8b7e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0d8b7e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_0d8b7e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.wgsl
deleted file mode 100644
index 2ce14ea..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0d8b7e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
-
-fn textureDimensions_0d8b7e() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0d8b7e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0d8b7e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0d8b7e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl
deleted file mode 100644
index b9abbbf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_0e28d3() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e28d3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e28d3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e28d3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9b2431e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_0e28d3() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e28d3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e28d3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9b2431e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_0e28d3() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e28d3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e28d3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.glsl
deleted file mode 100644
index fb1cefc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0e28d3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_0e28d3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_0e28d3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_0e28d3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.msl
deleted file mode 100644
index c37cac9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0e28d3(texturecube_array<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_0e28d3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0e28d3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0e28d3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.spvasm
deleted file mode 100644
index de08fb3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,86 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0e28d3 "textureDimensions_0e28d3"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0e28d3 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_0e28d3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.wgsl
deleted file mode 100644
index 32b59d9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e28d3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_0e28d3() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e28d3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e28d3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e28d3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl
deleted file mode 100644
index cad4dae..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<i32>
-fn textureDimensions_0e32ee() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e32ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e32ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e32ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0f338cc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0e32ee() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e32ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e32ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0f338cc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_0e32ee() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0e32ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0e32ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.glsl
deleted file mode 100644
index 3b00486..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_0e32ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_0e32ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_0e32ee() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_0e32ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.msl
deleted file mode 100644
index 376e7b1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0e32ee(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_0e32ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0e32ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0e32ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.spvasm
deleted file mode 100644
index c045a1a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0e32ee "textureDimensions_0e32ee"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0e32ee = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_0e32ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.wgsl
deleted file mode 100644
index c037616..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0e32ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16uint, write>;
-
-fn textureDimensions_0e32ee() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0e32ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0e32ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0e32ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl
deleted file mode 100644
index ed32924..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<i32>
-fn textureDimensions_0f3c50() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0f3c50();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0f3c50();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0f3c50();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5bef298..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0f3c50() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0f3c50();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0f3c50();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5bef298..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_0f3c50() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_0f3c50();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_0f3c50();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.glsl
deleted file mode 100644
index da53ee8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_0f3c50();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_0f3c50();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_0f3c50() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_0f3c50();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.msl
deleted file mode 100644
index 9e6f6ab..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_0f3c50(texture2d_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_0f3c50(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_0f3c50(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_0f3c50(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.spvasm
deleted file mode 100644
index 53a9a61..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_0f3c50 "textureDimensions_0f3c50"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_0f3c50 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_0f3c50
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.wgsl
deleted file mode 100644
index 45eee36..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/0f3c50.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_0f3c50() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_0f3c50();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_0f3c50();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_0f3c50();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl
new file mode 100644
index 0000000..f71346b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2<u32>
+fn textureDimensions_0ff9a4() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0ff9a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0ff9a4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..881ba99
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_0ff9a4() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0ff9a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..881ba99
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_0ff9a4() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_0ff9a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_0ff9a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl
new file mode 100644
index 0000000..3f62797
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_0ff9a4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_0ff9a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_0ff9a4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl
new file mode 100644
index 0000000..6243b2c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_0ff9a4(depthcube_array<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_0ff9a4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_0ff9a4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_0ff9a4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..4a1c262
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.spvasm
@@ -0,0 +1,86 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_0ff9a4 "textureDimensions_0ff9a4"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_0ff9a4 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_0ff9a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..c498d6f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/0ff9a4.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_0ff9a4() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_0ff9a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_0ff9a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_0ff9a4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl
deleted file mode 100644
index d035ecd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>) -> vec2<i32>
-fn textureDimensions_1191a5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1191a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1191a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1191a5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cedbfad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1191a5() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1191a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1191a5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cedbfad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1191a5() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1191a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1191a5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.glsl
deleted file mode 100644
index 0514b2e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1191a5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_1191a5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_1191a5() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_1191a5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.msl
deleted file mode 100644
index c08c723d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1191a5(texture2d<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_1191a5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1191a5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1191a5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.spvasm
deleted file mode 100644
index 1cc88e1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1191a5 "textureDimensions_1191a5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1191a5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_1191a5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.wgsl
deleted file mode 100644
index c0e1745..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1191a5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_1191a5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1191a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1191a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1191a5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl
deleted file mode 100644
index 9eaa172..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2<i32>
-fn textureDimensions_12c9bb() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_12c9bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_12c9bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_12c9bb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7a253eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_12c9bb() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_12c9bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_12c9bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7a253eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_12c9bb() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_12c9bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_12c9bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.glsl
deleted file mode 100644
index cd7f9be..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_12c9bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_12c9bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_12c9bb() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_12c9bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.msl
deleted file mode 100644
index 490a9eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_12c9bb(depth2d<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_12c9bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_12c9bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_12c9bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.spvasm
deleted file mode 100644
index 3a10b31..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_12c9bb "textureDimensions_12c9bb"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_12c9bb = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_12c9bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.wgsl
deleted file mode 100644
index 5b68964..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/12c9bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_12c9bb() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_12c9bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_12c9bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_12c9bb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl
new file mode 100644
index 0000000..50628d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_13f8db() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_13f8db();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_13f8db();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_13f8db();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..78cf28b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_13f8db() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_13f8db();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_13f8db();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..78cf28b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_13f8db() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_13f8db();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_13f8db();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl
new file mode 100644
index 0000000..3bb1ca9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_13f8db();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_13f8db();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_13f8db() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_13f8db();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl
new file mode 100644
index 0000000..7461b5d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_13f8db(texture2d<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_13f8db(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_13f8db(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_13f8db(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm
new file mode 100644
index 0000000..6fae136
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_13f8db "textureDimensions_13f8db"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_13f8db = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_13f8db
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl
new file mode 100644
index 0000000..ef17fed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/13f8db.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_13f8db() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_13f8db();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_13f8db();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_13f8db();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl
new file mode 100644
index 0000000..baeaac6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<u32>
+fn textureDimensions_1417dd() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1417dd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1417dd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1417dd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9b7349f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_1417dd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1417dd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1417dd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9b7349f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_1417dd() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1417dd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1417dd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl
new file mode 100644
index 0000000..6b2d3bb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1417dd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_1417dd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_1417dd() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_1417dd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl
new file mode 100644
index 0000000..297b49a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1417dd(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_1417dd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1417dd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1417dd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm
new file mode 100644
index 0000000..c7a3eae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1417dd "textureDimensions_1417dd"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1417dd = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_1417dd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl
new file mode 100644
index 0000000..430451d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1417dd.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16sint, write>;
+
+fn textureDimensions_1417dd() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1417dd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1417dd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1417dd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl
deleted file mode 100644
index 8a88425..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<i32>
-fn textureDimensions_147998() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_147998();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_147998();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_147998();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.dxc.hlsl
deleted file mode 100644
index af1e9bd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_147998() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_147998();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_147998();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_147998();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.fxc.hlsl
deleted file mode 100644
index af1e9bd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_147998() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_147998();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_147998();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_147998();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.glsl
deleted file mode 100644
index 90d19e8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_147998();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_147998();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_147998() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_147998();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.msl
deleted file mode 100644
index 2543103..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_147998(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_147998(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_147998(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_147998(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.spvasm
deleted file mode 100644
index 9e80b7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_147998 "textureDimensions_147998"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_147998 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_147998
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_147998
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_147998
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.wgsl
deleted file mode 100644
index 8379507..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/147998.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32float, write>;
-
-fn textureDimensions_147998() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_147998();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_147998();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_147998();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl
new file mode 100644
index 0000000..953249a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<u32>
+fn textureDimensions_15aa17() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15aa17();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15aa17();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15aa17();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..06e4e9c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_15aa17() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15aa17();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15aa17();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..06e4e9c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_15aa17() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15aa17();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15aa17();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl
new file mode 100644
index 0000000..da990e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_15aa17();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_15aa17();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_15aa17() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_15aa17();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl
new file mode 100644
index 0000000..147cf4e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_15aa17(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_15aa17(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_15aa17(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_15aa17(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm
new file mode 100644
index 0000000..4201163
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_15aa17 "textureDimensions_15aa17"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_15aa17 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_15aa17
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl
new file mode 100644
index 0000000..2f28d1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15aa17.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32sint, write>;
+
+fn textureDimensions_15aa17() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15aa17();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15aa17();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15aa17();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl
new file mode 100644
index 0000000..ff23987
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_15b577() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15b577();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15b577();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15b577();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e54511
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_15b577() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15b577();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15b577();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e54511
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_15b577() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_15b577();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_15b577();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl
new file mode 100644
index 0000000..722528e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_15b577();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_15b577();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_15b577() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_15b577();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl
new file mode 100644
index 0000000..5c6a682
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_15b577(texture2d<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_15b577(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_15b577(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_15b577(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm
new file mode 100644
index 0000000..cd48eb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_15b577 "textureDimensions_15b577"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_15b577 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %22 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_15b577
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e9cf65
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/15b577.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_15b577() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_15b577();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_15b577();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_15b577();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl
deleted file mode 100644
index a1baa96..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<i32>
-fn textureDimensions_16036c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16036c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16036c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16036c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 02565baa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_16036c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16036c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16036c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 02565baa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_16036c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16036c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16036c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.glsl
deleted file mode 100644
index 5e4d692..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_16036c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_16036c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_16036c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_16036c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.msl
deleted file mode 100644
index 4872c89..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_16036c(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_16036c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_16036c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_16036c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.spvasm
deleted file mode 100644
index af24793..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_16036c "textureDimensions_16036c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_16036c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_16036c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_16036c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_16036c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.wgsl
deleted file mode 100644
index 5a9c5f3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16036c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
-
-fn textureDimensions_16036c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16036c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16036c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16036c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl
deleted file mode 100644
index 39dfc95..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>, level: u32) -> i32
-fn textureDimensions_16f7cb() {
- var arg_1 = 1u;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16f7cb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16f7cb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16f7cb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 93f39f8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_16f7cb() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16f7cb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16f7cb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 93f39f8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_16f7cb() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_16f7cb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_16f7cb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.glsl
deleted file mode 100644
index 4997a45..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_16f7cb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_16f7cb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_16f7cb() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_16f7cb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.msl
deleted file mode 100644
index 153a6f3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_16f7cb(texture1d<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_16f7cb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_16f7cb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_16f7cb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.spvasm
deleted file mode 100644
index 3664be0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_16f7cb "textureDimensions_16f7cb"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %27 = OpConstantNull %int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_16f7cb = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_int Function %27
- OpStore %arg_1 %uint_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_16f7cb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.wgsl
deleted file mode 100644
index b15d59f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/16f7cb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_16f7cb() {
- var arg_1 = 1u;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_16f7cb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_16f7cb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_16f7cb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl
new file mode 100644
index 0000000..88a2b21
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>) -> vec3<u32>
+fn textureDimensions_1a2be7() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1a2be7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1a2be7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..091179b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1a2be7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1a2be7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1a2be7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..091179b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_1a2be7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1a2be7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1a2be7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl
new file mode 100644
index 0000000..70c2d4c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1a2be7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_1a2be7() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_1a2be7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl
new file mode 100644
index 0000000..94c6aef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1a2be7(texture3d<int, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_1a2be7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1a2be7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1a2be7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm
new file mode 100644
index 0000000..4c04ebf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1a2be7 "textureDimensions_1a2be7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1a2be7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_1a2be7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl
new file mode 100644
index 0000000..6a5396a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1a2be7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_1a2be7() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1a2be7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1a2be7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1a2be7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl
deleted file mode 100644
index d77491e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<i32>
-fn textureDimensions_1b71f0() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1b71f0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1b71f0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1b71f0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1ffa3d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_1b71f0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1b71f0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1b71f0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1ffa3d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_1b71f0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1b71f0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1b71f0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.glsl
deleted file mode 100644
index 16bd5b6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1b71f0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_1b71f0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_1b71f0() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_1b71f0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.msl
deleted file mode 100644
index 9ef7f55..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1b71f0(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_1b71f0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1b71f0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1b71f0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.spvasm
deleted file mode 100644
index ba6dd6a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1b71f0 "textureDimensions_1b71f0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1b71f0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_1b71f0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.wgsl
deleted file mode 100644
index ee928e2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1b71f0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16sint, write>;
-
-fn textureDimensions_1b71f0() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1b71f0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1b71f0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1b71f0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl
new file mode 100644
index 0000000..1423248
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>, level: i32) -> vec3<u32>
+fn textureDimensions_1bc428() {
+ var arg_1 = 1i;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bc428();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bc428();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bc428();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8301d00
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bc428() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bc428();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bc428();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8301d00
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bc428() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bc428();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bc428();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl
new file mode 100644
index 0000000..3dc4989
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1bc428();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_1bc428();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_1bc428() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_1bc428();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl
new file mode 100644
index 0000000..f9ca8a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1bc428(texture3d<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_1bc428(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1bc428(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1bc428(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm
new file mode 100644
index 0000000..df2e7fa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1bc428 "textureDimensions_1bc428"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %28 = OpConstantNull %v3uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1bc428 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v3uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v3uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_1bc428
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl
new file mode 100644
index 0000000..2d75990
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bc428.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_1bc428() {
+ var arg_1 = 1i;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bc428();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bc428();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bc428();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl
new file mode 100644
index 0000000..270b5ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_1bd78c() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bd78c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bd78c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f2e60a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bd78c() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bd78c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bd78c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f2e60a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_1bd78c() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_1bd78c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_1bd78c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl
new file mode 100644
index 0000000..d87d5a6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_1bd78c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_1bd78c() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_1bd78c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl
new file mode 100644
index 0000000..e5ac9c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_1bd78c(texture2d<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_1bd78c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_1bd78c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_1bd78c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad4808e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_1bd78c "textureDimensions_1bd78c"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_1bd78c = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_1bd78c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d9ef3f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/1bd78c.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_1bd78c() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_1bd78c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_1bd78c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_1bd78c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl
deleted file mode 100644
index b5cb5d9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<i32>
-fn textureDimensions_1d6c26() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1d6c26();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1d6c26();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1d6c26();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 26140a0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1d6c26() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1d6c26();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1d6c26();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 26140a0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1d6c26() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1d6c26();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1d6c26();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.glsl
deleted file mode 100644
index bea79ae..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_1d6c26();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_1d6c26();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_1d6c26() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_1d6c26();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.msl
deleted file mode 100644
index 65d506d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1d6c26(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_1d6c26(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1d6c26(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1d6c26(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.spvasm
deleted file mode 100644
index f0feca5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1d6c26 "textureDimensions_1d6c26"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1d6c26 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_1d6c26
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.wgsl
deleted file mode 100644
index 8bb5c22..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1d6c26.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
-
-fn textureDimensions_1d6c26() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1d6c26();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1d6c26();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1d6c26();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl
deleted file mode 100644
index 006bfd8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>, level: u32) -> i32
-fn textureDimensions_1e3981() {
- var arg_1 = 1u;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e3981();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e3981();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e3981();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 31d4651..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1e3981() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e3981();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e3981();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 31d4651..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1e3981() {
- uint arg_1 = 1u;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e3981();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e3981();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.glsl
deleted file mode 100644
index c87c594..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_1e3981();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_1e3981();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_1e3981() {
- uint arg_1 = 1u;
- int res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_1e3981();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.msl
deleted file mode 100644
index ff14fe6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1e3981(texture1d<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_1e3981(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1e3981(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1e3981(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.spvasm
deleted file mode 100644
index 14764a5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1e3981 "textureDimensions_1e3981"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %27 = OpConstantNull %int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1e3981 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_int Function %27
- OpStore %arg_1 %uint_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_1e3981
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.wgsl
deleted file mode 100644
index 2c5e4ac..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e3981.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_1e3981() {
- var arg_1 = 1u;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e3981();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e3981();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e3981();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl
deleted file mode 100644
index 8e3eb59..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16float, write>) -> i32
-fn textureDimensions_1e9e39() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e9e39();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e9e39();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e9e39();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 16444c0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1e9e39() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e9e39();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e9e39();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 16444c0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_1e9e39() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1e9e39();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1e9e39();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.glsl
deleted file mode 100644
index 067bc8b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_1e9e39();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_1e9e39();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image1D arg_0;
-void textureDimensions_1e9e39() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_1e9e39();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.msl
deleted file mode 100644
index 352d58d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1e9e39(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_1e9e39(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1e9e39(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1e9e39(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.spvasm
deleted file mode 100644
index c83aa50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1e9e39 "textureDimensions_1e9e39"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1e9e39 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_1e9e39
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.wgsl
deleted file mode 100644
index efd42ac..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1e9e39.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16float, write>;
-
-fn textureDimensions_1e9e39() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1e9e39();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1e9e39();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1e9e39();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl
deleted file mode 100644
index 4be52a4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<i32>
-fn textureDimensions_1f20c5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1f20c5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1f20c5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1f20c5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e453d42..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1f20c5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1f20c5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1f20c5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e453d42..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_1f20c5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_1f20c5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_1f20c5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.glsl
deleted file mode 100644
index ac742c2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_1f20c5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_1f20c5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_1f20c5() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_1f20c5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.msl
deleted file mode 100644
index d35a456..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_1f20c5(texture2d_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_1f20c5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_1f20c5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_1f20c5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.spvasm
deleted file mode 100644
index 83e1fb4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_1f20c5 "textureDimensions_1f20c5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_1f20c5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_0
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_1f20c5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.wgsl
deleted file mode 100644
index 4800bad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/1f20c5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_1f20c5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_1f20c5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_1f20c5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_1f20c5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl
deleted file mode 100644
index 070bb0b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<i32>
-fn textureDimensions_214dd4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_214dd4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_214dd4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_214dd4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c91423e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_214dd4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_214dd4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_214dd4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c91423e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_214dd4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_214dd4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_214dd4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.glsl
deleted file mode 100644
index d7f534f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_214dd4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_214dd4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_214dd4() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_214dd4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.msl
deleted file mode 100644
index 169ee32..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_214dd4(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_214dd4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_214dd4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_214dd4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.spvasm
deleted file mode 100644
index 8210ce8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_214dd4 "textureDimensions_214dd4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_214dd4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_214dd4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.wgsl
deleted file mode 100644
index 8fdb8a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/214dd4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8sint, write>;
-
-fn textureDimensions_214dd4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_214dd4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_214dd4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_214dd4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl
deleted file mode 100644
index 62690e1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_216688() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_216688();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_216688();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_216688();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 878e5dd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_216688() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_216688();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_216688();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_216688();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 878e5dd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_216688() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_216688();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_216688();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_216688();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.glsl
deleted file mode 100644
index 0a8a3e8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_216688();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_216688();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_216688() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_216688();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.msl
deleted file mode 100644
index a75efa9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_216688(texture2d_array<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_216688(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_216688(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_216688(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.spvasm
deleted file mode 100644
index ca7d09b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_216688 "textureDimensions_216688"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_216688 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_216688
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_216688
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_216688
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.wgsl
deleted file mode 100644
index 1914b2b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/216688.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_216688() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_216688();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_216688();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_216688();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl
deleted file mode 100644
index c6ad068..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_220dc3() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_220dc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_220dc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_220dc3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 01303f7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_220dc3() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_220dc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_220dc3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 01303f7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_220dc3() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_220dc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_220dc3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.glsl
deleted file mode 100644
index 1c957c1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_220dc3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_220dc3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_220dc3() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_220dc3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.msl
deleted file mode 100644
index ee8e56e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_220dc3(texture2d<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_220dc3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_220dc3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_220dc3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.spvasm
deleted file mode 100644
index dd0cfd1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_220dc3 "textureDimensions_220dc3"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_220dc3 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_220dc3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.wgsl
deleted file mode 100644
index e377046..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/220dc3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_220dc3() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_220dc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_220dc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_220dc3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl
deleted file mode 100644
index 346d3d9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_221f22() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_221f22();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_221f22();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_221f22();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3c90f35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_221f22() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_221f22();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_221f22();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3c90f35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_221f22() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_221f22();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_221f22();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.glsl
deleted file mode 100644
index ba1d23a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_221f22();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_221f22();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_221f22() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_221f22();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.msl
deleted file mode 100644
index 3264332..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_221f22(texturecube_array<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_221f22(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_221f22(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_221f22(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.spvasm
deleted file mode 100644
index 956503e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_221f22 "textureDimensions_221f22"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_221f22 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_221f22
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_221f22
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_221f22
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.wgsl
deleted file mode 100644
index 781ea30..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/221f22.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_221f22() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_221f22();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_221f22();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_221f22();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl
new file mode 100644
index 0000000..95d6010
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<u32>
+fn textureDimensions_224113() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_224113();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_224113();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_224113();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2af1026
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_224113() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_224113();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_224113();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2af1026
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_224113() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_224113();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_224113();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl
new file mode 100644
index 0000000..569cec5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_224113();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_224113();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2D arg_0;
+void textureDimensions_224113() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_224113();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl
new file mode 100644
index 0000000..a0f1191
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_224113(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_224113(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_224113(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_224113(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9d1190
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_224113 "textureDimensions_224113"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_224113 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_224113
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_224113
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_224113
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl
new file mode 100644
index 0000000..c16b613
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/224113.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8unorm, write>;
+
+fn textureDimensions_224113() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_224113();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_224113();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_224113();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl
new file mode 100644
index 0000000..3ee8952
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_22b5b6() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_22b5b6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_22b5b6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e02e262
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_22b5b6() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_22b5b6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_22b5b6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e02e262
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_22b5b6() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_22b5b6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_22b5b6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl
new file mode 100644
index 0000000..0368a8f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_22b5b6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_22b5b6() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_22b5b6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl
new file mode 100644
index 0000000..38bf28d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_22b5b6(texturecube_array<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_22b5b6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_22b5b6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_22b5b6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm
new file mode 100644
index 0000000..dcffbd9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.spvasm
@@ -0,0 +1,86 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_22b5b6 "textureDimensions_22b5b6"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_22b5b6 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %22 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_22b5b6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl
new file mode 100644
index 0000000..268acda
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/22b5b6.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_22b5b6() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_22b5b6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_22b5b6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_22b5b6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl
new file mode 100644
index 0000000..feef6f2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureDimensions(texture: texture_2d<f32>) -> vec2<u32>
+fn textureDimensions_24db07() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_24db07();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_24db07();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_24db07();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d27a502
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_24db07() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_24db07();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_24db07();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d27a502
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_24db07() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_24db07();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_24db07();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl
new file mode 100644
index 0000000..b48ef53
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_24db07();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_24db07();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_24db07() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_24db07();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl
new file mode 100644
index 0000000..1575e42
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_24db07(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_24db07(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_24db07(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_24db07(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm
new file mode 100644
index 0000000..855ef0b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_24db07 "textureDimensions_24db07"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_24db07 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_24db07
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl
new file mode 100644
index 0000000..28f4077
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/24db07.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureDimensions_24db07() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_24db07();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_24db07();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_24db07();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl
new file mode 100644
index 0000000..95cac6e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<u32>
+fn textureDimensions_2674d8() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2674d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2674d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2674d8();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b619638
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_2674d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2674d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2674d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b619638
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_2674d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2674d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2674d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl
new file mode 100644
index 0000000..6c4d034
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_2674d8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_2674d8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_2674d8() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_2674d8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl
new file mode 100644
index 0000000..b367114
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2674d8(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_2674d8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2674d8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2674d8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..3b8b2fe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2674d8 "textureDimensions_2674d8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2674d8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_2674d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ece5a6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2674d8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureDimensions_2674d8() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2674d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2674d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2674d8();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl
deleted file mode 100644
index 7bd5dbe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_267788() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_267788();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_267788();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_267788();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8fbc832..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_267788() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_267788();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_267788();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_267788();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8fbc832..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_267788() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_267788();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_267788();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_267788();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.glsl
deleted file mode 100644
index 70e8cb1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_267788();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_267788();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_267788() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_267788();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.msl
deleted file mode 100644
index e129009..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_267788(texture2d_array<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_267788(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_267788(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_267788(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.spvasm
deleted file mode 100644
index d3e1a3a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_267788 "textureDimensions_267788"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_267788 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %int_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %int %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %22 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_267788
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_267788
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_267788
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.wgsl
deleted file mode 100644
index 03a5c34..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/267788.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_267788() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_267788();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_267788();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_267788();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl
deleted file mode 100644
index a1829c9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>, level: i32) -> vec3<i32>
-fn textureDimensions_26bdfa() {
- var arg_1 = 1i;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26bdfa();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26bdfa();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26bdfa();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7344cc3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_26bdfa() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26bdfa();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26bdfa();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7344cc3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_26bdfa() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26bdfa();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26bdfa();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.glsl
deleted file mode 100644
index 86cf2d9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_26bdfa();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_26bdfa();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_26bdfa() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_26bdfa();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.msl
deleted file mode 100644
index 5e81d10..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_26bdfa(texture3d<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_26bdfa(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_26bdfa(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_26bdfa(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.spvasm
deleted file mode 100644
index 0da6ce6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_26bdfa "textureDimensions_26bdfa"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %27 = OpConstantNull %v3int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_26bdfa = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v3int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v3int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_26bdfa
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.wgsl
deleted file mode 100644
index b854f98..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26bdfa.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_26bdfa() {
- var arg_1 = 1i;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26bdfa();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26bdfa();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26bdfa();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl
new file mode 100644
index 0000000..56b19de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>) -> u32
+fn textureDimensions_26d6bf() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_26d6bf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_26d6bf();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3de8d27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_26d6bf() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_26d6bf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26d6bf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3de8d27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_26d6bf() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_26d6bf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_26d6bf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl
new file mode 100644
index 0000000..d262540
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_26d6bf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_26d6bf() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_26d6bf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl
new file mode 100644
index 0000000..d8130b4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_26d6bf(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_26d6bf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_26d6bf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_26d6bf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm
new file mode 100644
index 0000000..47116b8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_26d6bf "textureDimensions_26d6bf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_26d6bf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %uint %18 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_26d6bf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl
new file mode 100644
index 0000000..ba2a96a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/26d6bf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_26d6bf() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_26d6bf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_26d6bf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_26d6bf();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl
deleted file mode 100644
index 4cde4c9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<i32>
-fn textureDimensions_26ef6c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26ef6c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26ef6c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26ef6c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7ccf32f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_26ef6c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26ef6c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26ef6c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7ccf32f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_26ef6c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_26ef6c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_26ef6c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.glsl
deleted file mode 100644
index dbdb178..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_26ef6c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_26ef6c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_26ef6c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_26ef6c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.msl
deleted file mode 100644
index ba9013a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_26ef6c(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_26ef6c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_26ef6c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_26ef6c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.spvasm
deleted file mode 100644
index bd40e12..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_26ef6c "textureDimensions_26ef6c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_26ef6c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_26ef6c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.wgsl
deleted file mode 100644
index c0b495c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/26ef6c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
-
-fn textureDimensions_26ef6c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_26ef6c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_26ef6c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_26ef6c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl
deleted file mode 100644
index 593565b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16sint, write>) -> vec2<i32>
-fn textureDimensions_2ad087() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2ad087();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2ad087();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2ad087();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 33dee50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2ad087() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2ad087();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2ad087();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 33dee50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2ad087() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2ad087();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2ad087();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.glsl
deleted file mode 100644
index 90289b3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_2ad087();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_2ad087();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_2ad087() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_2ad087();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.msl
deleted file mode 100644
index 011b3cb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2ad087(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_2ad087(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2ad087(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2ad087(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.spvasm
deleted file mode 100644
index cb89db5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2ad087 "textureDimensions_2ad087"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2ad087 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_2ad087
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.wgsl
deleted file mode 100644
index e965a18..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2ad087.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16sint, write>;
-
-fn textureDimensions_2ad087() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2ad087();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2ad087();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2ad087();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl
deleted file mode 100644
index 3b083d5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_2d4299() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2d4299();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2d4299();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2d4299();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c3e5b1a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_2d4299() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2d4299();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2d4299();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c3e5b1a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_2d4299() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2d4299();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2d4299();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.glsl
deleted file mode 100644
index 3545ee2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_2d4299();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_2d4299();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_2d4299() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_2d4299();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.msl
deleted file mode 100644
index 2db62ef..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2d4299(texturecube_array<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_2d4299(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2d4299(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2d4299(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.spvasm
deleted file mode 100644
index 2212170..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.spvasm
+++ /dev/null
@@ -1,86 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2d4299 "textureDimensions_2d4299"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2d4299 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %22 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_2d4299
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.wgsl
deleted file mode 100644
index 8ae3821..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2d4299.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_2d4299() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2d4299();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2d4299();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2d4299();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl
new file mode 100644
index 0000000..2cbe988
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_2e443d() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2e443d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2e443d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2e443d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4df28d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_2e443d() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2e443d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2e443d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4df28d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_2e443d() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2e443d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2e443d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl
new file mode 100644
index 0000000..aee294a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_2e443d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_2e443d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_2e443d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_2e443d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl
new file mode 100644
index 0000000..9753cf2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2e443d(texture2d<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_2e443d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2e443d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2e443d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm
new file mode 100644
index 0000000..4e4329f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2e443d "textureDimensions_2e443d"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2e443d = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_2e443d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl
new file mode 100644
index 0000000..2ed54c0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2e443d.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_2e443d() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2e443d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2e443d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2e443d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl
deleted file mode 100644
index f891ad8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>, level: i32) -> vec3<i32>
-fn textureDimensions_2efa05() {
- var arg_1 = 1i;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2efa05();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2efa05();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2efa05();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 384aa47..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_2efa05() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2efa05();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2efa05();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 384aa47..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_2efa05() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2efa05();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2efa05();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.glsl
deleted file mode 100644
index 9b700e8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_2efa05();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_2efa05();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_2efa05() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_2efa05();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.msl
deleted file mode 100644
index 5e9ecac..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2efa05(texture3d<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_2efa05(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2efa05(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2efa05(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.spvasm
deleted file mode 100644
index 8be9992..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2efa05 "textureDimensions_2efa05"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %28 = OpConstantNull %v3int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2efa05 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_v3int Function %28
- OpStore %arg_1 %int_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %int %arg_1
- %22 = OpImageQuerySizeLod %v3int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_2efa05
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.wgsl
deleted file mode 100644
index dd955fc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2efa05.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_2efa05() {
- var arg_1 = 1i;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2efa05();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2efa05();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2efa05();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl
deleted file mode 100644
index d5bbd86..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<i32>
-fn textureDimensions_2f289f() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2f289f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2f289f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2f289f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b84004a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2f289f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2f289f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2f289f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b84004a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_2f289f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2f289f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2f289f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.glsl
deleted file mode 100644
index ecf5ce0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_2f289f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_2f289f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_2f289f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_2f289f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.msl
deleted file mode 100644
index a61bafe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2f289f(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_2f289f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2f289f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2f289f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.spvasm
deleted file mode 100644
index ae04243..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2f289f "textureDimensions_2f289f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2f289f = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_2f289f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.wgsl
deleted file mode 100644
index 6895807..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2f289f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32sint, write>;
-
-fn textureDimensions_2f289f() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2f289f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2f289f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2f289f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl
new file mode 100644
index 0000000..8da5c10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_2fd2a4() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2fd2a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2fd2a4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f5e25dd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2fd2a4() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2fd2a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f5e25dd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_2fd2a4() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_2fd2a4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_2fd2a4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl
new file mode 100644
index 0000000..d87ced8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_2fd2a4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_2fd2a4() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_2fd2a4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl
new file mode 100644
index 0000000..e088176
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_2fd2a4(texture2d_array<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_2fd2a4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_2fd2a4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_2fd2a4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm
new file mode 100644
index 0000000..75d5e5e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_2fd2a4 "textureDimensions_2fd2a4"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_2fd2a4 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_2fd2a4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl
new file mode 100644
index 0000000..3935303
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/2fd2a4.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_2fd2a4() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_2fd2a4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_2fd2a4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_2fd2a4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl
deleted file mode 100644
index 05f2b19..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_2fe1cc() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2fe1cc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2fe1cc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 26475cb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_2fe1cc() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2fe1cc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2fe1cc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 26475cb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_2fe1cc() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_2fe1cc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_2fe1cc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.glsl
deleted file mode 100644
index 8460990..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_2fe1cc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_2fe1cc() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_2fe1cc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.msl
deleted file mode 100644
index 539fabc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_2fe1cc(texture2d<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_2fe1cc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_2fe1cc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_2fe1cc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.spvasm
deleted file mode 100644
index a7be6be..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_2fe1cc "textureDimensions_2fe1cc"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_2fe1cc = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_2fe1cc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.wgsl
deleted file mode 100644
index 3a5bc62..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/2fe1cc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_2fe1cc() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_2fe1cc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_2fe1cc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_2fe1cc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl
new file mode 100644
index 0000000..ac10c7f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<u32>
+fn textureDimensions_31799c() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_31799c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_31799c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_31799c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..35f842f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_31799c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_31799c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_31799c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..35f842f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_31799c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_31799c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_31799c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl
new file mode 100644
index 0000000..f9e44f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_31799c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_31799c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_31799c() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_31799c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl
new file mode 100644
index 0000000..2636a9f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_31799c(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_31799c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_31799c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_31799c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm
new file mode 100644
index 0000000..95189a1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_31799c "textureDimensions_31799c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_31799c = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_31799c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl
new file mode 100644
index 0000000..9fdcfa9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/31799c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32uint, write>;
+
+fn textureDimensions_31799c() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_31799c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_31799c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_31799c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl
deleted file mode 100644
index dd4bfd1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> i32
-fn textureDimensions_318ecc() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_318ecc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_318ecc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_318ecc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bc9b732..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_318ecc() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_318ecc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_318ecc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bc9b732..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_318ecc() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_318ecc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_318ecc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.glsl
deleted file mode 100644
index 078e8b3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_318ecc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_318ecc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_318ecc() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_318ecc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.msl
deleted file mode 100644
index a9655f5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_318ecc(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_318ecc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_318ecc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_318ecc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.spvasm
deleted file mode 100644
index c65dba9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_318ecc "textureDimensions_318ecc"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_318ecc = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_318ecc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.wgsl
deleted file mode 100644
index 9a7028c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/318ecc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16uint, write>;
-
-fn textureDimensions_318ecc() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_318ecc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_318ecc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_318ecc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl
deleted file mode 100644
index df9309b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32uint, write>) -> vec3<i32>
-fn textureDimensions_340d06() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_340d06();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_340d06();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_340d06();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.dxc.hlsl
deleted file mode 100644
index db01f68..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_340d06() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_340d06();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_340d06();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_340d06();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.fxc.hlsl
deleted file mode 100644
index db01f68..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_340d06() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_340d06();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_340d06();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_340d06();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.glsl
deleted file mode 100644
index 78d4994..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_340d06();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_340d06();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_340d06() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_340d06();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.msl
deleted file mode 100644
index eb04eb8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_340d06(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_340d06(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_340d06(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_340d06(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.spvasm
deleted file mode 100644
index c58da9b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_340d06 "textureDimensions_340d06"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_340d06 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_340d06
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_340d06
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_340d06
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.wgsl
deleted file mode 100644
index 99bca2d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/340d06.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32uint, write>;
-
-fn textureDimensions_340d06() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_340d06();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_340d06();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_340d06();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl
new file mode 100644
index 0000000..b13043f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_346fee() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_346fee();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_346fee();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_346fee();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6bf97f1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_346fee() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_346fee();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_346fee();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6bf97f1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_346fee() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_346fee();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_346fee();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl
new file mode 100644
index 0000000..713c960
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_346fee();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_346fee();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_346fee() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_346fee();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl
new file mode 100644
index 0000000..52f884c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_346fee(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_346fee(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_346fee(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_346fee(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm
new file mode 100644
index 0000000..76366c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_346fee "textureDimensions_346fee"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_346fee = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_346fee
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl
new file mode 100644
index 0000000..49d81d1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/346fee.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_346fee() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_346fee();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_346fee();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_346fee();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl
new file mode 100644
index 0000000..23512e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16uint, write>) -> vec3<u32>
+fn textureDimensions_35a7e5() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35a7e5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35a7e5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..89ff223
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35a7e5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35a7e5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35a7e5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..89ff223
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35a7e5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35a7e5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35a7e5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl
new file mode 100644
index 0000000..02d2d30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_35a7e5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35a7e5() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_35a7e5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl
new file mode 100644
index 0000000..5e7177a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_35a7e5(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_35a7e5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_35a7e5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_35a7e5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c6fd1b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_35a7e5 "textureDimensions_35a7e5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_35a7e5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_35a7e5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl
new file mode 100644
index 0000000..bea8f76
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35a7e5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16uint, write>;
+
+fn textureDimensions_35a7e5() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35a7e5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35a7e5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35a7e5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl
new file mode 100644
index 0000000..b63e75f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<u32>
+fn textureDimensions_35ee69() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35ee69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35ee69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35ee69();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9880c32
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35ee69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35ee69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35ee69();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9880c32
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_35ee69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_35ee69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_35ee69();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl
new file mode 100644
index 0000000..a338d42
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_35ee69();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_35ee69();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_35ee69() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_35ee69();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl
new file mode 100644
index 0000000..de21a7c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_35ee69(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_35ee69(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_35ee69(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_35ee69(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm
new file mode 100644
index 0000000..492a8e3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_35ee69 "textureDimensions_35ee69"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_35ee69 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_35ee69
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl
new file mode 100644
index 0000000..3a1050d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/35ee69.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32uint, write>;
+
+fn textureDimensions_35ee69() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_35ee69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_35ee69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_35ee69();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl
new file mode 100644
index 0000000..b0ce2cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<u32>
+fn textureDimensions_378a65() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_378a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_378a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_378a65();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1782677
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_378a65() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_378a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_378a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1782677
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_378a65() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_378a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_378a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl
new file mode 100644
index 0000000..54d2060
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_378a65();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_378a65();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_378a65() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_378a65();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl
new file mode 100644
index 0000000..8db7c6e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_378a65(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_378a65(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_378a65(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_378a65(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm
new file mode 100644
index 0000000..e2429ce
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_378a65 "textureDimensions_378a65"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_378a65 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_378a65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl
new file mode 100644
index 0000000..0400b2f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/378a65.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8sint, write>;
+
+fn textureDimensions_378a65() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_378a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_378a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_378a65();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl
new file mode 100644
index 0000000..099c025
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_382b16() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_382b16();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_382b16();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_382b16();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..08a087b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_382b16() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_382b16();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_382b16();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..08a087b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_382b16() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_382b16();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_382b16();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl
new file mode 100644
index 0000000..9141112
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_382b16();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_382b16();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_382b16() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_382b16();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl
new file mode 100644
index 0000000..117e519
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_382b16(texturecube<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_382b16(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_382b16(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_382b16(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm
new file mode 100644
index 0000000..7029638
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_382b16 "textureDimensions_382b16"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_382b16 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_382b16
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl
new file mode 100644
index 0000000..85183e0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/382b16.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_382b16() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_382b16();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_382b16();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_382b16();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl
new file mode 100644
index 0000000..2e817b8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_3963d0() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3963d0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3963d0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3963d0();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..68a795a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3963d0() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3963d0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3963d0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..68a795a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3963d0() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3963d0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3963d0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl
new file mode 100644
index 0000000..2d0bfef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3963d0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3963d0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3963d0() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_3963d0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl
new file mode 100644
index 0000000..297bcf7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3963d0(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_3963d0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3963d0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3963d0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c7c7e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.spvasm
@@ -0,0 +1,86 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3963d0 "textureDimensions_3963d0"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3963d0 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %uint_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %uint %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %22 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_3963d0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl
new file mode 100644
index 0000000..7fd6e98
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3963d0.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_3963d0() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3963d0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3963d0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3963d0();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl
deleted file mode 100644
index f4c0975..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<i32>
-fn textureDimensions_398e30() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_398e30();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_398e30();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_398e30();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ee95c58..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_398e30() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_398e30();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_398e30();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ee95c58..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_398e30() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_398e30();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_398e30();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.glsl
deleted file mode 100644
index 6db6351..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_398e30();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_398e30();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_398e30() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_398e30();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.msl
deleted file mode 100644
index 8de5617..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_398e30(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_398e30(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_398e30(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_398e30(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.spvasm
deleted file mode 100644
index 9339841..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_398e30 "textureDimensions_398e30"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_398e30 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_398e30
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_398e30
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_398e30
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.wgsl
deleted file mode 100644
index 5deab7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/398e30.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
-
-fn textureDimensions_398e30() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_398e30();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_398e30();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_398e30();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl
new file mode 100644
index 0000000..941dd1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<u32>
+fn textureDimensions_3a5bb1() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a5bb1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a5bb1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..634df9f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a5bb1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a5bb1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..634df9f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a5bb1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a5bb1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a5bb1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl
new file mode 100644
index 0000000..ca53343
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3a5bb1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_3a5bb1() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_3a5bb1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl
new file mode 100644
index 0000000..0b128b7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3a5bb1(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_3a5bb1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3a5bb1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3a5bb1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm
new file mode 100644
index 0000000..c804df1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3a5bb1 "textureDimensions_3a5bb1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3a5bb1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3a5bb1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl
new file mode 100644
index 0000000..16c8913
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a5bb1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32float, write>;
+
+fn textureDimensions_3a5bb1() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a5bb1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a5bb1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a5bb1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl
new file mode 100644
index 0000000..ad105d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8unorm, write>) -> vec2<u32>
+fn textureDimensions_3a7b69() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a7b69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a7b69();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c967a1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a7b69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a7b69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a7b69();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c967a1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3a7b69() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3a7b69();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3a7b69();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl
new file mode 100644
index 0000000..b9b2a19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3a7b69();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_3a7b69() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_3a7b69();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl
new file mode 100644
index 0000000..113dca5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3a7b69(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_3a7b69(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3a7b69(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3a7b69(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm
new file mode 100644
index 0000000..8dbeda7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3a7b69 "textureDimensions_3a7b69"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3a7b69 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3a7b69
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl
new file mode 100644
index 0000000..7267529
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3a7b69.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureDimensions_3a7b69() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3a7b69();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3a7b69();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3a7b69();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl
deleted file mode 100644
index db77b57..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<i32>
-fn textureDimensions_3a94ea() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3a94ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3a94ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3a94ea();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 347c92e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_3a94ea() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3a94ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3a94ea();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 347c92e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_3a94ea() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3a94ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3a94ea();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.glsl
deleted file mode 100644
index 4e7d263..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3a94ea();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3a94ea();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_3a94ea() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3a94ea();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.msl
deleted file mode 100644
index 7dd2f6b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3a94ea(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_3a94ea(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3a94ea(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3a94ea(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.spvasm
deleted file mode 100644
index 1ef266d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3a94ea "textureDimensions_3a94ea"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3a94ea = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_3a94ea
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.wgsl
deleted file mode 100644
index c1cebaf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3a94ea.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32uint, write>;
-
-fn textureDimensions_3a94ea() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3a94ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3a94ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3a94ea();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl
deleted file mode 100644
index 673d8c2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> i32
-fn textureDimensions_3aca08() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3aca08();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3aca08();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3aca08();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 05eedf3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_3aca08() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3aca08();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3aca08();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 05eedf3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_3aca08() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3aca08();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3aca08();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.glsl
deleted file mode 100644
index e9c1656..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3aca08();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3aca08();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_3aca08() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3aca08();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.msl
deleted file mode 100644
index 765771f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3aca08(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_3aca08(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3aca08(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3aca08(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.spvasm
deleted file mode 100644
index faf0eff..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3aca08 "textureDimensions_3aca08"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3aca08 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_3aca08
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.wgsl
deleted file mode 100644
index 1a72665..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3aca08.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32float, write>;
-
-fn textureDimensions_3aca08() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3aca08();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3aca08();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3aca08();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl
new file mode 100644
index 0000000..3b115bd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> u32
+fn textureDimensions_3af3e7() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3af3e7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3af3e7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fd65762
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3af3e7() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3af3e7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3af3e7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fd65762
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_3af3e7() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3af3e7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3af3e7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl
new file mode 100644
index 0000000..dc7f1b8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3af3e7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image1D arg_0;
+void textureDimensions_3af3e7() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_3af3e7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl
new file mode 100644
index 0000000..3623ce7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3af3e7(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_3af3e7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3af3e7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3af3e7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm
new file mode 100644
index 0000000..5ab0115
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3af3e7 "textureDimensions_3af3e7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3af3e7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3af3e7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl
new file mode 100644
index 0000000..35da220
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3af3e7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8unorm, write>;
+
+fn textureDimensions_3af3e7() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3af3e7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3af3e7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3af3e7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl
new file mode 100644
index 0000000..bafaabe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d) -> vec2<u32>
+fn textureDimensions_3b38f6() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3b38f6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3b38f6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4d33804
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_3b38f6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3b38f6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3b38f6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4d33804
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_3b38f6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3b38f6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3b38f6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl
new file mode 100644
index 0000000..129932f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3b38f6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_3b38f6() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_3b38f6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl
new file mode 100644
index 0000000..4e768f8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3b38f6(depth2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_3b38f6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3b38f6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3b38f6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc00d06
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3b38f6 "textureDimensions_3b38f6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3b38f6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3b38f6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl
new file mode 100644
index 0000000..f217d69
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3b38f6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_3b38f6() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3b38f6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3b38f6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3b38f6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl
new file mode 100644
index 0000000..a8563c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8uint, write>) -> vec2<u32>
+fn textureDimensions_3baab5() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3baab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3baab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3baab5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..09829f6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_3baab5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3baab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3baab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..09829f6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_3baab5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3baab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3baab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl
new file mode 100644
index 0000000..e5fd931
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3baab5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3baab5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_3baab5() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_3baab5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl
new file mode 100644
index 0000000..fabb265
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3baab5(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_3baab5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3baab5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3baab5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm
new file mode 100644
index 0000000..f11c499
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3baab5 "textureDimensions_3baab5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3baab5 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_3baab5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl
new file mode 100644
index 0000000..35891f4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3baab5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureDimensions_3baab5() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3baab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3baab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3baab5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl
deleted file mode 100644
index 3fe2fb6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8sint, write>) -> vec2<i32>
-fn textureDimensions_3c5ad8() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3c5ad8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3c5ad8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 78cd91b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_3c5ad8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3c5ad8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3c5ad8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 78cd91b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_3c5ad8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_3c5ad8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_3c5ad8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.glsl
deleted file mode 100644
index b27ab3b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_3c5ad8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_3c5ad8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_3c5ad8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.msl
deleted file mode 100644
index ba7e47a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_3c5ad8(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_3c5ad8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_3c5ad8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_3c5ad8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.spvasm
deleted file mode 100644
index f91c033..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_3c5ad8 "textureDimensions_3c5ad8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_3c5ad8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_3c5ad8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.wgsl
deleted file mode 100644
index a73139d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/3c5ad8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8sint, write>;
-
-fn textureDimensions_3c5ad8() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_3c5ad8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_3c5ad8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_3c5ad8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl
new file mode 100644
index 0000000..0d184bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_3c66f0() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3c66f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3c66f0();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..317cb94
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3c66f0() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3c66f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3c66f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..317cb94
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_3c66f0() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3c66f0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3c66f0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl
new file mode 100644
index 0000000..7210170
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3c66f0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_3c66f0() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_3c66f0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl
new file mode 100644
index 0000000..8a8d417
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3c66f0(texturecube_array<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_3c66f0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3c66f0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3c66f0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm
new file mode 100644
index 0000000..30391be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.spvasm
@@ -0,0 +1,86 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3c66f0 "textureDimensions_3c66f0"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3c66f0 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_3c66f0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl
new file mode 100644
index 0000000..333b92f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3c66f0.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_3c66f0() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3c66f0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3c66f0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3c66f0();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl
new file mode 100644
index 0000000..4762ddd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<u32>
+fn textureDimensions_3f3474() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3f3474();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3f3474();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3f3474();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..588227e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3f3474() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3f3474();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3f3474();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..588227e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3f3474() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3f3474();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3f3474();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl
new file mode 100644
index 0000000..91d50d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_3f3474();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_3f3474();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_3f3474() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_3f3474();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl
new file mode 100644
index 0000000..1ab3e70
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3f3474(texture2d_ms<float, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureDimensions_3f3474(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3f3474(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3f3474(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm
new file mode 100644
index 0000000..b9f1b47
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3f3474 "textureDimensions_3f3474"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3f3474 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_3f3474
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl
new file mode 100644
index 0000000..d1db5f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3f3474.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureDimensions_3f3474() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3f3474();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3f3474();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3f3474();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl
new file mode 100644
index 0000000..f62bd78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_3fc3dc() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3fc3dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3fc3dc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e41a8c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3fc3dc() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3fc3dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e41a8c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_3fc3dc() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_3fc3dc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_3fc3dc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl
new file mode 100644
index 0000000..37caf64
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_3fc3dc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_3fc3dc() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_3fc3dc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl
new file mode 100644
index 0000000..e924aaf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_3fc3dc(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_3fc3dc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_3fc3dc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_3fc3dc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm
new file mode 100644
index 0000000..e412ae9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_3fc3dc "textureDimensions_3fc3dc"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_3fc3dc = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_3fc3dc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl
new file mode 100644
index 0000000..42e3074
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/3fc3dc.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_3fc3dc() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_3fc3dc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_3fc3dc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_3fc3dc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl
new file mode 100644
index 0000000..8611ca5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8sint, write>) -> vec3<u32>
+fn textureDimensions_40c671() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40c671();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40c671();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40c671();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..74aa4ef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_40c671() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40c671();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40c671();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..74aa4ef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_40c671() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40c671();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40c671();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl
new file mode 100644
index 0000000..6494fd0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_40c671();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_40c671();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_40c671() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_40c671();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl
new file mode 100644
index 0000000..d737668
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40c671(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_40c671(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_40c671(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_40c671(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm
new file mode 100644
index 0000000..c1c8494
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_40c671 "textureDimensions_40c671"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40c671 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_40c671
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e38a8b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40c671.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8sint, write>;
+
+fn textureDimensions_40c671() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40c671();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40c671();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40c671();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl
new file mode 100644
index 0000000..4b387f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<u32>
+fn textureDimensions_40ecf4() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40ecf4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40ecf4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..76e4032
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_40ecf4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40ecf4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40ecf4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..76e4032
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_40ecf4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_40ecf4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_40ecf4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl
new file mode 100644
index 0000000..8eab55c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_40ecf4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_40ecf4() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_40ecf4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl
new file mode 100644
index 0000000..1ee450a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_40ecf4(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_40ecf4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_40ecf4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_40ecf4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm
new file mode 100644
index 0000000..ea8ee52
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_40ecf4 "textureDimensions_40ecf4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_40ecf4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_40ecf4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl
new file mode 100644
index 0000000..5732ee2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/40ecf4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureDimensions_40ecf4() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_40ecf4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_40ecf4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_40ecf4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl
deleted file mode 100644
index 2e88d1b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<i32>
-fn textureDimensions_4152a6() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4152a6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4152a6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4152a6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ae5eb35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_4152a6() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4152a6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4152a6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ae5eb35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_4152a6() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4152a6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4152a6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.glsl
deleted file mode 100644
index d3120a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_4152a6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_4152a6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_4152a6() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_4152a6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.msl
deleted file mode 100644
index ac8d43d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4152a6(texturecube_array<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_4152a6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4152a6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4152a6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.spvasm
deleted file mode 100644
index e092546..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 41
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4152a6 "textureDimensions_4152a6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpConstantNull %v2int
- %27 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4152a6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %26
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySizeLod %v3int %22 %int_0
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %27
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %33
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_4152a6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.wgsl
deleted file mode 100644
index 67521ab..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4152a6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_4152a6() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4152a6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4152a6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4152a6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl
new file mode 100644
index 0000000..cc79e7c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32uint, write>) -> vec2<u32>
+fn textureDimensions_41545f() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_41545f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_41545f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_41545f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6352cad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_41545f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_41545f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_41545f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6352cad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_41545f() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_41545f();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_41545f();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl
new file mode 100644
index 0000000..542e625
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_41545f();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_41545f();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_41545f() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_41545f();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl
new file mode 100644
index 0000000..6d66d30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_41545f(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_41545f(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_41545f(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_41545f(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm
new file mode 100644
index 0000000..e5a2d6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_41545f "textureDimensions_41545f"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_41545f = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_41545f
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl
new file mode 100644
index 0000000..119c226
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/41545f.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureDimensions_41545f() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_41545f();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_41545f();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_41545f();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl
deleted file mode 100644
index f358b83..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>) -> i32
-fn textureDimensions_423f99() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_423f99();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_423f99();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_423f99();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d6a4e4b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_423f99() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_423f99();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_423f99();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_423f99();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d6a4e4b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_423f99() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_423f99();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_423f99();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_423f99();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.glsl
deleted file mode 100644
index 08f2e24..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_423f99();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_423f99();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_423f99() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_423f99();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.msl
deleted file mode 100644
index 77b610f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_423f99(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_423f99(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_423f99(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_423f99(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.spvasm
deleted file mode 100644
index 807bc78..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_423f99 "textureDimensions_423f99"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_423f99 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %18 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_423f99
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_423f99
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_423f99
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.wgsl
deleted file mode 100644
index 0ef4f77..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/423f99.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_423f99() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_423f99();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_423f99();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_423f99();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl
deleted file mode 100644
index cbe8ae3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<i32>
-fn textureDimensions_4267ee() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4267ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4267ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4267ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index aab581e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_4267ee() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4267ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4267ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index aab581e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_4267ee() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4267ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4267ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.glsl
deleted file mode 100644
index c1f09fa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_4267ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_4267ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_4267ee() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_4267ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.msl
deleted file mode 100644
index 177015d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4267ee(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_4267ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4267ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4267ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.spvasm
deleted file mode 100644
index a93a79d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4267ee "textureDimensions_4267ee"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4267ee = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_4267ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.wgsl
deleted file mode 100644
index a634268..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4267ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32float, write>;
-
-fn textureDimensions_4267ee() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4267ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4267ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4267ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl
deleted file mode 100644
index 1cb8613..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8unorm, write>) -> i32
-fn textureDimensions_42d4e6() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_42d4e6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_42d4e6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_42d4e6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7c81817..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_42d4e6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_42d4e6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_42d4e6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7c81817..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_42d4e6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_42d4e6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_42d4e6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.glsl
deleted file mode 100644
index f59d175..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_42d4e6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_42d4e6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image1D arg_0;
-void textureDimensions_42d4e6() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_42d4e6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.msl
deleted file mode 100644
index cc3fa54..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_42d4e6(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_42d4e6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_42d4e6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_42d4e6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.spvasm
deleted file mode 100644
index 4127ab0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_42d4e6 "textureDimensions_42d4e6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_42d4e6 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_42d4e6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.wgsl
deleted file mode 100644
index ab0376b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/42d4e6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8unorm, write>;
-
-fn textureDimensions_42d4e6() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_42d4e6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_42d4e6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_42d4e6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl
new file mode 100644
index 0000000..42b6803
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<u32>
+fn textureDimensions_439651() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_439651();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_439651();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_439651();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5a450e7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_439651() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_439651();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_439651();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5a450e7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_439651() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_439651();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_439651();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl
new file mode 100644
index 0000000..d997ea7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_439651();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_439651();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_439651() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_439651();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl
new file mode 100644
index 0000000..6c456ef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_439651(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_439651(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_439651(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_439651(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm
new file mode 100644
index 0000000..d5f13da
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_439651 "textureDimensions_439651"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_439651 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_439651
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_439651
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_439651
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl
new file mode 100644
index 0000000..d99bc45
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/439651.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32sint, write>;
+
+fn textureDimensions_439651() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_439651();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_439651();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_439651();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl
new file mode 100644
index 0000000..ed4441c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>) -> vec2<u32>
+fn textureDimensions_445376() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_445376();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_445376();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_445376();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c60935
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_445376() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_445376();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_445376();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c60935
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_445376() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_445376();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_445376();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl
new file mode 100644
index 0000000..9854fcf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_445376();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_445376();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_445376() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_445376();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl
new file mode 100644
index 0000000..de6d82a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_445376(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_445376(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_445376(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_445376(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm
new file mode 100644
index 0000000..f9cf186
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_445376 "textureDimensions_445376"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_445376 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_445376
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_445376
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_445376
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl
new file mode 100644
index 0000000..9b3d28b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/445376.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_445376() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_445376();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_445376();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_445376();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl
new file mode 100644
index 0000000..505488f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<u32>
+fn textureDimensions_44b358() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_44b358();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_44b358();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_44b358();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..28733d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_44b358() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_44b358();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_44b358();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..28733d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_44b358() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_44b358();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_44b358();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl
new file mode 100644
index 0000000..b8140ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_44b358();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_44b358();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_44b358() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_44b358();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl
new file mode 100644
index 0000000..3fdd338
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_44b358(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_44b358(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_44b358(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_44b358(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm
new file mode 100644
index 0000000..d3cbbcd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_44b358 "textureDimensions_44b358"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_44b358 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_44b358
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl
new file mode 100644
index 0000000..de45407
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/44b358.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32uint, write>;
+
+fn textureDimensions_44b358() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_44b358();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_44b358();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_44b358();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl
new file mode 100644
index 0000000..a156207
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32uint, write>) -> vec2<u32>
+fn textureDimensions_452fc1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_452fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_452fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_452fc1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1a21c49
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_452fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_452fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_452fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1a21c49
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_452fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_452fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_452fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl
new file mode 100644
index 0000000..7588f6a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_452fc1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_452fc1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureDimensions_452fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_452fc1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl
new file mode 100644
index 0000000..291394f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_452fc1(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureDimensions_452fc1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_452fc1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_452fc1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..4fd3aa9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_452fc1 "textureDimensions_452fc1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_452fc1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_452fc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..5f78af1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/452fc1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureDimensions_452fc1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_452fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_452fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_452fc1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl
new file mode 100644
index 0000000..4fe62b8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<u32>
+fn textureDimensions_46f0fc() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_46f0fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_46f0fc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f82b087
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_46f0fc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_46f0fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_46f0fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f82b087
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_46f0fc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_46f0fc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_46f0fc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl
new file mode 100644
index 0000000..8ca5717
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_46f0fc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_46f0fc() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_46f0fc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl
new file mode 100644
index 0000000..d085a9b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_46f0fc(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_46f0fc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_46f0fc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_46f0fc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm
new file mode 100644
index 0000000..5847f93
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_46f0fc "textureDimensions_46f0fc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_46f0fc = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_46f0fc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl
new file mode 100644
index 0000000..f968df1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/46f0fc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureDimensions_46f0fc() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_46f0fc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_46f0fc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_46f0fc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl
deleted file mode 100644
index 95910e9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<i32>
-fn textureDimensions_48cb89() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_48cb89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_48cb89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_48cb89();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9ec64be..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_48cb89() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_48cb89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_48cb89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9ec64be..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_48cb89() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_48cb89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_48cb89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.glsl
deleted file mode 100644
index 026fcaef..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_48cb89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_48cb89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2D arg_0;
-void textureDimensions_48cb89() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_48cb89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.msl
deleted file mode 100644
index 5f475e2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_48cb89(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_48cb89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_48cb89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_48cb89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.spvasm
deleted file mode 100644
index 9a887dc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_48cb89 "textureDimensions_48cb89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_48cb89 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_48cb89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.wgsl
deleted file mode 100644
index 2e4ee35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/48cb89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16float, write>;
-
-fn textureDimensions_48cb89() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_48cb89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_48cb89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_48cb89();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl
new file mode 100644
index 0000000..06d6e02
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_49a067() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_49a067();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_49a067();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_49a067();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3e60709
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_49a067() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_49a067();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_49a067();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3e60709
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_49a067() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_49a067();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_49a067();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl
new file mode 100644
index 0000000..e093e1c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_49a067();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_49a067();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_49a067() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_49a067();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl
new file mode 100644
index 0000000..21fd040
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_49a067(texturecube<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_49a067(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_49a067(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_49a067(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm
new file mode 100644
index 0000000..40ea0e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_49a067 "textureDimensions_49a067"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_49a067 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_49a067
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl
new file mode 100644
index 0000000..7ea6a80
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/49a067.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_49a067() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_49a067();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_49a067();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_49a067();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl
deleted file mode 100644
index ee9101f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<i32>
-fn textureDimensions_49d274() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_49d274();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_49d274();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_49d274();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9ceff50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_49d274() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_49d274();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_49d274();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9ceff50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_49d274() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_49d274();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_49d274();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.glsl
deleted file mode 100644
index 70347a6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_49d274();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_49d274();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_49d274() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_49d274();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.msl
deleted file mode 100644
index 4ca4453..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_49d274(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_49d274(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_49d274(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_49d274(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.spvasm
deleted file mode 100644
index 9a63680..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_49d274 "textureDimensions_49d274"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_49d274 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_49d274
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_49d274
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_49d274
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.wgsl
deleted file mode 100644
index 060af23..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/49d274.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
-
-fn textureDimensions_49d274() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_49d274();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_49d274();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_49d274();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl
new file mode 100644
index 0000000..a11f1c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<u32>
+fn textureDimensions_4acec7() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4acec7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4acec7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4acec7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fcad56d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4acec7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4acec7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4acec7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fcad56d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4acec7() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4acec7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4acec7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl
new file mode 100644
index 0000000..b94e7fa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_4acec7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_4acec7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_4acec7() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_4acec7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl
new file mode 100644
index 0000000..1647a14
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4acec7(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_4acec7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4acec7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4acec7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm
new file mode 100644
index 0000000..de0e0ab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4acec7 "textureDimensions_4acec7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4acec7 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_4acec7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl
new file mode 100644
index 0000000..38343eb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4acec7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureDimensions_4acec7() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4acec7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4acec7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4acec7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl
new file mode 100644
index 0000000..5dcc74b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8unorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<u32>
+fn textureDimensions_4b26ef() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4b26ef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4b26ef();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e783ce
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4b26ef() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4b26ef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4b26ef();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e783ce
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_4b26ef() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4b26ef();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4b26ef();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl
new file mode 100644
index 0000000..e7491ce
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_4b26ef();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image3D arg_0;
+void textureDimensions_4b26ef() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_4b26ef();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl
new file mode 100644
index 0000000..5efcbfa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4b26ef(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_4b26ef(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4b26ef(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4b26ef(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm
new file mode 100644
index 0000000..ab7781f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4b26ef "textureDimensions_4b26ef"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4b26ef = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_4b26ef
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl
new file mode 100644
index 0000000..c12b60c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4b26ef.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8unorm, write>;
+
+fn textureDimensions_4b26ef() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4b26ef();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4b26ef();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4b26ef();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl
new file mode 100644
index 0000000..49432db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>) -> vec2<u32>
+fn textureDimensions_4be71b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4be71b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4be71b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4be71b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bf593db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_4be71b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4be71b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4be71b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bf593db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_4be71b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_4be71b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_4be71b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl
new file mode 100644
index 0000000..13a1e30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_4be71b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_4be71b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_4be71b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_4be71b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl
new file mode 100644
index 0000000..7bbfb11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_4be71b(texture2d<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_4be71b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_4be71b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_4be71b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm
new file mode 100644
index 0000000..0bbbd21
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_4be71b "textureDimensions_4be71b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_4be71b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_4be71b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl
new file mode 100644
index 0000000..cea7772
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/4be71b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_4be71b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_4be71b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_4be71b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_4be71b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl
deleted file mode 100644
index 8878859..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_4d42cf() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4d42cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4d42cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4d42cf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ffe5165..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_4d42cf() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4d42cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4d42cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ffe5165..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_4d42cf() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4d42cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4d42cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.glsl
deleted file mode 100644
index 80a93e1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_4d42cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_4d42cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_4d42cf() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_4d42cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.msl
deleted file mode 100644
index 3876b26..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4d42cf(texture2d<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_4d42cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4d42cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4d42cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.spvasm
deleted file mode 100644
index 60daa9b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4d42cf "textureDimensions_4d42cf"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4d42cf = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %22 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_4d42cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.wgsl
deleted file mode 100644
index 46f0072..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4d42cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_4d42cf() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4d42cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4d42cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4d42cf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl
deleted file mode 100644
index fc79c53..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> i32
-fn textureDimensions_4df9a8() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4df9a8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4df9a8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4df9a8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8541c75..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_4df9a8() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4df9a8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4df9a8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8541c75..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_4df9a8() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_4df9a8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_4df9a8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.glsl
deleted file mode 100644
index 7871ed7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_4df9a8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_4df9a8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_4df9a8() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_4df9a8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.msl
deleted file mode 100644
index 54723cb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_4df9a8(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_4df9a8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_4df9a8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_4df9a8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.spvasm
deleted file mode 100644
index c4be2a7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_4df9a8 "textureDimensions_4df9a8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_4df9a8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_4df9a8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.wgsl
deleted file mode 100644
index b771310..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/4df9a8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32uint, write>;
-
-fn textureDimensions_4df9a8() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_4df9a8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_4df9a8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_4df9a8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl
deleted file mode 100644
index f7b5a63..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_50a9ee() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_50a9ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_50a9ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_50a9ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9e011d0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_50a9ee() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_50a9ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_50a9ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9e011d0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_50a9ee() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_50a9ee();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_50a9ee();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.glsl
deleted file mode 100644
index e06d866..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_50a9ee();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_50a9ee();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_50a9ee() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_50a9ee();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.msl
deleted file mode 100644
index 0d2f391..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_50a9ee(texturecube_array<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_50a9ee(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_50a9ee(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_50a9ee(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.spvasm
deleted file mode 100644
index b96f4f2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_50a9ee "textureDimensions_50a9ee"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_50a9ee = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_50a9ee
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.wgsl
deleted file mode 100644
index 220c9b5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/50a9ee.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_50a9ee() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_50a9ee();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_50a9ee();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_50a9ee();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl
deleted file mode 100644
index 31db829..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureDimensions(texture: texture_1d<i32>, level: i32) -> i32
-fn textureDimensions_52045c() {
- var arg_1 = 1i;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_52045c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_52045c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_52045c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c3ff009..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_52045c() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_52045c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_52045c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_52045c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c3ff009..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_52045c() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_52045c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_52045c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_52045c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.glsl
deleted file mode 100644
index d4f8701..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_52045c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_52045c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureDimensions_52045c() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_52045c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.msl
deleted file mode 100644
index 7fe228a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_52045c(texture1d<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureDimensions_52045c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_52045c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_52045c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.spvasm
deleted file mode 100644
index 2989ab6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_52045c "textureDimensions_52045c"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_52045c = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_int Function %20
- OpStore %arg_1 %int_1
- %22 = OpLoad %11 %arg_0
- %23 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %int %22 %23
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_52045c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_52045c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_52045c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.wgsl
deleted file mode 100644
index 38850ba..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/52045c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureDimensions_52045c() {
- var arg_1 = 1i;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_52045c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_52045c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_52045c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl
new file mode 100644
index 0000000..816f05b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_528c0e() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_528c0e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_528c0e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_528c0e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e270588
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_528c0e() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_528c0e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_528c0e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e270588
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_528c0e() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_528c0e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_528c0e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl
new file mode 100644
index 0000000..c639e05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_528c0e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_528c0e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_528c0e() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_528c0e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl
new file mode 100644
index 0000000..eae0de8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_528c0e(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_528c0e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_528c0e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_528c0e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm
new file mode 100644
index 0000000..969ca17
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_528c0e "textureDimensions_528c0e"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_528c0e = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_528c0e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcc8b8d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/528c0e.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_528c0e() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_528c0e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_528c0e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_528c0e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl
deleted file mode 100644
index f4fd35d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_5331e0() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5331e0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5331e0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5331e0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 2a72144..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_5331e0() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5331e0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5331e0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 2a72144..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_5331e0() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5331e0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5331e0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.glsl
deleted file mode 100644
index 4d19c59..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_5331e0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_5331e0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_5331e0() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_5331e0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.msl
deleted file mode 100644
index 4b62c26..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5331e0(texture2d<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_5331e0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5331e0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5331e0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.spvasm
deleted file mode 100644
index 57f4f74..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5331e0 "textureDimensions_5331e0"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5331e0 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_5331e0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.wgsl
deleted file mode 100644
index 632c211..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5331e0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_5331e0() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5331e0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5331e0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5331e0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl
deleted file mode 100644
index a7efa73..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> i32
-fn textureDimensions_55b23e() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_55b23e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_55b23e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_55b23e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c3634a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_55b23e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_55b23e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_55b23e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c3634a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_55b23e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_55b23e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_55b23e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.glsl
deleted file mode 100644
index a9465b8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_55b23e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_55b23e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_55b23e() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_55b23e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.msl
deleted file mode 100644
index 0778752..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_55b23e(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_55b23e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_55b23e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_55b23e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.spvasm
deleted file mode 100644
index e6470a9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_55b23e "textureDimensions_55b23e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_55b23e = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_55b23e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.wgsl
deleted file mode 100644
index 430da3c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/55b23e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32float, write>;
-
-fn textureDimensions_55b23e() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_55b23e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_55b23e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_55b23e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl
deleted file mode 100644
index 111e70b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<i32>
-fn textureDimensions_579629() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_579629();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_579629();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_579629();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 297d5dd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_579629() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_579629();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_579629();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_579629();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 297d5dd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_579629() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_579629();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_579629();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_579629();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.glsl
deleted file mode 100644
index d1ca2e7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_579629();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_579629();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureDimensions_579629() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_579629();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.msl
deleted file mode 100644
index d6c497b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_579629(texture2d_ms<uint, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
- textureDimensions_579629(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_579629(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_579629(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.spvasm
deleted file mode 100644
index 5d35bf9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_579629 "textureDimensions_579629"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_579629 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_579629
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_579629
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_579629
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.wgsl
deleted file mode 100644
index 1e1d6d7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/579629.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
-
-fn textureDimensions_579629() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_579629();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_579629();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_579629();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl
deleted file mode 100644
index f56dbbd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> i32
-fn textureDimensions_57da0b() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57da0b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57da0b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57da0b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f9df5ef..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_57da0b() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57da0b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57da0b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f9df5ef..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_57da0b() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57da0b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57da0b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.glsl
deleted file mode 100644
index c45ed2f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_57da0b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_57da0b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_57da0b() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_57da0b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.msl
deleted file mode 100644
index fb1c232..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_57da0b(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_57da0b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_57da0b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_57da0b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.spvasm
deleted file mode 100644
index 9d0c96d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_57da0b "textureDimensions_57da0b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_57da0b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_57da0b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.wgsl
deleted file mode 100644
index b599184..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57da0b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32uint, write>;
-
-fn textureDimensions_57da0b() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57da0b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57da0b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57da0b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl
deleted file mode 100644
index 9da6a8a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube) -> vec2<i32>
-fn textureDimensions_57e28f() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57e28f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57e28f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57e28f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8da8d7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_57e28f() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57e28f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57e28f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8da8d7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_57e28f() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_57e28f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_57e28f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.glsl
deleted file mode 100644
index c8713a2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_57e28f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_57e28f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_57e28f() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_57e28f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.msl
deleted file mode 100644
index c089020..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_57e28f(depthcube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_57e28f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_57e28f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_57e28f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.spvasm
deleted file mode 100644
index 9dd34bf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_57e28f "textureDimensions_57e28f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_57e28f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_57e28f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.wgsl
deleted file mode 100644
index e0b854e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/57e28f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_57e28f() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_57e28f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_57e28f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_57e28f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl
deleted file mode 100644
index ac97548..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<i32>
-fn textureDimensions_58a515() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_58a515();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_58a515();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_58a515();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e8a7b4b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_58a515() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_58a515();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_58a515();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e8a7b4b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_58a515() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_58a515();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_58a515();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.glsl
deleted file mode 100644
index b67bb0f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_58a515();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_58a515();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_58a515() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_58a515();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.msl
deleted file mode 100644
index c8d90cd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_58a515(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_58a515(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_58a515(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_58a515(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.spvasm
deleted file mode 100644
index 5afc929..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_58a515 "textureDimensions_58a515"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_58a515 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_58a515
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_58a515
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_58a515
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.wgsl
deleted file mode 100644
index 21bad72..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/58a515.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
-
-fn textureDimensions_58a515() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_58a515();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_58a515();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_58a515();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl
new file mode 100644
index 0000000..e3e1557
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16uint, write>) -> u32
+fn textureDimensions_58a82d() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_58a82d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_58a82d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_58a82d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..80b2c98
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_58a82d() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_58a82d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_58a82d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..80b2c98
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_58a82d() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_58a82d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_58a82d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl
new file mode 100644
index 0000000..2fcd82e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_58a82d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_58a82d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_58a82d() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_58a82d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl
new file mode 100644
index 0000000..34b38cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_58a82d(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_58a82d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_58a82d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_58a82d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm
new file mode 100644
index 0000000..cc519c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_58a82d "textureDimensions_58a82d"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_58a82d = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_58a82d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl
new file mode 100644
index 0000000..f61f64b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/58a82d.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16uint, write>;
+
+fn textureDimensions_58a82d() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_58a82d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_58a82d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_58a82d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl
new file mode 100644
index 0000000..062e5ad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16sint, write>) -> vec3<u32>
+fn textureDimensions_591981() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_591981();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_591981();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_591981();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4f3144c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_591981() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_591981();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_591981();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4f3144c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_591981() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_591981();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_591981();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl
new file mode 100644
index 0000000..03a38d7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_591981();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_591981();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_591981() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_591981();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl
new file mode 100644
index 0000000..b80abf1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_591981(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_591981(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_591981(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_591981(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm
new file mode 100644
index 0000000..f66c1ef
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_591981 "textureDimensions_591981"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_591981 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_591981
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_591981
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_591981
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f1b90b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/591981.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16sint, write>;
+
+fn textureDimensions_591981() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_591981();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_591981();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_591981();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl
deleted file mode 100644
index 52d9859..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<i32>
-fn textureDimensions_5985f3() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5985f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5985f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5985f3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 488cb17..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_5985f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5985f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5985f3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 488cb17..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_5985f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5985f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5985f3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.glsl
deleted file mode 100644
index 4c33a17..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_5985f3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_5985f3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_5985f3() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_5985f3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.msl
deleted file mode 100644
index 90f407d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5985f3(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_5985f3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5985f3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5985f3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.spvasm
deleted file mode 100644
index f51c50b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5985f3 "textureDimensions_5985f3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5985f3 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_5985f3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.wgsl
deleted file mode 100644
index 8449517..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5985f3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
-
-fn textureDimensions_5985f3() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5985f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5985f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5985f3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl
new file mode 100644
index 0000000..25708ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16float, write>) -> vec2<u32>
+fn textureDimensions_599ab5() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_599ab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_599ab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_599ab5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..161321e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_599ab5() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_599ab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_599ab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..161321e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_599ab5() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_599ab5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_599ab5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl
new file mode 100644
index 0000000..e4e61d5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_599ab5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_599ab5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2D arg_0;
+void textureDimensions_599ab5() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_599ab5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl
new file mode 100644
index 0000000..9d36a4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_599ab5(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_599ab5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_599ab5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_599ab5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm
new file mode 100644
index 0000000..6a2e7c1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_599ab5 "textureDimensions_599ab5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_599ab5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_599ab5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl
new file mode 100644
index 0000000..0607926
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/599ab5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16float, write>;
+
+fn textureDimensions_599ab5() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_599ab5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_599ab5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_599ab5();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl
deleted file mode 100644
index 8de30ac..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32uint, write>) -> i32
-fn textureDimensions_5caa5e() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5caa5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5caa5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5caa5e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 066fbdf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5caa5e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5caa5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5caa5e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 066fbdf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5caa5e() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5caa5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5caa5e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.glsl
deleted file mode 100644
index d02caf1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_5caa5e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_5caa5e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_5caa5e() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_5caa5e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.msl
deleted file mode 100644
index 56e5f71..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5caa5e(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_5caa5e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5caa5e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5caa5e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.spvasm
deleted file mode 100644
index 68ec968..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5caa5e "textureDimensions_5caa5e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5caa5e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_5caa5e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.wgsl
deleted file mode 100644
index ac87720..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5caa5e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32uint, write>;
-
-fn textureDimensions_5caa5e() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5caa5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5caa5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5caa5e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl
new file mode 100644
index 0000000..b89ffbb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>) -> u32
+fn textureDimensions_5df042() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_5df042();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_5df042();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_5df042();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..25b206a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_5df042() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_5df042();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5df042();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..25b206a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_5df042() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_5df042();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_5df042();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl
new file mode 100644
index 0000000..c8e4d65
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_5df042();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_5df042();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_5df042() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_5df042();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl
new file mode 100644
index 0000000..c3d1fc2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_5df042(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_5df042(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_5df042(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_5df042(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm
new file mode 100644
index 0000000..7205a05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_5df042 "textureDimensions_5df042"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_5df042 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_5df042
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl
new file mode 100644
index 0000000..8e083a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/5df042.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_5df042() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_5df042();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_5df042();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_5df042();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl
deleted file mode 100644
index 6e8e71e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16uint, write>) -> vec2<i32>
-fn textureDimensions_5e295d() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5e295d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5e295d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5e295d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a88725c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5e295d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5e295d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5e295d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a88725c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_5e295d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_5e295d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_5e295d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.glsl
deleted file mode 100644
index f079eb8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_5e295d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_5e295d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_5e295d() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_5e295d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.msl
deleted file mode 100644
index 50d3988..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_5e295d(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_5e295d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_5e295d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_5e295d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.spvasm
deleted file mode 100644
index 05297b0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_5e295d "textureDimensions_5e295d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_5e295d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_5e295d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.wgsl
deleted file mode 100644
index ae8f763..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/5e295d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
-
-fn textureDimensions_5e295d() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_5e295d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_5e295d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_5e295d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl
new file mode 100644
index 0000000..f03cde1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32sint, write>) -> u32
+fn textureDimensions_607979() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_607979();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_607979();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_607979();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8fbf889
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_607979() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_607979();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_607979();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8fbf889
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_607979() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_607979();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_607979();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl
new file mode 100644
index 0000000..5b5a4c3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_607979();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_607979();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_607979() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_607979();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl
new file mode 100644
index 0000000..360b5a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_607979(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_607979(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_607979(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_607979(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm
new file mode 100644
index 0000000..d8c6402
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_607979 "textureDimensions_607979"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_607979 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_607979
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_607979
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_607979
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl
new file mode 100644
index 0000000..d54a65b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/607979.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32sint, write>;
+
+fn textureDimensions_607979() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_607979();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_607979();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_607979();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl
deleted file mode 100644
index 36982d8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<i32>
-fn textureDimensions_60bf54() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_60bf54();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_60bf54();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_60bf54();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d7ac1d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_60bf54() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_60bf54();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_60bf54();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d7ac1d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_60bf54() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_60bf54();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_60bf54();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.glsl
deleted file mode 100644
index 91d0815..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_60bf54();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_60bf54();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_60bf54() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_60bf54();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.msl
deleted file mode 100644
index bf597c3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_60bf54(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_60bf54(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_60bf54(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_60bf54(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.spvasm
deleted file mode 100644
index 5073da1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_60bf54 "textureDimensions_60bf54"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_60bf54 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_60bf54
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.wgsl
deleted file mode 100644
index fbc7cd7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/60bf54.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32sint, write>;
-
-fn textureDimensions_60bf54() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_60bf54();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_60bf54();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_60bf54();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl
new file mode 100644
index 0000000..7d34ccd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>) -> vec2<u32>
+fn textureDimensions_62cb5a() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_62cb5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_62cb5a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9ce8aa4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_62cb5a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_62cb5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_62cb5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9ce8aa4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_62cb5a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_62cb5a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_62cb5a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl
new file mode 100644
index 0000000..421af5e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_62cb5a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_62cb5a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_62cb5a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl
new file mode 100644
index 0000000..8702a25
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_62cb5a(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_62cb5a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_62cb5a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_62cb5a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm
new file mode 100644
index 0000000..622c055
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_62cb5a "textureDimensions_62cb5a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_62cb5a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_0
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_62cb5a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl
new file mode 100644
index 0000000..4fd56a7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/62cb5a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_62cb5a() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_62cb5a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_62cb5a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_62cb5a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl
deleted file mode 100644
index deb1125..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<i32>
-fn textureDimensions_63f3cf() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_63f3cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_63f3cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_63f3cf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f03906d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_63f3cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_63f3cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_63f3cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f03906d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_63f3cf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_63f3cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_63f3cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.glsl
deleted file mode 100644
index 6a77ea9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_63f3cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_63f3cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_63f3cf() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_63f3cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.msl
deleted file mode 100644
index 931b457..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_63f3cf(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_63f3cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_63f3cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_63f3cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.spvasm
deleted file mode 100644
index f146e10..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_63f3cf "textureDimensions_63f3cf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_63f3cf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_63f3cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.wgsl
deleted file mode 100644
index 3e0ebfd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/63f3cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32float, write>;
-
-fn textureDimensions_63f3cf() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_63f3cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_63f3cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_63f3cf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl
deleted file mode 100644
index aa317c2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube, level: u32) -> vec2<i32>
-fn textureDimensions_647386() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_647386();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_647386();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_647386();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0c55003..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_647386() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_647386();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_647386();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_647386();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0c55003..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_647386() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_647386();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_647386();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_647386();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.glsl
deleted file mode 100644
index f8b6013..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_647386();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_647386();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_647386() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_647386();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.msl
deleted file mode 100644
index c2d57d1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_647386(depthcube<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_647386(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_647386(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_647386(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.spvasm
deleted file mode 100644
index 9421e4c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_647386 "textureDimensions_647386"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_647386 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_647386
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_647386
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_647386
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.wgsl
deleted file mode 100644
index 291fd11..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/647386.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_647386() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_647386();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_647386();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_647386();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl
new file mode 100644
index 0000000..5264a0c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_64dc74() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_64dc74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_64dc74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_64dc74();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2a454c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_64dc74() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_64dc74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_64dc74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2a454c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_64dc74() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_64dc74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_64dc74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl
new file mode 100644
index 0000000..c6d050b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_64dc74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_64dc74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_64dc74() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_64dc74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl
new file mode 100644
index 0000000..a8cfc3e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_64dc74(texturecube<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_64dc74(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_64dc74(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_64dc74(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm
new file mode 100644
index 0000000..60b1d3b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_64dc74 "textureDimensions_64dc74"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_64dc74 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %uint_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %uint %arg_1
+ %22 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_64dc74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl
new file mode 100644
index 0000000..878928c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/64dc74.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_64dc74() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_64dc74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_64dc74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_64dc74();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl
new file mode 100644
index 0000000..5e964b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32sint, write>) -> vec2<u32>
+fn textureDimensions_674058() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_674058();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_674058();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_674058();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9369bd2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_674058() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_674058();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_674058();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9369bd2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_674058() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_674058();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_674058();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl
new file mode 100644
index 0000000..7e3dc84
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_674058();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_674058();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_674058() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_674058();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl
new file mode 100644
index 0000000..6c86158
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_674058(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_674058(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_674058(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_674058(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm
new file mode 100644
index 0000000..b312fbf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_674058 "textureDimensions_674058"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_674058 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_674058
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_674058
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_674058
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl
new file mode 100644
index 0000000..207af65
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/674058.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureDimensions_674058() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_674058();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_674058();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_674058();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl
deleted file mode 100644
index 6a41cfe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<i32>
-fn textureDimensions_68105c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_68105c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_68105c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_68105c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c372328..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_68105c() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_68105c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_68105c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_68105c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c372328..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_68105c() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_68105c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_68105c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_68105c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.glsl
deleted file mode 100644
index d366071..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_68105c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_68105c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_68105c() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_68105c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.msl
deleted file mode 100644
index a1fdb63..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_68105c(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_68105c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_68105c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_68105c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.spvasm
deleted file mode 100644
index 471b570..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_68105c "textureDimensions_68105c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_68105c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_68105c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_68105c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_68105c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.wgsl
deleted file mode 100644
index 19c4929..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/68105c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32uint, write>;
-
-fn textureDimensions_68105c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_68105c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_68105c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_68105c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl
deleted file mode 100644
index ff32044..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_686ef2() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_686ef2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_686ef2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_686ef2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 62725b4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_686ef2() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_686ef2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_686ef2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 62725b4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_686ef2() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_686ef2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_686ef2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.glsl
deleted file mode 100644
index 01a4cee..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_686ef2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_686ef2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_686ef2() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_686ef2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.msl
deleted file mode 100644
index d7bb244..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_686ef2(texturecube<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_686ef2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_686ef2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_686ef2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.spvasm
deleted file mode 100644
index f77e1fd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_686ef2 "textureDimensions_686ef2"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_686ef2 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_686ef2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.wgsl
deleted file mode 100644
index ebc53a5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/686ef2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_686ef2() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_686ef2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_686ef2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_686ef2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl
deleted file mode 100644
index d2d4a11..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> i32
-fn textureDimensions_6adac6() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6adac6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6adac6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6adac6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 52b2080..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_6adac6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6adac6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6adac6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 52b2080..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_6adac6() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6adac6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6adac6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.glsl
deleted file mode 100644
index acaaa5a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_6adac6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_6adac6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_6adac6() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_6adac6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.msl
deleted file mode 100644
index 7087625..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6adac6(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_6adac6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6adac6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6adac6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.spvasm
deleted file mode 100644
index 363af60..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6adac6 "textureDimensions_6adac6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6adac6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6adac6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.wgsl
deleted file mode 100644
index 8ab67f0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6adac6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32sint, write>;
-
-fn textureDimensions_6adac6() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6adac6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6adac6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6adac6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl
new file mode 100644
index 0000000..136d80e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>, level: u32) -> vec3<u32>
+fn textureDimensions_6e6c7a() {
+ var arg_1 = 1u;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6e6c7a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6e6c7a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b930c2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_6e6c7a() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6e6c7a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b930c2e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_6e6c7a() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6e6c7a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6e6c7a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl
new file mode 100644
index 0000000..9e5d060
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_6e6c7a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_6e6c7a() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_6e6c7a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl
new file mode 100644
index 0000000..6edcc20
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6e6c7a(texture3d<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_6e6c7a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_6e6c7a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_6e6c7a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a72a35
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6e6c7a "textureDimensions_6e6c7a"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %27 = OpConstantNull %v3uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_6e6c7a = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v3uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v3uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_6e6c7a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl
new file mode 100644
index 0000000..4073327
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6e6c7a.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_6e6c7a() {
+ var arg_1 = 1u;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6e6c7a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6e6c7a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6e6c7a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl
deleted file mode 100644
index 62b84fd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_6eae7f() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6eae7f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6eae7f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6eae7f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b39d4cc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_6eae7f() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6eae7f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6eae7f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b39d4cc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_6eae7f() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6eae7f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6eae7f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.glsl
deleted file mode 100644
index d9dbf803..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_6eae7f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_6eae7f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_6eae7f() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_6eae7f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.msl
deleted file mode 100644
index 7560fd6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6eae7f(texturecube<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_6eae7f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6eae7f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6eae7f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.spvasm
deleted file mode 100644
index b794707..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6eae7f "textureDimensions_6eae7f"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6eae7f = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %22 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_6eae7f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.wgsl
deleted file mode 100644
index 8205d78..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6eae7f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_6eae7f() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6eae7f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6eae7f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6eae7f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl
deleted file mode 100644
index ef7fe5d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>) -> vec3<i32>
-fn textureDimensions_6ec1b4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6ec1b4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6ec1b4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6e9cb1f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_6ec1b4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6ec1b4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6ec1b4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6e9cb1f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_6ec1b4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6ec1b4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6ec1b4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.glsl
deleted file mode 100644
index 482455d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_6ec1b4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_6ec1b4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_6ec1b4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.msl
deleted file mode 100644
index 52a3369..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6ec1b4(texture3d<uint, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_6ec1b4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6ec1b4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6ec1b4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.spvasm
deleted file mode 100644
index 4f8be17..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6ec1b4 "textureDimensions_6ec1b4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %24 = OpConstantNull %v3int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6ec1b4 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_6ec1b4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.wgsl
deleted file mode 100644
index 7573c55..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6ec1b4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_6ec1b4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6ec1b4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6ec1b4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6ec1b4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl
deleted file mode 100644
index 2e0eb57..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<i32>
-fn textureDimensions_6f0d79() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6f0d79();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6f0d79();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6f0d79();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cd1a3a4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_6f0d79() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6f0d79();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6f0d79();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cd1a3a4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_6f0d79() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_6f0d79();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_6f0d79();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.glsl
deleted file mode 100644
index 71893cb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_6f0d79();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_6f0d79();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_6f0d79() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_6f0d79();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.msl
deleted file mode 100644
index 5154f6c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_6f0d79(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_6f0d79(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_6f0d79(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_6f0d79(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.spvasm
deleted file mode 100644
index f1032b6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_6f0d79 "textureDimensions_6f0d79"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_6f0d79 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_6f0d79
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.wgsl
deleted file mode 100644
index b055eea..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/6f0d79.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
-
-fn textureDimensions_6f0d79() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_6f0d79();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_6f0d79();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_6f0d79();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl
new file mode 100644
index 0000000..d4e1e80
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2<u32>
+fn textureDimensions_6f1b5d() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6f1b5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6f1b5d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a6a31de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_6f1b5d() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6f1b5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a6a31de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_6f1b5d() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_6f1b5d();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_6f1b5d();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl
new file mode 100644
index 0000000..ee9d548
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_6f1b5d();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_6f1b5d() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_6f1b5d();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl
new file mode 100644
index 0000000..9628555
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_6f1b5d(depth2d<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_6f1b5d(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_6f1b5d(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_6f1b5d(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm
new file mode 100644
index 0000000..f0ab644
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_6f1b5d "textureDimensions_6f1b5d"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_6f1b5d = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_6f1b5d
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl
new file mode 100644
index 0000000..a0fb93d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/6f1b5d.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_6f1b5d() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_6f1b5d();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_6f1b5d();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_6f1b5d();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl
deleted file mode 100644
index 99afe61..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8unorm, write>) -> vec2<i32>
-fn textureDimensions_702c53() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_702c53();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_702c53();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_702c53();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 40c27c8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_702c53() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_702c53();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_702c53();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_702c53();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 40c27c8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_702c53() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_702c53();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_702c53();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_702c53();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.glsl
deleted file mode 100644
index e4f0c34..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_702c53();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_702c53();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2D arg_0;
-void textureDimensions_702c53() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_702c53();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.msl
deleted file mode 100644
index d202631..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_702c53(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_702c53(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_702c53(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_702c53(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.spvasm
deleted file mode 100644
index 514d19f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_702c53 "textureDimensions_702c53"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_702c53 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_702c53
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_702c53
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_702c53
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.wgsl
deleted file mode 100644
index 093625d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/702c53.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8unorm, write>;
-
-fn textureDimensions_702c53() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_702c53();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_702c53();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_702c53();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl
deleted file mode 100644
index 623c316..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>, level: u32) -> vec3<i32>
-fn textureDimensions_71b9f4() {
- var arg_1 = 1u;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_71b9f4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_71b9f4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_71b9f4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 407d300..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_71b9f4() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_71b9f4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_71b9f4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 407d300..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_71b9f4() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_71b9f4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_71b9f4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.glsl
deleted file mode 100644
index 6294f19..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_71b9f4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_71b9f4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_71b9f4() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_71b9f4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.msl
deleted file mode 100644
index 21a0b0a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_71b9f4(texture3d<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_71b9f4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_71b9f4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_71b9f4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.spvasm
deleted file mode 100644
index d48fdbf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_71b9f4 "textureDimensions_71b9f4"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %28 = OpConstantNull %v3int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_71b9f4 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_v3int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %22 = OpImageQuerySizeLod %v3int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_71b9f4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.wgsl
deleted file mode 100644
index 816599d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/71b9f4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_71b9f4() {
- var arg_1 = 1u;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_71b9f4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_71b9f4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_71b9f4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl
new file mode 100644
index 0000000..48176cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32uint, write>) -> u32
+fn textureDimensions_7228de() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7228de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7228de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7228de();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..79216e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_7228de() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7228de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7228de();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..79216e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_7228de() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7228de();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7228de();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl
new file mode 100644
index 0000000..d148823
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7228de();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_7228de();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_7228de() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_7228de();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl
new file mode 100644
index 0000000..d5d9363
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7228de(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_7228de(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7228de(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7228de(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm
new file mode 100644
index 0000000..defd7fb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7228de "textureDimensions_7228de"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7228de = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7228de
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl
new file mode 100644
index 0000000..6f791d8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7228de.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32uint, write>;
+
+fn textureDimensions_7228de() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7228de();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7228de();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7228de();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl
deleted file mode 100644
index effe723..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2<i32>
-fn textureDimensions_72e5d6() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_72e5d6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_72e5d6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_72e5d6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 53e6671..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_72e5d6() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_72e5d6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_72e5d6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 53e6671..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_72e5d6() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_72e5d6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_72e5d6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.glsl
deleted file mode 100644
index 1f2fc86..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_72e5d6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_72e5d6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_72e5d6() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_72e5d6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.msl
deleted file mode 100644
index 2de47be..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_72e5d6(depth2d_array<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_72e5d6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_72e5d6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_72e5d6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.spvasm
deleted file mode 100644
index 6c0e739..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,84 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_72e5d6 "textureDimensions_72e5d6"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_72e5d6 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_72e5d6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.wgsl
deleted file mode 100644
index a0def88..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/72e5d6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_72e5d6() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_72e5d6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_72e5d6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_72e5d6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl
new file mode 100644
index 0000000..336207e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>, level: i32) -> vec3<u32>
+fn textureDimensions_756031() {
+ var arg_1 = 1i;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756031();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756031();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756031();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9e45538
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_756031() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756031();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756031();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9e45538
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_756031() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756031();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756031();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl
new file mode 100644
index 0000000..02ed7ea
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_756031();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_756031();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_756031() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_756031();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl
new file mode 100644
index 0000000..c267c67
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_756031(texture3d<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_756031(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_756031(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_756031(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm
new file mode 100644
index 0000000..38d19dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_756031 "textureDimensions_756031"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %28 = OpConstantNull %v3uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_756031 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v3uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v3uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_756031
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_756031
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_756031
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl
new file mode 100644
index 0000000..389c758
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756031.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_756031() {
+ var arg_1 = 1i;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756031();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756031();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756031();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl
new file mode 100644
index 0000000..d06fb96
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<u32>
+fn textureDimensions_756304() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756304();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756304();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756304();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..70b5dc9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_756304() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756304();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756304();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..70b5dc9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_756304() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_756304();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_756304();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl
new file mode 100644
index 0000000..a1d9085
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_756304();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_756304();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_756304() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_756304();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl
new file mode 100644
index 0000000..21be296f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_756304(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_756304(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_756304(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_756304(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm
new file mode 100644
index 0000000..2c2eeb3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_756304 "textureDimensions_756304"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_756304 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_756304
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_756304
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_756304
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl
new file mode 100644
index 0000000..16fcc5c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/756304.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureDimensions_756304() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_756304();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_756304();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_756304();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl
new file mode 100644
index 0000000..a45a3fe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2<u32>
+fn textureDimensions_79d168() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_79d168();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_79d168();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_79d168();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4bbc5c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_79d168() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_79d168();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_79d168();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4bbc5c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_79d168() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_79d168();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_79d168();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl
new file mode 100644
index 0000000..34e9119
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_79d168();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_79d168();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_79d168() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_79d168();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl
new file mode 100644
index 0000000..08a009b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_79d168(depthcube<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_79d168(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_79d168(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_79d168(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm
new file mode 100644
index 0000000..88d67cd3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_79d168 "textureDimensions_79d168"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_79d168 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_79d168
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl
new file mode 100644
index 0000000..eba133c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/79d168.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_79d168() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_79d168();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_79d168();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_79d168();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl
deleted file mode 100644
index 9669ba9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>, level: i32) -> i32
-fn textureDimensions_79df87() {
- var arg_1 = 1i;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_79df87();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_79df87();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_79df87();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 149c28f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_79df87() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_79df87();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_79df87();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_79df87();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 149c28f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_79df87() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_79df87();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_79df87();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_79df87();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.glsl
deleted file mode 100644
index 1b5edf0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_79df87();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_79df87();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_79df87() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_79df87();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.msl
deleted file mode 100644
index b62c801..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_79df87(texture1d<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_79df87(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_79df87(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_79df87(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.spvasm
deleted file mode 100644
index 6fdc63c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.spvasm
+++ /dev/null
@@ -1,81 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_79df87 "textureDimensions_79df87"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_79df87 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_int Function %21
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %22 = OpImageQuerySizeLod %int %23 %24
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_79df87
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_79df87
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_79df87
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.wgsl
deleted file mode 100644
index 2eba528..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/79df87.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_79df87() {
- var arg_1 = 1i;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_79df87();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_79df87();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_79df87();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl
new file mode 100644
index 0000000..30e8a51
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>) -> vec3<u32>
+fn textureDimensions_7a3890() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a3890();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a3890();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a3890();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3a01cb7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a3890() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a3890();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a3890();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3a01cb7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a3890() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a3890();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a3890();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl
new file mode 100644
index 0000000..533a4f8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7a3890();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_7a3890();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_7a3890() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_7a3890();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl
new file mode 100644
index 0000000..3118213
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7a3890(texture3d<uint, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_7a3890(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7a3890(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7a3890(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm
new file mode 100644
index 0000000..43921a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7a3890 "textureDimensions_7a3890"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7a3890 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v3uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_7a3890
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl
new file mode 100644
index 0000000..82213cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a3890.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_7a3890() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a3890();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a3890();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a3890();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl
new file mode 100644
index 0000000..9d1f0b9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>) -> vec2<u32>
+fn textureDimensions_7a9e30() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a9e30();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a9e30();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..12d975c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a9e30() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a9e30();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a9e30();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..12d975c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_7a9e30() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_7a9e30();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_7a9e30();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl
new file mode 100644
index 0000000..c7e9efa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_7a9e30();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_7a9e30() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_7a9e30();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl
new file mode 100644
index 0000000..4456cad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_7a9e30(texturecube<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_7a9e30(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_7a9e30(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_7a9e30(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm
new file mode 100644
index 0000000..b036bf4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_7a9e30 "textureDimensions_7a9e30"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_7a9e30 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_7a9e30
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd784d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/7a9e30.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_7a9e30() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_7a9e30();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_7a9e30();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_7a9e30();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl
deleted file mode 100644
index 8245cc2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureDimensions(texture: texture_depth_2d_array) -> vec2<i32>
-fn textureDimensions_7bf826() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7bf826();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7bf826();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7bf826();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9c0e675..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_7bf826() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7bf826();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7bf826();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9c0e675..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureDimensions_7bf826() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7bf826();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7bf826();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.glsl
deleted file mode 100644
index 9859cdd9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_7bf826();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_7bf826();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_7bf826() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_7bf826();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.msl
deleted file mode 100644
index 59cd373..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7bf826(depth2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_7bf826(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7bf826(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7bf826(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.spvasm
deleted file mode 100644
index 2229e18..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7bf826 "textureDimensions_7bf826"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7bf826 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_7bf826
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.wgsl
deleted file mode 100644
index 4953ba3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7bf826.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureDimensions_7bf826() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7bf826();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7bf826();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7bf826();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl
deleted file mode 100644
index 1ced4d8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>, level: u32) -> vec2<i32>
-fn textureDimensions_7c8821() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7c8821();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7c8821();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7c8821();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f7ce2e2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_7c8821() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7c8821();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7c8821();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f7ce2e2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_7c8821() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7c8821();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7c8821();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.glsl
deleted file mode 100644
index bbb0144..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_7c8821();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_7c8821();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_7c8821() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_7c8821();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.msl
deleted file mode 100644
index e8839a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7c8821(texture2d_array<int, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_7c8821(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7c8821(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7c8821(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.spvasm
deleted file mode 100644
index 33509d2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7c8821 "textureDimensions_7c8821"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %21 = OpConstantNull %uint
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7c8821 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %21
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %22 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_7c8821
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.wgsl
deleted file mode 100644
index 9baa51c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7c8821.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_7c8821() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7c8821();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7c8821();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7c8821();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl
deleted file mode 100644
index 87caa44..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rg32sint, write>) -> vec2<i32>
-fn textureDimensions_7f5c2e() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7f5c2e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7f5c2e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9c6abe3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_7f5c2e() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7f5c2e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7f5c2e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9c6abe3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_7f5c2e() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_7f5c2e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_7f5c2e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.glsl
deleted file mode 100644
index ed85e7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_7f5c2e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_7f5c2e() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_7f5c2e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.msl
deleted file mode 100644
index f853ebc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_7f5c2e(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_7f5c2e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_7f5c2e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_7f5c2e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.spvasm
deleted file mode 100644
index 5a25cc1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_7f5c2e "textureDimensions_7f5c2e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_7f5c2e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_7f5c2e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.wgsl
deleted file mode 100644
index 85bbc4b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/7f5c2e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32sint, write>;
-
-fn textureDimensions_7f5c2e() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_7f5c2e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_7f5c2e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_7f5c2e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl
deleted file mode 100644
index 99c4483..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<i32>
-fn textureDimensions_8028f3() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8028f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8028f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8028f3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f18db34..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8028f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8028f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8028f3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f18db34..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8028f3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8028f3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8028f3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.glsl
deleted file mode 100644
index 4ac9ac9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8028f3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_8028f3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8028f3() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_8028f3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.msl
deleted file mode 100644
index efc7793..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8028f3(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_8028f3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8028f3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8028f3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.spvasm
deleted file mode 100644
index 814b999..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8028f3 "textureDimensions_8028f3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8028f3 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8028f3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.wgsl
deleted file mode 100644
index fbc1979..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8028f3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<r32float, write>;
-
-fn textureDimensions_8028f3() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8028f3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8028f3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8028f3();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl
deleted file mode 100644
index 630debe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32uint, write>) -> vec3<i32>
-fn textureDimensions_811679() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_811679();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_811679();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_811679();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a474cba..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_811679() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_811679();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_811679();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_811679();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a474cba..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_811679() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_811679();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_811679();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_811679();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.glsl
deleted file mode 100644
index 152d367..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_811679();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_811679();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_811679() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_811679();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.msl
deleted file mode 100644
index 825c3ad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_811679(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_811679(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_811679(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_811679(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.spvasm
deleted file mode 100644
index c051822..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_811679 "textureDimensions_811679"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_811679 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_811679
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_811679
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_811679
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.wgsl
deleted file mode 100644
index 494c1da..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/811679.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32uint, write>;
-
-fn textureDimensions_811679() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_811679();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_811679();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_811679();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl
deleted file mode 100644
index 793ab47..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rg32uint, write>) -> vec3<i32>
-fn textureDimensions_820596() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_820596();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_820596();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_820596();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.dxc.hlsl
deleted file mode 100644
index af2f262..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_820596() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_820596();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_820596();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_820596();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.fxc.hlsl
deleted file mode 100644
index af2f262..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_820596() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_820596();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_820596();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_820596();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.glsl
deleted file mode 100644
index 12ee4ec..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_820596();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_820596();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_820596() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_820596();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.msl
deleted file mode 100644
index 1ecf8c9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_820596(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_820596(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_820596(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_820596(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.spvasm
deleted file mode 100644
index a657294..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_820596 "textureDimensions_820596"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_820596 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_820596
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_820596
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_820596
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.wgsl
deleted file mode 100644
index dc1379f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/820596.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32uint, write>;
-
-fn textureDimensions_820596() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_820596();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_820596();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_820596();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl
deleted file mode 100644
index d0a3eab..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<i32>
-fn textureDimensions_83ee5a() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_83ee5a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_83ee5a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_83ee5a();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl
deleted file mode 100644
index efa903a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_83ee5a() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_83ee5a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_83ee5a();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl
deleted file mode 100644
index efa903a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_83ee5a() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_83ee5a();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_83ee5a();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.glsl
deleted file mode 100644
index 1f6ce58..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_83ee5a();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_83ee5a();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_83ee5a() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_83ee5a();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.msl
deleted file mode 100644
index 29cff8f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_83ee5a(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_83ee5a(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_83ee5a(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_83ee5a(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.spvasm
deleted file mode 100644
index 32e7431..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_83ee5a "textureDimensions_83ee5a"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_83ee5a = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_83ee5a
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.wgsl
deleted file mode 100644
index 0d0d5ea..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/83ee5a.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32sint, write>;
-
-fn textureDimensions_83ee5a() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_83ee5a();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_83ee5a();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_83ee5a();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl
deleted file mode 100644
index aba5847..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_85d556() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_85d556();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_85d556();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_85d556();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6551492..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_85d556() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_85d556();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_85d556();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6551492..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_85d556() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_85d556();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_85d556();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.glsl
deleted file mode 100644
index 55c998e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_85d556();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_85d556();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_85d556() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_85d556();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.msl
deleted file mode 100644
index 50e7447..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_85d556(texture2d_array<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_85d556(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_85d556(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_85d556(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.spvasm
deleted file mode 100644
index 1831dda..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.spvasm
+++ /dev/null
@@ -1,84 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_85d556 "textureDimensions_85d556"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_85d556 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_85d556
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_85d556
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_85d556
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.wgsl
deleted file mode 100644
index 4da38ad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/85d556.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_85d556() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_85d556();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_85d556();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_85d556();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl
new file mode 100644
index 0000000..2a6540f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8snorm, write>) -> vec2<u32>
+fn textureDimensions_867ead() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_867ead();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_867ead();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_867ead();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c3db085
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_867ead() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_867ead();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_867ead();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c3db085
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_867ead() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_867ead();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_867ead();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl
new file mode 100644
index 0000000..ed270a8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_867ead();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_867ead();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_867ead() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_867ead();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl
new file mode 100644
index 0000000..7985b52
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_867ead(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_867ead(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_867ead(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_867ead(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm
new file mode 100644
index 0000000..d0dac2c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_867ead "textureDimensions_867ead"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_867ead = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_867ead
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl
new file mode 100644
index 0000000..50f701a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/867ead.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureDimensions_867ead() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_867ead();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_867ead();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_867ead();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl
new file mode 100644
index 0000000..c3f7003
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<u32>
+fn textureDimensions_879b73() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_879b73();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_879b73();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_879b73();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8e2f821
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_879b73() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_879b73();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_879b73();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8e2f821
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_879b73() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_879b73();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_879b73();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl
new file mode 100644
index 0000000..fe9a84b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_879b73();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_879b73();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_879b73() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_879b73();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl
new file mode 100644
index 0000000..f452786
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_879b73(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_879b73(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_879b73(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_879b73(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm
new file mode 100644
index 0000000..f5199b0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_879b73 "textureDimensions_879b73"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_879b73 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_879b73
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl
new file mode 100644
index 0000000..6078916
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/879b73.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_879b73() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_879b73();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_879b73();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_879b73();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl
deleted file mode 100644
index 8bc8ea6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_88ad17() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_88ad17();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_88ad17();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_88ad17();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5ddabd1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_88ad17() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_88ad17();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_88ad17();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5ddabd1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_88ad17() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_88ad17();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_88ad17();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.glsl
deleted file mode 100644
index 589f41e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_88ad17();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_88ad17();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_88ad17() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_88ad17();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.msl
deleted file mode 100644
index 84b817a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_88ad17(texturecube<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_88ad17(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_88ad17(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_88ad17(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.spvasm
deleted file mode 100644
index 505de31..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_88ad17 "textureDimensions_88ad17"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_88ad17 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %int_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %int %arg_1
- %22 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_88ad17
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.wgsl
deleted file mode 100644
index 5518327..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/88ad17.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_88ad17() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_88ad17();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_88ad17();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_88ad17();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl
new file mode 100644
index 0000000..349d4aa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32float, write>) -> vec2<u32>
+fn textureDimensions_8a35f9() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8a35f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8a35f9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cb72f96
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8a35f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8a35f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8a35f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cb72f96
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_8a35f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8a35f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8a35f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl
new file mode 100644
index 0000000..2da1261
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_8a35f9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_8a35f9() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_8a35f9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl
new file mode 100644
index 0000000..f3c2d7c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8a35f9(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_8a35f9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_8a35f9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_8a35f9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3a454b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8a35f9 "textureDimensions_8a35f9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8a35f9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8a35f9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl
new file mode 100644
index 0000000..04585f3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8a35f9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32float, write>;
+
+fn textureDimensions_8a35f9() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8a35f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8a35f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8a35f9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl
deleted file mode 100644
index 4a9ac37..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>) -> vec3<i32>
-fn textureDimensions_8aa4c4() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8aa4c4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8aa4c4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e8a2fa1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8aa4c4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8aa4c4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8aa4c4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e8a2fa1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8aa4c4() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8aa4c4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8aa4c4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.glsl
deleted file mode 100644
index 45495e9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8aa4c4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_8aa4c4() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_8aa4c4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.msl
deleted file mode 100644
index 77f5715..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8aa4c4(texture3d<float, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_8aa4c4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8aa4c4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8aa4c4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.spvasm
deleted file mode 100644
index 4b2376f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8aa4c4 "textureDimensions_8aa4c4"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8aa4c4 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v3int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_8aa4c4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.wgsl
deleted file mode 100644
index 840105b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8aa4c4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_8aa4c4() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8aa4c4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8aa4c4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8aa4c4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl
deleted file mode 100644
index 3ea127b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_8d87ed() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8d87ed();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8d87ed();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8d87ed();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 29572e5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_8d87ed() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8d87ed();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8d87ed();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 29572e5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_8d87ed() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8d87ed();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8d87ed();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.glsl
deleted file mode 100644
index bbfcd7a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_8d87ed();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_8d87ed();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_8d87ed() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_8d87ed();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.msl
deleted file mode 100644
index 9569829..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8d87ed(texturecube<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_8d87ed(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8d87ed(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8d87ed(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.spvasm
deleted file mode 100644
index d8f2408..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8d87ed "textureDimensions_8d87ed"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8d87ed = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_8d87ed
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.wgsl
deleted file mode 100644
index 8b60de3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8d87ed.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_8d87ed() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8d87ed();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8d87ed();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8d87ed();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl
deleted file mode 100644
index 9ecc26f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>) -> vec3<i32>
-fn textureDimensions_8deb5e() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8deb5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8deb5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8deb5e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 398823e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_8deb5e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8deb5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8deb5e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 398823e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_8deb5e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8deb5e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8deb5e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.glsl
deleted file mode 100644
index 8869c19..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8deb5e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_8deb5e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_8deb5e() {
- ivec3 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_8deb5e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.msl
deleted file mode 100644
index 7899845..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8deb5e(texture3d<int, access::sample> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_8deb5e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8deb5e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8deb5e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.spvasm
deleted file mode 100644
index 7afdac3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8deb5e "textureDimensions_8deb5e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8deb5e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v3int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_8deb5e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.wgsl
deleted file mode 100644
index c3e10c7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8deb5e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_8deb5e() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8deb5e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8deb5e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8deb5e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl
new file mode 100644
index 0000000..e4931ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32sint, write>) -> u32
+fn textureDimensions_8efd47() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8efd47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8efd47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8efd47();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0ec2359
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_8efd47() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8efd47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8efd47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0ec2359
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_8efd47() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_8efd47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_8efd47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl
new file mode 100644
index 0000000..ae3365d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_8efd47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_8efd47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_8efd47() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_8efd47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl
new file mode 100644
index 0000000..1aa9fa8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_8efd47(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_8efd47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_8efd47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_8efd47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb6145d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_8efd47 "textureDimensions_8efd47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_8efd47 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_8efd47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl
new file mode 100644
index 0000000..791a3af
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/8efd47.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32sint, write>;
+
+fn textureDimensions_8efd47() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_8efd47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_8efd47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_8efd47();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl
deleted file mode 100644
index f5e7f3a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureDimensions(texture: texture_cube_array<f32>) -> vec2<i32>
-fn textureDimensions_8f20bf() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8f20bf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8f20bf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8f20bf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 58462cf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8f20bf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8f20bf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8f20bf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 58462cf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_8f20bf() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8f20bf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8f20bf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.glsl
deleted file mode 100644
index a01eead..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_8f20bf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_8f20bf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_8f20bf() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_8f20bf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.msl
deleted file mode 100644
index 431a454..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8f20bf(texturecube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_8f20bf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8f20bf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8f20bf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.spvasm
deleted file mode 100644
index 952b3d4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8f20bf "textureDimensions_8f20bf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8f20bf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_8f20bf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.wgsl
deleted file mode 100644
index 2d3dcb0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8f20bf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureDimensions_8f20bf() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8f20bf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8f20bf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8f20bf();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl
deleted file mode 100644
index 9492de6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32float, write>) -> vec3<i32>
-fn textureDimensions_8fca0f() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8fca0f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8fca0f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8fca0f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ace86e0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8fca0f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8fca0f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8fca0f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ace86e0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_8fca0f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_8fca0f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_8fca0f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.glsl
deleted file mode 100644
index 255924a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_8fca0f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_8fca0f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image3D arg_0;
-void textureDimensions_8fca0f() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_8fca0f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.msl
deleted file mode 100644
index f104902..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_8fca0f(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_8fca0f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_8fca0f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_8fca0f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.spvasm
deleted file mode 100644
index 0f3281e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_8fca0f "textureDimensions_8fca0f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_8fca0f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_8fca0f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.wgsl
deleted file mode 100644
index 6ef7d1b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/8fca0f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32float, write>;
-
-fn textureDimensions_8fca0f() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_8fca0f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_8fca0f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_8fca0f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl
new file mode 100644
index 0000000..3a8b15e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32float, write>) -> vec3<u32>
+fn textureDimensions_902179() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_902179();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_902179();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_902179();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1c84269
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_902179() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_902179();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_902179();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1c84269
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_902179() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_902179();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_902179();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl
new file mode 100644
index 0000000..24eeebf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_902179();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_902179();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_902179() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_902179();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl
new file mode 100644
index 0000000..ff7f11b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_902179(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_902179(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_902179(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_902179(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm
new file mode 100644
index 0000000..cdb6d12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_902179 "textureDimensions_902179"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_902179 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_902179
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_902179
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_902179
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl
new file mode 100644
index 0000000..81da1cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/902179.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32float, write>;
+
+fn textureDimensions_902179() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_902179();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_902179();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_902179();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl
deleted file mode 100644
index 86f40ed..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array) -> vec2<i32>
-fn textureDimensions_90340b() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_90340b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_90340b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_90340b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 26df72f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_90340b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_90340b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_90340b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 26df72f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_90340b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_90340b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_90340b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.glsl
deleted file mode 100644
index 09d10eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_90340b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_90340b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_90340b() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_90340b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.msl
deleted file mode 100644
index f585531..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_90340b(depthcube_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_90340b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_90340b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_90340b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.spvasm
deleted file mode 100644
index 5d4d7e7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_90340b "textureDimensions_90340b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_90340b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_90340b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_90340b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_90340b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.wgsl
deleted file mode 100644
index c70e0d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/90340b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_90340b() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_90340b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_90340b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_90340b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl
deleted file mode 100644
index 1f6eb1c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32uint, write>) -> vec2<i32>
-fn textureDimensions_9042ab() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9042ab();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9042ab();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9042ab();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 95dc105..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9042ab() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9042ab();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9042ab();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 95dc105..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9042ab() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9042ab();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9042ab();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.glsl
deleted file mode 100644
index 1fb6520..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9042ab();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_9042ab();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureDimensions_9042ab() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_9042ab();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.msl
deleted file mode 100644
index 5f29287..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9042ab(texture2d_array<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureDimensions_9042ab(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9042ab(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9042ab(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.spvasm
deleted file mode 100644
index d0099a0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9042ab "textureDimensions_9042ab"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9042ab = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %22 = OpLoad %11 %arg_0
- %20 = OpImageQuerySize %v3int %22
- %17 = OpVectorShuffle %v2int %20 %20 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_9042ab
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.wgsl
deleted file mode 100644
index 1602fd8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9042ab.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
-
-fn textureDimensions_9042ab() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9042ab();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9042ab();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9042ab();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl
new file mode 100644
index 0000000..fde73cb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<u32>
+fn textureDimensions_90dd74() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_90dd74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_90dd74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_90dd74();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6e10196
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_90dd74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_90dd74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_90dd74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6e10196
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_90dd74() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_90dd74();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_90dd74();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl
new file mode 100644
index 0000000..4e0747d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_90dd74();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_90dd74();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_90dd74() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_90dd74();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl
new file mode 100644
index 0000000..8439e12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_90dd74(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_90dd74(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_90dd74(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_90dd74(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm
new file mode 100644
index 0000000..0fe6302
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_90dd74 "textureDimensions_90dd74"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_90dd74 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_90dd74
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl
new file mode 100644
index 0000000..d5471c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/90dd74.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureDimensions_90dd74() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_90dd74();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_90dd74();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_90dd74();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl
new file mode 100644
index 0000000..1abb76d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>, level: i32) -> u32
+fn textureDimensions_920006() {
+ var arg_1 = 1i;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_920006();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_920006();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_920006();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9349790
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_920006() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_920006();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_920006();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9349790
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_920006() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_920006();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_920006();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl
new file mode 100644
index 0000000..270dde9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_920006();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_920006();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_920006() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_920006();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl
new file mode 100644
index 0000000..3cdcaca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_920006(texture1d<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_920006(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_920006(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_920006(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm
new file mode 100644
index 0000000..54be5e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_920006 "textureDimensions_920006"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %27 = OpConstantNull %uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_920006 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_uint Function %27
+ OpStore %arg_1 %int_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %int %arg_1
+ %22 = OpImageQuerySizeLod %uint %23 %24
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_920006
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_920006
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_920006
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ba89cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/920006.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_920006() {
+ var arg_1 = 1i;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_920006();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_920006();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_920006();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl
new file mode 100644
index 0000000..d4677e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> u32
+fn textureDimensions_92552e() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_92552e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_92552e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_92552e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6afab39
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_92552e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_92552e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_92552e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6afab39
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_92552e() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_92552e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_92552e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl
new file mode 100644
index 0000000..aea8be7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_92552e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_92552e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_92552e() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_92552e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl
new file mode 100644
index 0000000..b291fc2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_92552e(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_92552e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_92552e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_92552e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm
new file mode 100644
index 0000000..900be97
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_92552e "textureDimensions_92552e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_92552e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_92552e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d970314
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/92552e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8sint, write>;
+
+fn textureDimensions_92552e() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_92552e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_92552e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_92552e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl
deleted file mode 100644
index d7a6c66..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2<i32>
-fn textureDimensions_9393b0() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9393b0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9393b0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9393b0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ec3d721..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_9393b0() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9393b0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9393b0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ec3d721..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureDimensions_9393b0() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9393b0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9393b0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.glsl
deleted file mode 100644
index 5994404..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_9393b0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_9393b0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_9393b0() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_9393b0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.msl
deleted file mode 100644
index 6b68de3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9393b0(depthcube<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureDimensions_9393b0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9393b0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9393b0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.spvasm
deleted file mode 100644
index 900814b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9393b0 "textureDimensions_9393b0"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9393b0 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_9393b0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.wgsl
deleted file mode 100644
index e3163f2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9393b0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureDimensions_9393b0() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9393b0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9393b0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9393b0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl
deleted file mode 100644
index 6914338..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d) -> vec2<i32>
-fn textureDimensions_939fdb() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_939fdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_939fdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_939fdb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1edab80..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_939fdb() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_939fdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_939fdb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1edab80..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_939fdb() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_939fdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_939fdb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.glsl
deleted file mode 100644
index 380941e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_939fdb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_939fdb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_939fdb() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_939fdb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.msl
deleted file mode 100644
index a6283fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_939fdb(depth2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_939fdb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_939fdb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_939fdb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.spvasm
deleted file mode 100644
index 7e41c36..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_939fdb "textureDimensions_939fdb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_939fdb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_939fdb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.wgsl
deleted file mode 100644
index eda2bcb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/939fdb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_939fdb() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_939fdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_939fdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_939fdb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl
deleted file mode 100644
index 55c8637..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureDimensions(texture: texture_depth_2d, level: u32) -> vec2<i32>
-fn textureDimensions_941d6e() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_941d6e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_941d6e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_941d6e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3288317..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_941d6e() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_941d6e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_941d6e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3288317..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureDimensions_941d6e() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_941d6e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_941d6e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.glsl
deleted file mode 100644
index 596c594..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_941d6e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_941d6e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_941d6e() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_941d6e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.msl
deleted file mode 100644
index 23a2e59..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_941d6e(depth2d<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureDimensions_941d6e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_941d6e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_941d6e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.spvasm
deleted file mode 100644
index 3742022..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_941d6e "textureDimensions_941d6e"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_941d6e = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_941d6e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.wgsl
deleted file mode 100644
index 28c022e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/941d6e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureDimensions_941d6e() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_941d6e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_941d6e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_941d6e();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl
new file mode 100644
index 0000000..917ddec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rg32uint, write>) -> vec2<u32>
+fn textureDimensions_9573f3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9573f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9573f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9573f3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4d8998d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9573f3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9573f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9573f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4d8998d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_9573f3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9573f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9573f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl
new file mode 100644
index 0000000..fa06ee3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9573f3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_9573f3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_9573f3() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_9573f3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl
new file mode 100644
index 0000000..f0fa2a7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9573f3(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_9573f3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9573f3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9573f3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1f6cc3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9573f3 "textureDimensions_9573f3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9573f3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9573f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..de5167b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9573f3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rg32uint, write>;
+
+fn textureDimensions_9573f3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9573f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9573f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9573f3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl
deleted file mode 100644
index f13a2e0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>, level: u32) -> vec2<i32>
-fn textureDimensions_95b2db() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_95b2db();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_95b2db();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_95b2db();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 08889aa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_95b2db() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_95b2db();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_95b2db();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 08889aa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_95b2db() {
- uint arg_1 = 1u;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_95b2db();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_95b2db();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.glsl
deleted file mode 100644
index 6fe419a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_95b2db();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_95b2db();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_95b2db() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_95b2db();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.msl
deleted file mode 100644
index da2b344..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_95b2db(texturecube<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_95b2db(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_95b2db(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_95b2db(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.spvasm
deleted file mode 100644
index bd03b31..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_95b2db "textureDimensions_95b2db"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_95b2db = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_95b2db
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.wgsl
deleted file mode 100644
index 401bfba..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/95b2db.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_95b2db() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_95b2db();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_95b2db();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_95b2db();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl
deleted file mode 100644
index af253df..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureDimensions(texture: texture_cube<i32>) -> vec2<i32>
-fn textureDimensions_962dcd() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_962dcd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_962dcd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_962dcd();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7f1c1eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_962dcd() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_962dcd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_962dcd();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7f1c1eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_962dcd() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_962dcd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_962dcd();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.glsl
deleted file mode 100644
index ded4e42..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_962dcd();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_962dcd();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureDimensions_962dcd() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_962dcd();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.msl
deleted file mode 100644
index 052154f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_962dcd(texturecube<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureDimensions_962dcd(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_962dcd(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_962dcd(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.spvasm
deleted file mode 100644
index ceac95f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_962dcd "textureDimensions_962dcd"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_962dcd = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_962dcd
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.wgsl
deleted file mode 100644
index bd3ca7a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/962dcd.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureDimensions_962dcd() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_962dcd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_962dcd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_962dcd();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl
new file mode 100644
index 0000000..a09022b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>) -> u32
+fn textureDimensions_965645() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_965645();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_965645();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_965645();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..285b9f8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_965645() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_965645();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_965645();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..285b9f8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_965645() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_965645();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_965645();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl
new file mode 100644
index 0000000..1aaef12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_965645();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_965645();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_965645() {
+ uint res = uint(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_965645();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl
new file mode 100644
index 0000000..6d38430
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_965645(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_965645(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_965645(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_965645(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e8f9a4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_965645 "textureDimensions_965645"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_965645 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %uint %18 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_965645
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_965645
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_965645
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl
new file mode 100644
index 0000000..45ddf97
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/965645.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_965645() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_965645();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_965645();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_965645();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl
new file mode 100644
index 0000000..0f82afb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<u32>
+fn textureDimensions_98b2d3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_98b2d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_98b2d3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..70d774f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_98b2d3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_98b2d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_98b2d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..70d774f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_98b2d3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_98b2d3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_98b2d3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl
new file mode 100644
index 0000000..7b14e6c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_98b2d3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureDimensions_98b2d3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_98b2d3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl
new file mode 100644
index 0000000..dc4a496
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_98b2d3(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_98b2d3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_98b2d3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_98b2d3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm
new file mode 100644
index 0000000..d511aaa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_98b2d3 "textureDimensions_98b2d3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_98b2d3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySizeLod %v3uint %22 %int_0
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_98b2d3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl
new file mode 100644
index 0000000..8609f45
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/98b2d3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureDimensions_98b2d3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_98b2d3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_98b2d3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_98b2d3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl
new file mode 100644
index 0000000..2963a10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureDimensions(texture: texture_depth_2d, level: u32) -> vec2<u32>
+fn textureDimensions_991ea9() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_991ea9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_991ea9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_991ea9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..85bfca1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_991ea9() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_991ea9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_991ea9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..85bfca1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureDimensions_991ea9() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_991ea9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_991ea9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl
new file mode 100644
index 0000000..b58daaf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_991ea9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_991ea9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_991ea9() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_991ea9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl
new file mode 100644
index 0000000..59d9a04
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_991ea9(depth2d<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_991ea9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_991ea9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_991ea9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm
new file mode 100644
index 0000000..626c84d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_991ea9 "textureDimensions_991ea9"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_991ea9 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_991ea9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl
new file mode 100644
index 0000000..d86d15c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/991ea9.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureDimensions_991ea9() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_991ea9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_991ea9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_991ea9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl
deleted file mode 100644
index de90222..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<i32>
-fn textureDimensions_9abfe5() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9abfe5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9abfe5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9abfe5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d97dcf7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_9abfe5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9abfe5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9abfe5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d97dcf7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_9abfe5() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9abfe5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9abfe5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.glsl
deleted file mode 100644
index 0de8c91..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9abfe5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_9abfe5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_9abfe5() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_9abfe5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.msl
deleted file mode 100644
index cc19962..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9abfe5(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_9abfe5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9abfe5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9abfe5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.spvasm
deleted file mode 100644
index 6a733e8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9abfe5 "textureDimensions_9abfe5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9abfe5 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_9abfe5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.wgsl
deleted file mode 100644
index 5845daa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9abfe5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
-
-fn textureDimensions_9abfe5() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9abfe5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9abfe5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9abfe5();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl
new file mode 100644
index 0000000..25108ad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureDimensions(texture: texture_cube<f32>) -> vec2<u32>
+fn textureDimensions_9b223b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9b223b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9b223b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9b223b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..50846b9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9b223b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9b223b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9b223b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..50846b9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_9b223b() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9b223b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9b223b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl
new file mode 100644
index 0000000..c748051
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9b223b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_9b223b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_9b223b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_9b223b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl
new file mode 100644
index 0000000..ce95387
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9b223b(texturecube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureDimensions_9b223b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9b223b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9b223b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm
new file mode 100644
index 0000000..b7a28e0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9b223b "textureDimensions_9b223b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9b223b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9b223b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl
new file mode 100644
index 0000000..72fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9b223b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureDimensions_9b223b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9b223b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9b223b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9b223b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl
new file mode 100644
index 0000000..f172f38
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_9baf27() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9baf27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9baf27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9baf27();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..279596e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9baf27() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9baf27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9baf27();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..279596e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9baf27() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9baf27();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9baf27();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl
new file mode 100644
index 0000000..153994d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9baf27();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_9baf27();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9baf27() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_9baf27();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl
new file mode 100644
index 0000000..4b4fbfe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9baf27(texturecube<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9baf27(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9baf27(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9baf27(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm
new file mode 100644
index 0000000..718fea8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9baf27 "textureDimensions_9baf27"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9baf27 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_9baf27
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl
new file mode 100644
index 0000000..f3c81b5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9baf27.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_9baf27() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9baf27();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9baf27();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9baf27();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl
new file mode 100644
index 0000000..4986938
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureDimensions(texture: texture_1d<u32>, level: u32) -> u32
+fn textureDimensions_9c7a00() {
+ var arg_1 = 1u;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9c7a00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9c7a00();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ba0f2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9c7a00() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9c7a00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9c7a00();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ba0f2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9c7a00() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9c7a00();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9c7a00();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl
new file mode 100644
index 0000000..eb83b7a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9c7a00();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureDimensions_9c7a00() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_9c7a00();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl
new file mode 100644
index 0000000..a066b99
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9c7a00(texture1d<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9c7a00(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9c7a00(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9c7a00(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm
new file mode 100644
index 0000000..5f27e11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9c7a00 "textureDimensions_9c7a00"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9c7a00 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_uint Function %20
+ OpStore %arg_1 %uint_1
+ %22 = OpLoad %11 %arg_0
+ %23 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %uint %22 %23
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_9c7a00
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl
new file mode 100644
index 0000000..ee8497f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9c7a00.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureDimensions_9c7a00() {
+ var arg_1 = 1u;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9c7a00();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9c7a00();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9c7a00();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl
deleted file mode 100644
index eab7d9c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureDimensions(texture: texture_2d_array<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_9c9c57() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9c9c57();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9c9c57();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9c9c57();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 90d1b04..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_9c9c57() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9c9c57();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9c9c57();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 90d1b04..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_9c9c57() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9c9c57();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9c9c57();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.glsl
deleted file mode 100644
index f650421..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_9c9c57();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_9c9c57();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureDimensions_9c9c57() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_9c9c57();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.msl
deleted file mode 100644
index 2b13342..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9c9c57(texture2d_array<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureDimensions_9c9c57(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9c9c57(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9c9c57(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.spvasm
deleted file mode 100644
index 9cb7670..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.spvasm
+++ /dev/null
@@ -1,84 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9c9c57 "textureDimensions_9c9c57"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9c9c57 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_9c9c57
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.wgsl
deleted file mode 100644
index 0101acd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9c9c57.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureDimensions_9c9c57() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9c9c57();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9c9c57();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9c9c57();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl
new file mode 100644
index 0000000..505d9a2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureDimensions(texture: texture_cube<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_9cd4ca() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd4ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd4ca();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2d25d71
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9cd4ca() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd4ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2d25d71
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9cd4ca() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd4ca();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd4ca();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl
new file mode 100644
index 0000000..31c447e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9cd4ca();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureDimensions_9cd4ca() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_9cd4ca();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl
new file mode 100644
index 0000000..4b7c457
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9cd4ca(texturecube<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9cd4ca(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9cd4ca(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9cd4ca(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm
new file mode 100644
index 0000000..77e0964
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9cd4ca "textureDimensions_9cd4ca"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9cd4ca = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %22 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_9cd4ca
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl
new file mode 100644
index 0000000..9d80b64
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd4ca.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureDimensions_9cd4ca() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd4ca();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd4ca();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd4ca();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl
new file mode 100644
index 0000000..309ffe2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32float, write>) -> vec3<u32>
+fn textureDimensions_9cd8ad() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd8ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd8ad();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..15a1e11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_9cd8ad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd8ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..15a1e11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_9cd8ad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9cd8ad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9cd8ad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl
new file mode 100644
index 0000000..abddd70
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_9cd8ad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image3D arg_0;
+void textureDimensions_9cd8ad() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_9cd8ad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl
new file mode 100644
index 0000000..23fcbf6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9cd8ad(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_9cd8ad(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9cd8ad(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9cd8ad(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm
new file mode 100644
index 0000000..0155eb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9cd8ad "textureDimensions_9cd8ad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9cd8ad = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_9cd8ad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl
new file mode 100644
index 0000000..7ac9caf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9cd8ad.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32float, write>;
+
+fn textureDimensions_9cd8ad() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9cd8ad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9cd8ad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9cd8ad();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl
deleted file mode 100644
index bd2527e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8sint, write>) -> i32
-fn textureDimensions_9da9e2() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9da9e2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9da9e2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9da9e2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f500491b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_9da9e2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9da9e2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9da9e2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f500491b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_9da9e2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9da9e2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9da9e2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.glsl
deleted file mode 100644
index 5773b40..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9da9e2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_9da9e2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'iimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_9da9e2() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_9da9e2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'iimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.msl
deleted file mode 100644
index ea085fa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9da9e2(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_9da9e2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9da9e2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9da9e2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.spvasm
deleted file mode 100644
index edaecfe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9da9e2 "textureDimensions_9da9e2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9da9e2 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_9da9e2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.wgsl
deleted file mode 100644
index 73cfaf1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9da9e2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8sint, write>;
-
-fn textureDimensions_9da9e2() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9da9e2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9da9e2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9da9e2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl
new file mode 100644
index 0000000..5e05bba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureDimensions(texture: texture_2d_array<u32>, level: i32) -> vec2<u32>
+fn textureDimensions_9e0794() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9e0794();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9e0794();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9e0794();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c8a7643
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9e0794() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9e0794();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9e0794();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c8a7643
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_9e0794() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9e0794();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9e0794();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl
new file mode 100644
index 0000000..9c1fbf5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_9e0794();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_9e0794();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureDimensions_9e0794() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_9e0794();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl
new file mode 100644
index 0000000..eb3ef43
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9e0794(texture2d_array<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_9e0794(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9e0794(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9e0794(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm
new file mode 100644
index 0000000..2d2189a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9e0794 "textureDimensions_9e0794"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9e0794 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %22 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_9e0794
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl
new file mode 100644
index 0000000..71827db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9e0794.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureDimensions_9e0794() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9e0794();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9e0794();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9e0794();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl
deleted file mode 100644
index c1f41d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<i32>
-fn textureDimensions_9eb8d8() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9eb8d8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9eb8d8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cf18843..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9eb8d8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9eb8d8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9eb8d8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cf18843..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_9eb8d8() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9eb8d8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9eb8d8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.glsl
deleted file mode 100644
index 6185ef1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9eb8d8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_9eb8d8() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_9eb8d8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.msl
deleted file mode 100644
index 140c2af..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9eb8d8(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_9eb8d8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9eb8d8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9eb8d8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.spvasm
deleted file mode 100644
index b450c7b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9eb8d8 "textureDimensions_9eb8d8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9eb8d8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_9eb8d8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.wgsl
deleted file mode 100644
index fc40eab..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9eb8d8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32uint, write>;
-
-fn textureDimensions_9eb8d8() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9eb8d8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9eb8d8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9eb8d8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl
deleted file mode 100644
index 2234617..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureDimensions(texture: texture_2d<f32>) -> vec2<i32>
-fn textureDimensions_9f8e46() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9f8e46();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9f8e46();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9f8e46();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 384fdc3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_9f8e46() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9f8e46();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9f8e46();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 384fdc3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_9f8e46() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_9f8e46();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_9f8e46();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.glsl
deleted file mode 100644
index a292ec4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_9f8e46();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_9f8e46();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_9f8e46() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_9f8e46();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.msl
deleted file mode 100644
index b7097a2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_9f8e46(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_9f8e46(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_9f8e46(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_9f8e46(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.spvasm
deleted file mode 100644
index 9fabd6e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_9f8e46 "textureDimensions_9f8e46"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_9f8e46 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_9f8e46
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.wgsl
deleted file mode 100644
index 3d3ef83..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/9f8e46.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureDimensions_9f8e46() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_9f8e46();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_9f8e46();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_9f8e46();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl
new file mode 100644
index 0000000..9f69ac6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array) -> vec2<u32>
+fn textureDimensions_9fcc3b() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9fcc3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9fcc3b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5252d8b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_9fcc3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9fcc3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5252d8b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_9fcc3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_9fcc3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_9fcc3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl
new file mode 100644
index 0000000..ff61b88
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_9fcc3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_9fcc3b() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_9fcc3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl
new file mode 100644
index 0000000..ddabf3b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_9fcc3b(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_9fcc3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_9fcc3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_9fcc3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a57305e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_9fcc3b "textureDimensions_9fcc3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_9fcc3b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_9fcc3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..14dbcf2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/9fcc3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_9fcc3b() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_9fcc3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_9fcc3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_9fcc3b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl
deleted file mode 100644
index 4662698..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2<i32>
-fn textureDimensions_a01845() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a01845();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a01845();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a01845();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d443dbe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_a01845() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a01845();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a01845();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d443dbe..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_a01845() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a01845();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a01845();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.glsl
deleted file mode 100644
index 283779e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_a01845();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_a01845();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_a01845() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_a01845();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.msl
deleted file mode 100644
index 3560c47..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a01845(depthcube_array<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_a01845(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a01845(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a01845(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.spvasm
deleted file mode 100644
index 5fbb8a8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 44
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a01845 "textureDimensions_a01845"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %29 = OpConstantNull %v2int
- %30 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a01845 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %29
- OpStore %arg_1 %int_1
- %25 = OpLoad %11 %arg_0
- %26 = OpLoad %int %arg_1
- %23 = OpImageQuerySizeLod %v3int %25 %26
- %21 = OpVectorShuffle %v2int %23 %23 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %30
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_a01845
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %36
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %39 = OpLabel
- %40 = OpFunctionCall %void %textureDimensions_a01845
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_a01845
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.wgsl
deleted file mode 100644
index 951440b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a01845.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_a01845() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a01845();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a01845();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a01845();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl
new file mode 100644
index 0000000..76171f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureDimensions(texture: texture_cube_array<u32>) -> vec2<u32>
+fn textureDimensions_a1598a() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a1598a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a1598a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a1598a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ed94e77
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_a1598a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a1598a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a1598a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ed94e77
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_a1598a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a1598a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a1598a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl
new file mode 100644
index 0000000..010039d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_a1598a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_a1598a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureDimensions_a1598a() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_a1598a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl
new file mode 100644
index 0000000..f8e8256
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a1598a(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureDimensions_a1598a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a1598a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a1598a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm
new file mode 100644
index 0000000..a28204c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a1598a "textureDimensions_a1598a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a1598a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a1598a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl
new file mode 100644
index 0000000..f6f7047
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a1598a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureDimensions_a1598a() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a1598a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a1598a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a1598a();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl
new file mode 100644
index 0000000..a3e7f10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_a2ba5e() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a2ba5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a2ba5e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5597e84
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a2ba5e() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a2ba5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5597e84
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a2ba5e() {
+ int arg_1 = 1;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a2ba5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a2ba5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl
new file mode 100644
index 0000000..728ca98
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_a2ba5e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_a2ba5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_a2ba5e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl
new file mode 100644
index 0000000..8a4ba3c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a2ba5e(texturecube<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_a2ba5e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a2ba5e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a2ba5e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..5d4ec7c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a2ba5e "textureDimensions_a2ba5e"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a2ba5e = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_a2ba5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd6c4ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a2ba5e.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_a2ba5e() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a2ba5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a2ba5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a2ba5e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl
new file mode 100644
index 0000000..0fba30d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_a48049() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a48049();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a48049();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a48049();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5f5cc2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a48049() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a48049();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a48049();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5f5cc2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_a48049() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a48049();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a48049();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl
new file mode 100644
index 0000000..5c885a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_a48049();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_a48049();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_a48049() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_a48049();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl
new file mode 100644
index 0000000..ee430c6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a48049(texture2d<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_a48049(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a48049(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a48049(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm
new file mode 100644
index 0000000..7fc4948
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a48049 "textureDimensions_a48049"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %28 = OpConstantNull %v2uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a48049 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %28
+ OpStore %arg_1 %uint_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %uint %arg_1
+ %22 = OpImageQuerySizeLod %v2uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_a48049
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl
new file mode 100644
index 0000000..2600680
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a48049.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_a48049() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a48049();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a48049();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a48049();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl
new file mode 100644
index 0000000..5628cd5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array) -> vec2<u32>
+fn textureDimensions_a4cd56() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a4cd56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a4cd56();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f8f2b16
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_a4cd56() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a4cd56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a4cd56();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f8f2b16
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_a4cd56() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_a4cd56();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_a4cd56();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl
new file mode 100644
index 0000000..759cda6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_a4cd56();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_a4cd56() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0).xy);
+}
+
+void compute_main() {
+ textureDimensions_a4cd56();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl
new file mode 100644
index 0000000..9022f6d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_a4cd56(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_a4cd56(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_a4cd56(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_a4cd56(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm
new file mode 100644
index 0000000..d7caf97
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 41
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_a4cd56 "textureDimensions_a4cd56"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %26 = OpConstantNull %v2uint
+ %27 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_a4cd56 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %26
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %27
+ %29 = OpLabel
+ %30 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %33
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_a4cd56
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl
new file mode 100644
index 0000000..50f2c77
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/a4cd56.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_a4cd56() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_a4cd56();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_a4cd56();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_a4cd56();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl
deleted file mode 100644
index c2d1409..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureDimensions(texture: texture_1d<u32>) -> i32
-fn textureDimensions_a7d565() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a7d565();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a7d565();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a7d565();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 949e8b1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_a7d565() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a7d565();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a7d565();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 949e8b1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_a7d565() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a7d565();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a7d565();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.glsl
deleted file mode 100644
index 24152c7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_a7d565();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_a7d565();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureDimensions_a7d565() {
- int res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_a7d565();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.msl
deleted file mode 100644
index aef8670..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a7d565(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureDimensions_a7d565(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a7d565(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a7d565(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.spvasm
deleted file mode 100644
index 1694f88..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a7d565 "textureDimensions_a7d565"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a7d565 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_a7d565
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.wgsl
deleted file mode 100644
index 76183ec..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a7d565.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureDimensions_a7d565() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a7d565();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a7d565();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a7d565();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl
deleted file mode 100644
index 4dbf2ed..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> i32
-fn textureDimensions_a863f2() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a863f2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a863f2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a863f2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 212bbca..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_a863f2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a863f2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a863f2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 212bbca..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_a863f2() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a863f2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a863f2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.glsl
deleted file mode 100644
index b157dd9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_a863f2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_a863f2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(r32f) uniform highp writeonly image1D arg_0;
-void textureDimensions_a863f2() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_a863f2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.msl
deleted file mode 100644
index 583342b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a863f2(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_a863f2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a863f2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a863f2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.spvasm
deleted file mode 100644
index 9e5a66a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a863f2 "textureDimensions_a863f2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a863f2 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_a863f2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.wgsl
deleted file mode 100644
index d3e7e38..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a863f2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<r32float, write>;
-
-fn textureDimensions_a863f2() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a863f2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a863f2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a863f2();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl
deleted file mode 100644
index 46d1cf7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>, level: i32) -> vec2<i32>
-fn textureDimensions_a9c9c1() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a9c9c1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a9c9c1();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a5b99e0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_a9c9c1() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a9c9c1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a9c9c1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a5b99e0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_a9c9c1() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_a9c9c1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_a9c9c1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.glsl
deleted file mode 100644
index 41a56e3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_a9c9c1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_a9c9c1() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_a9c9c1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.msl
deleted file mode 100644
index f6dc5fd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_a9c9c1(texturecube<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_a9c9c1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_a9c9c1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_a9c9c1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.spvasm
deleted file mode 100644
index 9f867d9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_a9c9c1 "textureDimensions_a9c9c1"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_a9c9c1 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_a9c9c1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.wgsl
deleted file mode 100644
index f458435..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/a9c9c1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_a9c9c1() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_a9c9c1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_a9c9c1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_a9c9c1();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl
new file mode 100644
index 0000000..8b47484
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32sint, write>) -> vec2<u32>
+fn textureDimensions_aa4353() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aa4353();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aa4353();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aa4353();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3d24ddb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_aa4353() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aa4353();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aa4353();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3d24ddb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_aa4353() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aa4353();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aa4353();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl
new file mode 100644
index 0000000..4a25902
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_aa4353();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_aa4353();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_aa4353() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_aa4353();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl
new file mode 100644
index 0000000..7845df7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_aa4353(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_aa4353(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_aa4353(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_aa4353(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm
new file mode 100644
index 0000000..3a9900d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_aa4353 "textureDimensions_aa4353"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_aa4353 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_aa4353
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl
new file mode 100644
index 0000000..7aa80e1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aa4353.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32sint, write>;
+
+fn textureDimensions_aa4353() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aa4353();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aa4353();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aa4353();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl
new file mode 100644
index 0000000..e17af18
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>, level: u32) -> u32
+fn textureDimensions_aac604() {
+ var arg_1 = 1u;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aac604();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aac604();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aac604();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..16df6f4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_aac604() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aac604();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aac604();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..16df6f4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_aac604() {
+ uint arg_1 = 1u;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_aac604();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_aac604();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl
new file mode 100644
index 0000000..e83045c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_aac604();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_aac604();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_aac604() {
+ uint arg_1 = 1u;
+ uint res = uint(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_aac604();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl
new file mode 100644
index 0000000..4eed4a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_aac604(texture1d<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_aac604(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_aac604(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_aac604(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm
new file mode 100644
index 0000000..a609c78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_aac604 "textureDimensions_aac604"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_aac604 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_uint Function %20
+ OpStore %arg_1 %uint_1
+ %22 = OpLoad %11 %arg_0
+ %23 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %uint %22 %23
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_aac604
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl
new file mode 100644
index 0000000..528fe11
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/aac604.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_aac604() {
+ var arg_1 = 1u;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_aac604();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_aac604();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_aac604();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl
new file mode 100644
index 0000000..39b6f4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> u32
+fn textureDimensions_ad7d3b() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ad7d3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ad7d3b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c052ebe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ad7d3b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ad7d3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c052ebe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ad7d3b() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ad7d3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ad7d3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl
new file mode 100644
index 0000000..37dc452
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ad7d3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'uimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ad7d3b() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ad7d3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'uimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl
new file mode 100644
index 0000000..5ebfda2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ad7d3b(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_ad7d3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ad7d3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ad7d3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..f349ad4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ad7d3b "textureDimensions_ad7d3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ad7d3b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ad7d3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..f3d84ab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ad7d3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8uint, write>;
+
+fn textureDimensions_ad7d3b() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ad7d3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ad7d3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ad7d3b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl
new file mode 100644
index 0000000..ab3e076
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rg32sint, write>) -> vec2<u32>
+fn textureDimensions_af46ab() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_af46ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_af46ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_af46ab();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7b91231
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_af46ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_af46ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_af46ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7b91231
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_af46ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_af46ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_af46ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl
new file mode 100644
index 0000000..858e3b6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_af46ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_af46ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_af46ab() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_af46ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl
new file mode 100644
index 0000000..bea9ef2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_af46ab(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_af46ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_af46ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_af46ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..fa916ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.spvasm
@@ -0,0 +1,80 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_af46ab "textureDimensions_af46ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_af46ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_af46ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..33b86af
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/af46ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureDimensions_af46ab() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_af46ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_af46ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_af46ab();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl
deleted file mode 100644
index 7e57b46..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>, level: i32) -> vec2<i32>
-fn textureDimensions_b0e16d() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b0e16d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b0e16d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b0e16d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ed93856..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_b0e16d() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b0e16d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b0e16d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ed93856..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_b0e16d() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b0e16d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b0e16d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.glsl
deleted file mode 100644
index 69ff6fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_b0e16d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_b0e16d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_b0e16d() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_b0e16d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.msl
deleted file mode 100644
index 2f37e8d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b0e16d(texture2d<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_b0e16d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b0e16d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b0e16d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.spvasm
deleted file mode 100644
index 05bc7bf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b0e16d "textureDimensions_b0e16d"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %27 = OpConstantNull %v2int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b0e16d = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v2int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v2int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_b0e16d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.wgsl
deleted file mode 100644
index 8497bdb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b0e16d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_b0e16d() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b0e16d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b0e16d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b0e16d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl
new file mode 100644
index 0000000..11a6ddb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>, level: i32) -> vec2<u32>
+fn textureDimensions_b3ab5e() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b3ab5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b3ab5e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..7038fc7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_b3ab5e() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b3ab5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..7038fc7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_b3ab5e() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b3ab5e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b3ab5e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl
new file mode 100644
index 0000000..5b81b60
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_b3ab5e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_b3ab5e() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_b3ab5e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl
new file mode 100644
index 0000000..7409bb7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b3ab5e(texturecube_array<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_b3ab5e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b3ab5e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b3ab5e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm
new file mode 100644
index 0000000..f3b642e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.spvasm
@@ -0,0 +1,86 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b3ab5e "textureDimensions_b3ab5e"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b3ab5e = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_b3ab5e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl
new file mode 100644
index 0000000..d5dd059
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b3ab5e.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_b3ab5e() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b3ab5e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b3ab5e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b3ab5e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl
deleted file mode 100644
index 36a593a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureDimensions(texture: texture_cube<u32>) -> vec2<i32>
-fn textureDimensions_b3c954() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3c954();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3c954();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3c954();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f0d031d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3c954() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3c954();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3c954();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f0d031d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3c954() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3c954();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3c954();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.glsl
deleted file mode 100644
index 855349f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_b3c954();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_b3c954();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureDimensions_b3c954() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_b3c954();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.msl
deleted file mode 100644
index 33fc09a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b3c954(texturecube<uint, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureDimensions_b3c954(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b3c954(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b3c954(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.spvasm
deleted file mode 100644
index f8a392c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b3c954 "textureDimensions_b3c954"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b3c954 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %20 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_b3c954
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.wgsl
deleted file mode 100644
index 8c36407..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3c954.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureDimensions_b3c954() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3c954();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3c954();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3c954();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl
deleted file mode 100644
index f65e507..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureDimensions(texture: texture_1d<f32>, level: i32) -> i32
-fn textureDimensions_b3e407() {
- var arg_1 = 1i;
- var res: i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3e407();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3e407();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3e407();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c37a40c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3e407() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3e407();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3e407();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c37a40c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_b3e407() {
- int arg_1 = 1;
- int2 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.x;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b3e407();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b3e407();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.glsl
deleted file mode 100644
index 0191881..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_b3e407();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_b3e407();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureDimensions_b3e407() {
- int arg_1 = 0;
- int res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_b3e407();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.msl
deleted file mode 100644
index 816e795..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b3e407(texture1d<float, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureDimensions_b3e407(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b3e407(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b3e407(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.spvasm
deleted file mode 100644
index ae214b8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.spvasm
+++ /dev/null
@@ -1,80 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b3e407 "textureDimensions_b3e407"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b3e407 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_int Function %20
- OpStore %arg_1 %int_1
- %22 = OpLoad %11 %arg_0
- %23 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %int %22 %23
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_b3e407
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.wgsl
deleted file mode 100644
index 3d740f9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b3e407.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureDimensions_b3e407() {
- var arg_1 = 1i;
- var res : i32 = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b3e407();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b3e407();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b3e407();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl
new file mode 100644
index 0000000..7554aab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureDimensions(texture: texture_1d<i32>, level: i32) -> u32
+fn textureDimensions_b46d97() {
+ var arg_1 = 1i;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b46d97();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b46d97();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b46d97();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d2120ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_b46d97() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b46d97();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b46d97();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d2120ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_b46d97() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b46d97();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b46d97();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl
new file mode 100644
index 0000000..6a0314a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_b46d97();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_b46d97();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureDimensions_b46d97() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_b46d97();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl
new file mode 100644
index 0000000..a93ae28
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b46d97(texture1d<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureDimensions_b46d97(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b46d97(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b46d97(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm
new file mode 100644
index 0000000..0fd4314
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b46d97 "textureDimensions_b46d97"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %27 = OpConstantNull %uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b46d97 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_uint Function %27
+ OpStore %arg_1 %int_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_b46d97
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl
new file mode 100644
index 0000000..8fa44e6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b46d97.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureDimensions_b46d97() {
+ var arg_1 = 1i;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b46d97();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b46d97();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b46d97();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl
new file mode 100644
index 0000000..705df0b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32float, write>) -> u32
+fn textureDimensions_b51345() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b51345();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b51345();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b51345();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..83abb62
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_b51345() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b51345();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b51345();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..83abb62
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_b51345() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_b51345();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_b51345();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl
new file mode 100644
index 0000000..058e7ca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_b51345();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_b51345();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_b51345() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_b51345();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl
new file mode 100644
index 0000000..d1ee550
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_b51345(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_b51345(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_b51345(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_b51345(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm
new file mode 100644
index 0000000..ba366c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_b51345 "textureDimensions_b51345"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_b51345 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_b51345
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl
new file mode 100644
index 0000000..4da1873
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/b51345.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32float, write>;
+
+fn textureDimensions_b51345() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_b51345();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_b51345();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_b51345();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl
deleted file mode 100644
index 65a63e4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<i32>
-fn textureDimensions_b91240() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b91240();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b91240();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b91240();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7f3c930..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_b91240() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b91240();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b91240();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b91240();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7f3c930..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_b91240() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_b91240();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_b91240();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_b91240();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.glsl
deleted file mode 100644
index 3976de3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_b91240();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_b91240();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
-void textureDimensions_b91240() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_b91240();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.msl
deleted file mode 100644
index ee84ff1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_b91240(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_b91240(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_b91240(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_b91240(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.spvasm
deleted file mode 100644
index a0757e4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_b91240 "textureDimensions_b91240"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_b91240 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_b91240
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_b91240
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_b91240
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.wgsl
deleted file mode 100644
index 7c88173..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/b91240.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8snorm, write>;
-
-fn textureDimensions_b91240() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_b91240();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_b91240();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_b91240();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl
deleted file mode 100644
index e48c478..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_external;
-
-// fn textureDimensions(texture: texture_external) -> vec2<i32>
-fn textureDimensions_ba1481() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ba1481();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ba1481();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ba1481();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1761c01..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,38 +0,0 @@
-Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
-cbuffer cbuffer_ext_tex_params : register(b2, space1) {
- uint4 ext_tex_params[11];
-};
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ba1481() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ba1481();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ba1481();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1761c01..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,38 +0,0 @@
-Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
-cbuffer cbuffer_ext_tex_params : register(b2, space1) {
- uint4 ext_tex_params[11];
-};
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ba1481() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ba1481();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ba1481();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.glsl
deleted file mode 100644
index 7bb878e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.glsl
+++ /dev/null
@@ -1,112 +0,0 @@
-#version 310 es
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_ba1481();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_ba1481();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- mat3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- mat3 gamutConversionMatrix;
-} ext_tex_params;
-
-uniform highp sampler2D arg_0_1;
-void textureDimensions_ba1481() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_ba1481();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.msl
deleted file mode 100644
index f659868..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.msl
+++ /dev/null
@@ -1,53 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-struct GammaTransferParams {
- float G;
- float A;
- float B;
- float C;
- float D;
- float E;
- float F;
- uint padding;
-};
-
-struct ExternalTextureParams {
- uint numPlanes;
- uint doYuvToRgbConversionOnly;
- float3x4 yuvToRgbConversionMatrix;
- GammaTransferParams gammaDecodeParams;
- GammaTransferParams gammaEncodeParams;
- float3x3 gamutConversionMatrix;
-};
-
-void textureDimensions_ba1481(texture2d<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureDimensions_ba1481(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_ba1481(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_ba1481(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.spvasm
deleted file mode 100644
index a7eb76b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.spvasm
+++ /dev/null
@@ -1,127 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 47
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %ext_tex_plane_1 "ext_tex_plane_1"
- OpName %ExternalTextureParams "ExternalTextureParams"
- OpMemberName %ExternalTextureParams 0 "numPlanes"
- OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
- OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
- OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
- OpName %GammaTransferParams "GammaTransferParams"
- OpMemberName %GammaTransferParams 0 "G"
- OpMemberName %GammaTransferParams 1 "A"
- OpMemberName %GammaTransferParams 2 "B"
- OpMemberName %GammaTransferParams 3 "C"
- OpMemberName %GammaTransferParams 4 "D"
- OpMemberName %GammaTransferParams 5 "E"
- OpMemberName %GammaTransferParams 6 "F"
- OpMemberName %GammaTransferParams 7 "padding"
- OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
- OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
- OpName %ext_tex_params "ext_tex_params"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_ba1481 "textureDimensions_ba1481"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %ext_tex_plane_1 DescriptorSet 1
- OpDecorate %ext_tex_plane_1 Binding 1
- OpDecorate %ExternalTextureParams Block
- OpMemberDecorate %ExternalTextureParams 0 Offset 0
- OpMemberDecorate %ExternalTextureParams 1 Offset 4
- OpMemberDecorate %ExternalTextureParams 2 Offset 16
- OpMemberDecorate %ExternalTextureParams 2 ColMajor
- OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
- OpMemberDecorate %ExternalTextureParams 3 Offset 64
- OpMemberDecorate %GammaTransferParams 0 Offset 0
- OpMemberDecorate %GammaTransferParams 1 Offset 4
- OpMemberDecorate %GammaTransferParams 2 Offset 8
- OpMemberDecorate %GammaTransferParams 3 Offset 12
- OpMemberDecorate %GammaTransferParams 4 Offset 16
- OpMemberDecorate %GammaTransferParams 5 Offset 20
- OpMemberDecorate %GammaTransferParams 6 Offset 24
- OpMemberDecorate %GammaTransferParams 7 Offset 28
- OpMemberDecorate %ExternalTextureParams 4 Offset 96
- OpMemberDecorate %ExternalTextureParams 5 Offset 128
- OpMemberDecorate %ExternalTextureParams 5 ColMajor
- OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
- OpDecorate %ext_tex_params NonWritable
- OpDecorate %ext_tex_params DescriptorSet 1
- OpDecorate %ext_tex_params Binding 2
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
-%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %uint = OpTypeInt 32 0
-%mat3v4float = OpTypeMatrix %v4float 3
-%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
- %v3float = OpTypeVector %float 3
-%mat3v3float = OpTypeMatrix %v3float 3
-%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float
-%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams
-%ext_tex_params = OpVariable %_ptr_Uniform_ExternalTextureParams Uniform
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %21 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %32 = OpConstantNull %v2int
- %33 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_ba1481 = OpFunction %void None %21
- %24 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %32
- %28 = OpLoad %11 %arg_0
- %25 = OpImageQuerySizeLod %v2int %28 %int_0
- OpStore %res %25
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %33
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %21
- %38 = OpLabel
- %39 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %39
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %21
- %42 = OpLabel
- %43 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %21
- %45 = OpLabel
- %46 = OpFunctionCall %void %textureDimensions_ba1481
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.wgsl
deleted file mode 100644
index cbc8837..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ba1481.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_external;
-
-fn textureDimensions_ba1481() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ba1481();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ba1481();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ba1481();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl
deleted file mode 100644
index c251ab6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba32sint, write>) -> vec3<i32>
-fn textureDimensions_bb3dde() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_bb3dde();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_bb3dde();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_bb3dde();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 48b980a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_bb3dde() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_bb3dde();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_bb3dde();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 48b980a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_bb3dde() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_bb3dde();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_bb3dde();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.glsl
deleted file mode 100644
index 8c5f740..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_bb3dde();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_bb3dde();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage3D arg_0;
-void textureDimensions_bb3dde() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_bb3dde();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.msl
deleted file mode 100644
index 0f83742..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_bb3dde(texture3d<int, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
- textureDimensions_bb3dde(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_bb3dde(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_bb3dde(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.spvasm
deleted file mode 100644
index 7d30072..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_bb3dde "textureDimensions_bb3dde"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_bb3dde = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_bb3dde
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.wgsl
deleted file mode 100644
index bd224fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/bb3dde.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba32sint, write>;
-
-fn textureDimensions_bb3dde() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_bb3dde();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_bb3dde();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_bb3dde();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl
new file mode 100644
index 0000000..c30f0fa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureDimensions(texture: texture_3d<f32>) -> vec3<u32>
+fn textureDimensions_bb95d9() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bb95d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bb95d9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..abb88d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_bb95d9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bb95d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bb95d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..abb88d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_bb95d9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bb95d9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bb95d9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl
new file mode 100644
index 0000000..2222166
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_bb95d9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureDimensions_bb95d9() {
+ uvec3 res = uvec3(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_bb95d9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl
new file mode 100644
index 0000000..7319205
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bb95d9(texture3d<float, access::sample> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureDimensions_bb95d9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bb95d9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bb95d9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm
new file mode 100644
index 0000000..4529549
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bb95d9 "textureDimensions_bb95d9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %24 = OpConstantNull %v3uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bb95d9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v3uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_bb95d9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl
new file mode 100644
index 0000000..24fab7a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bb95d9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureDimensions_bb95d9() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bb95d9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bb95d9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bb95d9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl
new file mode 100644
index 0000000..14e3679
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba8sint, write>) -> vec2<u32>
+fn textureDimensions_bbe285() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bbe285();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bbe285();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bbe285();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bc18dde
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_bbe285() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bbe285();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bbe285();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bc18dde
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_bbe285() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bbe285();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bbe285();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl
new file mode 100644
index 0000000..2464082
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_bbe285();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_bbe285();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_bbe285() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_bbe285();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl
new file mode 100644
index 0000000..35cf418
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bbe285(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_bbe285(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bbe285(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bbe285(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm
new file mode 100644
index 0000000..5613469
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bbe285 "textureDimensions_bbe285"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bbe285 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_bbe285
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl
new file mode 100644
index 0000000..b74acdf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bbe285.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureDimensions_bbe285() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bbe285();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bbe285();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bbe285();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl
new file mode 100644
index 0000000..5ae0349
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureDimensions(texture: texture_depth_cube_array, level: u32) -> vec2<u32>
+fn textureDimensions_bd94c8() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bd94c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bd94c8();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e47cbf9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_bd94c8() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bd94c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bd94c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e47cbf9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureDimensions_bd94c8() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_bd94c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_bd94c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl
new file mode 100644
index 0000000..307d2cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_bd94c8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_bd94c8() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_bd94c8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl
new file mode 100644
index 0000000..786ddf8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_bd94c8(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_bd94c8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_bd94c8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_bd94c8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm
new file mode 100644
index 0000000..eb9b16d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_bd94c8 "textureDimensions_bd94c8"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_bd94c8 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_bd94c8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5479d5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/bd94c8.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureDimensions_bd94c8() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_bd94c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_bd94c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_bd94c8();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl
new file mode 100644
index 0000000..3c783c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<u32>
+fn textureDimensions_c1dbf6() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c1dbf6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c1dbf6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ec06df9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_c1dbf6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c1dbf6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ec06df9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_c1dbf6() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c1dbf6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c1dbf6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl
new file mode 100644
index 0000000..4c2ee10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c1dbf6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_c1dbf6() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_c1dbf6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl
new file mode 100644
index 0000000..04722f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c1dbf6(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_c1dbf6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c1dbf6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c1dbf6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm
new file mode 100644
index 0000000..ae9f484
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c1dbf6 "textureDimensions_c1dbf6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c1dbf6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c1dbf6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl
new file mode 100644
index 0000000..590817f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c1dbf6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8uint, write>;
+
+fn textureDimensions_c1dbf6() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c1dbf6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c1dbf6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c1dbf6();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl
new file mode 100644
index 0000000..6feb2e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<u32>
+fn textureDimensions_c2cdd3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c2cdd3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c2cdd3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..45db8ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_c2cdd3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c2cdd3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..45db8ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_c2cdd3() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c2cdd3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c2cdd3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl
new file mode 100644
index 0000000..ef3ef24
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c2cdd3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureDimensions_c2cdd3() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_c2cdd3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl
new file mode 100644
index 0000000..53a8299
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c2cdd3(depth2d_ms<float, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureDimensions_c2cdd3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c2cdd3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c2cdd3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm
new file mode 100644
index 0000000..c107a82
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c2cdd3 "textureDimensions_c2cdd3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c2cdd3 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c2cdd3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl
new file mode 100644
index 0000000..503bc4d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c2cdd3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureDimensions_c2cdd3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c2cdd3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c2cdd3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c2cdd3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl
deleted file mode 100644
index 6465afc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<i32>
-fn textureDimensions_c30e75() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c30e75();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c30e75();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c30e75();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e4ae382..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_c30e75() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c30e75();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c30e75();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e4ae382..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_c30e75() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c30e75();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c30e75();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.glsl
deleted file mode 100644
index 06b6108..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_c30e75();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_c30e75();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2D arg_0;
-void textureDimensions_c30e75() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_c30e75();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.msl
deleted file mode 100644
index 711f4aa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_c30e75(texture2d<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
- textureDimensions_c30e75(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_c30e75(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_c30e75(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.spvasm
deleted file mode 100644
index 05cad7c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_c30e75 "textureDimensions_c30e75"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_c30e75 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_c30e75
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.wgsl
deleted file mode 100644
index 121b2c3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c30e75.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32sint, write>;
-
-fn textureDimensions_c30e75() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c30e75();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c30e75();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c30e75();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl
new file mode 100644
index 0000000..51445e0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32sint, write>) -> vec2<u32>
+fn textureDimensions_c44fc1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c44fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c44fc1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..26b09c0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_c44fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c44fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c44fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..26b09c0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_c44fc1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c44fc1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c44fc1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl
new file mode 100644
index 0000000..65da687
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_c44fc1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureDimensions_c44fc1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_c44fc1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl
new file mode 100644
index 0000000..bf13ca8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c44fc1(texture2d_array<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureDimensions_c44fc1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c44fc1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c44fc1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm
new file mode 100644
index 0000000..de28a79
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c44fc1 "textureDimensions_c44fc1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %25 = OpConstantNull %v2uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c44fc1 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %25
+ %22 = OpLoad %11 %arg_0
+ %20 = OpImageQuerySize %v3uint %22
+ %17 = OpVectorShuffle %v2uint %20 %20 0 1
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c44fc1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl
new file mode 100644
index 0000000..3e9f662
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c44fc1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureDimensions_c44fc1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c44fc1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c44fc1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c44fc1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl
new file mode 100644
index 0000000..61e4f3b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube) -> vec2<u32>
+fn textureDimensions_c5a36e() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c5a36e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c5a36e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2bfa274
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_c5a36e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c5a36e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c5a36e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2bfa274
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_c5a36e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c5a36e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c5a36e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl
new file mode 100644
index 0000000..8927ad3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c5a36e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_c5a36e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_c5a36e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl
new file mode 100644
index 0000000..9d92d1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c5a36e(depthcube<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_c5a36e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c5a36e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c5a36e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm
new file mode 100644
index 0000000..0992548
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c5a36e "textureDimensions_c5a36e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c5a36e = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySizeLod %v2uint %19 %int_0
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_c5a36e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl
new file mode 100644
index 0000000..1f9256a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c5a36e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_c5a36e() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c5a36e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c5a36e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c5a36e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl
deleted file mode 100644
index 53293aa..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<rgba8uint, write>) -> vec2<i32>
-fn textureDimensions_c7943d() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c7943d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c7943d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c7943d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4b69252..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_c7943d() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c7943d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c7943d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4b69252..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_c7943d() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_c7943d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_c7943d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.glsl
deleted file mode 100644
index ec88d6e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_c7943d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_c7943d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2D arg_0;
-void textureDimensions_c7943d() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_c7943d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.msl
deleted file mode 100644
index 39c32d1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_c7943d(texture2d<uint, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
- textureDimensions_c7943d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_c7943d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_c7943d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.spvasm
deleted file mode 100644
index 0f1070d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_c7943d "textureDimensions_c7943d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_c7943d = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_c7943d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.wgsl
deleted file mode 100644
index 0d589b5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/c7943d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8uint, write>;
-
-fn textureDimensions_c7943d() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_c7943d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_c7943d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_c7943d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl
new file mode 100644
index 0000000..21836c0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureDimensions(texture: texture_3d<i32>, level: u32) -> vec3<u32>
+fn textureDimensions_c871f3() {
+ var arg_1 = 1u;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c871f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c871f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c871f3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60276c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_c871f3() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c871f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c871f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60276c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_c871f3() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_c871f3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_c871f3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl
new file mode 100644
index 0000000..a3534d6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_c871f3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_c871f3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureDimensions_c871f3() {
+ uint arg_1 = 1u;
+ uvec3 res = uvec3(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_c871f3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl
new file mode 100644
index 0000000..e9dd808
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_c871f3(texture3d<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureDimensions_c871f3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_c871f3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_c871f3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm
new file mode 100644
index 0000000..94bb170
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_c871f3 "textureDimensions_c871f3"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %28 = OpConstantNull %v3uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_c871f3 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_v3uint Function %28
+ OpStore %arg_1 %uint_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %uint %arg_1
+ %22 = OpImageQuerySizeLod %v3uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_c871f3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl
new file mode 100644
index 0000000..80c862c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/c871f3.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureDimensions_c871f3() {
+ var arg_1 = 1u;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_c871f3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_c871f3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_c871f3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl
new file mode 100644
index 0000000..0f4624c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32sint, write>) -> vec2<u32>
+fn textureDimensions_cad3b7() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cad3b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cad3b7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b26a056
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cad3b7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cad3b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cad3b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b26a056
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_cad3b7() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cad3b7();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cad3b7();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl
new file mode 100644
index 0000000..f133039
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cad3b7();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2D arg_0;
+void textureDimensions_cad3b7() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_cad3b7();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl
new file mode 100644
index 0000000..1fcfb3f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cad3b7(texture2d<int, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::write> tint_symbol_2) {
+ textureDimensions_cad3b7(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cad3b7(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cad3b7(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm
new file mode 100644
index 0000000..0f7dfc3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cad3b7 "textureDimensions_cad3b7"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %23 = OpConstantNull %v2uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cad3b7 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_cad3b7
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl
new file mode 100644
index 0000000..24b1443
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cad3b7.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32sint, write>;
+
+fn textureDimensions_cad3b7() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cad3b7();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cad3b7();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cad3b7();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl
new file mode 100644
index 0000000..391a94c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<u32>
+fn textureDimensions_cc947b() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cc947b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cc947b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cc947b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a29d944
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cc947b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cc947b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc947b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a29d944
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_cc947b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cc947b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cc947b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl
new file mode 100644
index 0000000..3340606
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cc947b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_cc947b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
+void textureDimensions_cc947b() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_cc947b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl
new file mode 100644
index 0000000..4d1cb5d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cc947b(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_cc947b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cc947b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cc947b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm
new file mode 100644
index 0000000..a51f315
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cc947b "textureDimensions_cc947b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cc947b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cc947b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5ca2ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cc947b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8snorm, write>;
+
+fn textureDimensions_cc947b() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cc947b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cc947b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cc947b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl
deleted file mode 100644
index db888ed..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rg32sint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> i32
-fn textureDimensions_cc968c() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cc968c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cc968c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cc968c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e20e81b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cc968c() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cc968c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cc968c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e20e81b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cc968c() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cc968c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cc968c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.glsl
deleted file mode 100644
index d7f3bec..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cc968c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cc968c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage1D arg_0;
-void textureDimensions_cc968c() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cc968c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.msl
deleted file mode 100644
index 2a4db09..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cc968c(texture1d<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
- textureDimensions_cc968c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cc968c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cc968c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.spvasm
deleted file mode 100644
index 21f2dd1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cc968c "textureDimensions_cc968c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cc968c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cc968c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.wgsl
deleted file mode 100644
index 8caceed..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cc968c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32sint, write>;
-
-fn textureDimensions_cc968c() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cc968c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cc968c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cc968c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl
deleted file mode 100644
index ac04914..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> i32
-fn textureDimensions_cccc8f() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cccc8f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cccc8f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cccc8f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8030a26..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cccc8f() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cccc8f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cccc8f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8030a26..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cccc8f() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cccc8f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cccc8f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.glsl
deleted file mode 100644
index 8ea9b9e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cccc8f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cccc8f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
-void textureDimensions_cccc8f() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cccc8f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.msl
deleted file mode 100644
index f03ce0c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cccc8f(texture1d<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
- textureDimensions_cccc8f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cccc8f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cccc8f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.spvasm
deleted file mode 100644
index ae7cb8d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cccc8f "textureDimensions_cccc8f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cccc8f = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cccc8f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.wgsl
deleted file mode 100644
index 19570ad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cccc8f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8snorm, write>;
-
-fn textureDimensions_cccc8f() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cccc8f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cccc8f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cccc8f();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl
deleted file mode 100644
index 1bca07e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8unorm, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8unorm, write>) -> vec3<i32>
-fn textureDimensions_cd76a7() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cd76a7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cd76a7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cd76a7();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 107e7e6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cd76a7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cd76a7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cd76a7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 107e7e6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cd76a7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cd76a7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cd76a7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.glsl
deleted file mode 100644
index 92b0dae..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cd76a7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cd76a7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image3D arg_0;
-void textureDimensions_cd76a7() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cd76a7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.msl
deleted file mode 100644
index 14b141a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cd76a7(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_cd76a7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cd76a7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cd76a7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.spvasm
deleted file mode 100644
index 6d33337..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cd76a7 "textureDimensions_cd76a7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cd76a7 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cd76a7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.wgsl
deleted file mode 100644
index fa3b1a9..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cd76a7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8unorm, write>;
-
-fn textureDimensions_cd76a7() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cd76a7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cd76a7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cd76a7();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl
new file mode 100644
index 0000000..3fc78f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_external;
+
+// fn textureDimensions(texture: texture_external) -> vec2<u32>
+fn textureDimensions_cdc6c9() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cdc6c9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cdc6c9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..092b79e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,38 @@
+Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
+cbuffer cbuffer_ext_tex_params : register(b2, space1) {
+ uint4 ext_tex_params[11];
+};
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cdc6c9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cdc6c9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..092b79e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,38 @@
+Texture2D<float4> ext_tex_plane_1 : register(t1, space1);
+cbuffer cbuffer_ext_tex_params : register(b2, space1) {
+ uint4 ext_tex_params[11];
+};
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cdc6c9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cdc6c9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cdc6c9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
new file mode 100644
index 0000000..61f4523
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.glsl
@@ -0,0 +1,112 @@
+#version 310 es
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_cdc6c9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+layout(binding = 2, std140) uniform ExternalTextureParams_ubo {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ mat3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ mat3 gamutConversionMatrix;
+} ext_tex_params;
+
+uniform highp sampler2D arg_0_1;
+void textureDimensions_cdc6c9() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_cdc6c9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
new file mode 100644
index 0000000..3808793
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.msl
@@ -0,0 +1,53 @@
+#include <metal_stdlib>
+
+using namespace metal;
+struct GammaTransferParams {
+ float G;
+ float A;
+ float B;
+ float C;
+ float D;
+ float E;
+ float F;
+ uint padding;
+};
+
+struct ExternalTextureParams {
+ uint numPlanes;
+ uint doYuvToRgbConversionOnly;
+ float3x4 yuvToRgbConversionMatrix;
+ GammaTransferParams gammaDecodeParams;
+ GammaTransferParams gammaEncodeParams;
+ float3x3 gamutConversionMatrix;
+};
+
+void textureDimensions_cdc6c9(texture2d<float, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureDimensions_cdc6c9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cdc6c9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cdc6c9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2f0f94
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.spvasm
@@ -0,0 +1,127 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 47
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %ext_tex_plane_1 "ext_tex_plane_1"
+ OpName %ExternalTextureParams "ExternalTextureParams"
+ OpMemberName %ExternalTextureParams 0 "numPlanes"
+ OpMemberName %ExternalTextureParams 1 "doYuvToRgbConversionOnly"
+ OpMemberName %ExternalTextureParams 2 "yuvToRgbConversionMatrix"
+ OpMemberName %ExternalTextureParams 3 "gammaDecodeParams"
+ OpName %GammaTransferParams "GammaTransferParams"
+ OpMemberName %GammaTransferParams 0 "G"
+ OpMemberName %GammaTransferParams 1 "A"
+ OpMemberName %GammaTransferParams 2 "B"
+ OpMemberName %GammaTransferParams 3 "C"
+ OpMemberName %GammaTransferParams 4 "D"
+ OpMemberName %GammaTransferParams 5 "E"
+ OpMemberName %GammaTransferParams 6 "F"
+ OpMemberName %GammaTransferParams 7 "padding"
+ OpMemberName %ExternalTextureParams 4 "gammaEncodeParams"
+ OpMemberName %ExternalTextureParams 5 "gamutConversionMatrix"
+ OpName %ext_tex_params "ext_tex_params"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cdc6c9 "textureDimensions_cdc6c9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %ext_tex_plane_1 DescriptorSet 1
+ OpDecorate %ext_tex_plane_1 Binding 1
+ OpDecorate %ExternalTextureParams Block
+ OpMemberDecorate %ExternalTextureParams 0 Offset 0
+ OpMemberDecorate %ExternalTextureParams 1 Offset 4
+ OpMemberDecorate %ExternalTextureParams 2 Offset 16
+ OpMemberDecorate %ExternalTextureParams 2 ColMajor
+ OpMemberDecorate %ExternalTextureParams 2 MatrixStride 16
+ OpMemberDecorate %ExternalTextureParams 3 Offset 64
+ OpMemberDecorate %GammaTransferParams 0 Offset 0
+ OpMemberDecorate %GammaTransferParams 1 Offset 4
+ OpMemberDecorate %GammaTransferParams 2 Offset 8
+ OpMemberDecorate %GammaTransferParams 3 Offset 12
+ OpMemberDecorate %GammaTransferParams 4 Offset 16
+ OpMemberDecorate %GammaTransferParams 5 Offset 20
+ OpMemberDecorate %GammaTransferParams 6 Offset 24
+ OpMemberDecorate %GammaTransferParams 7 Offset 28
+ OpMemberDecorate %ExternalTextureParams 4 Offset 96
+ OpMemberDecorate %ExternalTextureParams 5 Offset 128
+ OpMemberDecorate %ExternalTextureParams 5 ColMajor
+ OpMemberDecorate %ExternalTextureParams 5 MatrixStride 16
+ OpDecorate %ext_tex_params NonWritable
+ OpDecorate %ext_tex_params DescriptorSet 1
+ OpDecorate %ext_tex_params Binding 2
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+%ext_tex_plane_1 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %uint = OpTypeInt 32 0
+%mat3v4float = OpTypeMatrix %v4float 3
+%GammaTransferParams = OpTypeStruct %float %float %float %float %float %float %float %uint
+ %v3float = OpTypeVector %float 3
+%mat3v3float = OpTypeMatrix %v3float 3
+%ExternalTextureParams = OpTypeStruct %uint %uint %mat3v4float %GammaTransferParams %GammaTransferParams %mat3v3float
+%_ptr_Uniform_ExternalTextureParams = OpTypePointer Uniform %ExternalTextureParams
+%ext_tex_params = OpVariable %_ptr_Uniform_ExternalTextureParams Uniform
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %21 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %32 = OpConstantNull %v2uint
+ %33 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cdc6c9 = OpFunction %void None %21
+ %24 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %32
+ %27 = OpLoad %11 %arg_0
+ %25 = OpImageQuerySizeLod %v2uint %27 %int_0
+ OpStore %res %25
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %33
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %21
+ %38 = OpLabel
+ %39 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %39
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %21
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %21
+ %45 = OpLabel
+ %46 = OpFunctionCall %void %textureDimensions_cdc6c9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl
new file mode 100644
index 0000000..f4ef228
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cdc6c9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_external;
+
+fn textureDimensions_cdc6c9() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cdc6c9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cdc6c9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cdc6c9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl
deleted file mode 100644
index f434881..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rgba16sint, write>) -> vec2<i32>
-fn textureDimensions_cdf473() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cdf473();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cdf473();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cdf473();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 895f7d0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cdf473() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cdf473();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cdf473();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 895f7d0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureDimensions_cdf473() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cdf473();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cdf473();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.glsl
deleted file mode 100644
index ea5fe7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_cdf473();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_cdf473();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureDimensions_cdf473() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_cdf473();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.msl
deleted file mode 100644
index fa50285..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cdf473(texture2d_array<int, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureDimensions_cdf473(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cdf473(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cdf473(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.spvasm
deleted file mode 100644
index 30caae8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cdf473 "textureDimensions_cdf473"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cdf473 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_cdf473
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.wgsl
deleted file mode 100644
index a675dad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cdf473.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
-
-fn textureDimensions_cdf473() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cdf473();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cdf473();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cdf473();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl
deleted file mode 100644
index dfdf759..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureDimensions(texture: texture_2d_array<f32>) -> vec2<i32>
-fn textureDimensions_cec841() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cec841();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cec841();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cec841();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8b892fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_cec841() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cec841();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cec841();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8b892fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_cec841() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cec841();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cec841();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.glsl
deleted file mode 100644
index 6c4ff13..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_cec841();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_cec841();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureDimensions_cec841() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_cec841();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.msl
deleted file mode 100644
index 7c0b4ee..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cec841(texture2d_array<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureDimensions_cec841(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cec841(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cec841(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.spvasm
deleted file mode 100644
index 34eb8ec..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cec841 "textureDimensions_cec841"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cec841 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_cec841
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cec841
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_cec841
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.wgsl
deleted file mode 100644
index 7a92b37..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cec841.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureDimensions_cec841() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cec841();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cec841();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cec841();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl
new file mode 100644
index 0000000..38c0324
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureDimensions(texture: texture_cube_array<f32>, level: u32) -> vec2<u32>
+fn textureDimensions_cf2b50() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cf2b50();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cf2b50();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..97a8eaf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cf2b50() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cf2b50();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf2b50();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..97a8eaf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_cf2b50() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_cf2b50();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_cf2b50();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl
new file mode 100644
index 0000000..f22135b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_cf2b50();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureDimensions_cf2b50() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_cf2b50();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl
new file mode 100644
index 0000000..911daf0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_cf2b50(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_cf2b50(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_cf2b50(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_cf2b50(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm
new file mode 100644
index 0000000..db623e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_cf2b50 "textureDimensions_cf2b50"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_cf2b50 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_cf2b50
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl
new file mode 100644
index 0000000..c277772
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/cf2b50.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureDimensions_cf2b50() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_cf2b50();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_cf2b50();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_cf2b50();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl
deleted file mode 100644
index 0d4830e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8snorm, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8snorm, write>) -> vec3<i32>
-fn textureDimensions_cf7e43() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cf7e43();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cf7e43();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cf7e43();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f8b6211..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cf7e43() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cf7e43();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cf7e43();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f8b6211..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_cf7e43() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_cf7e43();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_cf7e43();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.glsl
deleted file mode 100644
index 8b491fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_cf7e43();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_cf7e43();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image3D arg_0;
-void textureDimensions_cf7e43() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_cf7e43();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.msl
deleted file mode 100644
index 2103642..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_cf7e43(texture3d<float, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
- textureDimensions_cf7e43(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_cf7e43(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_cf7e43(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.spvasm
deleted file mode 100644
index 62a64df..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_cf7e43 "textureDimensions_cf7e43"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %22 = OpConstantNull %v3int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_cf7e43 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v3int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_cf7e43
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.wgsl
deleted file mode 100644
index 38c9845..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/cf7e43.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8snorm, write>;
-
-fn textureDimensions_cf7e43() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_cf7e43();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_cf7e43();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_cf7e43();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl
new file mode 100644
index 0000000..70e0536
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba16sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba16sint, write>) -> u32
+fn textureDimensions_d08a94() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d08a94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d08a94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d08a94();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..033da1ff
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_d08a94() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d08a94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d08a94();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..033da1ff
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_d08a94() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d08a94();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d08a94();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl
new file mode 100644
index 0000000..58a0a3b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d08a94();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d08a94();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'iimage1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_d08a94() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d08a94();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'iimage1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl
new file mode 100644
index 0000000..c416401
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d08a94(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_d08a94(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d08a94(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d08a94(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm
new file mode 100644
index 0000000..cffbbe5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d08a94 "textureDimensions_d08a94"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d08a94 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d08a94
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl
new file mode 100644
index 0000000..8a49fb8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d08a94.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba16sint, write>;
+
+fn textureDimensions_d08a94() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d08a94();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d08a94();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d08a94();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl
deleted file mode 100644
index 1dbf074..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureDimensions(texture: texture_cube<f32>) -> vec2<i32>
-fn textureDimensions_d125bc() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d125bc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d125bc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d125bc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bf2c107..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_d125bc() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d125bc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d125bc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bf2c107..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_d125bc() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d125bc();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d125bc();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.glsl
deleted file mode 100644
index 0debada..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_d125bc();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_d125bc();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureDimensions_d125bc() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_d125bc();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.msl
deleted file mode 100644
index 67f0abc..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d125bc(texturecube<float, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureDimensions_d125bc(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d125bc(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d125bc(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.spvasm
deleted file mode 100644
index 3d3b32a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d125bc "textureDimensions_d125bc"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d125bc = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_d125bc
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.wgsl
deleted file mode 100644
index 21f8b05..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d125bc.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureDimensions_d125bc() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d125bc();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d125bc();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d125bc();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl
deleted file mode 100644
index a82b951..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureDimensions(texture: texture_depth_cube_array, level: u32) -> vec2<i32>
-fn textureDimensions_d1a23d() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d1a23d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d1a23d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d1a23d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5d05a16..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_d1a23d() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d1a23d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d1a23d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5d05a16..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureDimensions_d1a23d() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d1a23d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d1a23d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.glsl
deleted file mode 100644
index acd0609..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_d1a23d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_d1a23d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureDimensions_d1a23d() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_d1a23d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.msl
deleted file mode 100644
index d24c988..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d1a23d(depthcube_array<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureDimensions_d1a23d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d1a23d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d1a23d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.spvasm
deleted file mode 100644
index ea98181..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,86 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d1a23d "textureDimensions_d1a23d"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d1a23d = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_d1a23d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.wgsl
deleted file mode 100644
index 291f42f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d1a23d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureDimensions_d1a23d() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d1a23d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d1a23d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d1a23d();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl
new file mode 100644
index 0000000..d13e39d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureDimensions(texture: texture_depth_cube, level: u32) -> vec2<u32>
+fn textureDimensions_d3accd() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d3accd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d3accd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d3accd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6151ec6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_d3accd() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d3accd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d3accd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6151ec6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureDimensions_d3accd() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d3accd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d3accd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl
new file mode 100644
index 0000000..4cff9f3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d3accd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_d3accd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureDimensions_d3accd() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_d3accd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl
new file mode 100644
index 0000000..8b3caa6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d3accd(depthcube<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureDimensions_d3accd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d3accd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d3accd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm
new file mode 100644
index 0000000..b2c86ae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d3accd "textureDimensions_d3accd"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d3accd = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_d3accd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl
new file mode 100644
index 0000000..e52708c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d3accd.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureDimensions_d3accd() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d3accd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d3accd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d3accd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl
new file mode 100644
index 0000000..0188d69
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba32float, write>) -> vec2<u32>
+fn textureDimensions_d63c28() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d63c28();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d63c28();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d63c28();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e004506
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_d63c28() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d63c28();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d63c28();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e004506
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_d63c28() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d63c28();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d63c28();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl
new file mode 100644
index 0000000..e4679a4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_d63c28();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_d63c28();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_d63c28() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_d63c28();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl
new file mode 100644
index 0000000..9afba4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d63c28(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_d63c28(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d63c28(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d63c28(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm
new file mode 100644
index 0000000..72b6139
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d63c28 "textureDimensions_d63c28"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d63c28 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_d63c28
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl
new file mode 100644
index 0000000..5e08214
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d63c28.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureDimensions_d63c28() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d63c28();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d63c28();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d63c28();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl
deleted file mode 100644
index d2b36ad..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_d83c45() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d83c45();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d83c45();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d83c45();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 09ca7a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_d83c45() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d83c45();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d83c45();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 09ca7a3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_d83c45() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_d83c45();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_d83c45();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.glsl
deleted file mode 100644
index 7264f8b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_d83c45();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void fragment_main() {
- textureDimensions_d83c45();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_d83c45() {
- int arg_1 = 0;
- ivec2 res = textureSize(arg_0_1, arg_1).xy;
-}
-
-void compute_main() {
- textureDimensions_d83c45();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.msl
deleted file mode 100644
index 5cdeab6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_d83c45(texturecube_array<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_d83c45(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_d83c45(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_d83c45(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.spvasm
deleted file mode 100644
index a7ca43b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.spvasm
+++ /dev/null
@@ -1,86 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_d83c45 "textureDimensions_d83c45"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_d83c45 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %int_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %int %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %22 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_d83c45
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.wgsl
deleted file mode 100644
index 91ae4ac..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/d83c45.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_d83c45() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_d83c45();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_d83c45();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_d83c45();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl
new file mode 100644
index 0000000..291f651
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32uint, write>) -> vec2<u32>
+fn textureDimensions_d8ba68() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8ba68();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8ba68();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..81ffa6c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8ba68() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8ba68();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8ba68();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..81ffa6c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8ba68() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8ba68();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8ba68();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl
new file mode 100644
index 0000000..fd4d413
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d8ba68();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_d8ba68() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d8ba68();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl
new file mode 100644
index 0000000..933e158
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d8ba68(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_d8ba68(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d8ba68(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d8ba68(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c846eb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d8ba68 "textureDimensions_d8ba68"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d8ba68 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d8ba68
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl
new file mode 100644
index 0000000..c0908ff
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8ba68.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32uint, write>;
+
+fn textureDimensions_d8ba68() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8ba68();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8ba68();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8ba68();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl
new file mode 100644
index 0000000..9c7bc22
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8uint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<u32>
+fn textureDimensions_d8f887() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8f887();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8f887();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8f887();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..917113f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8f887() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8f887();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8f887();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..917113f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_d8f887() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_d8f887();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_d8f887();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl
new file mode 100644
index 0000000..c175bda
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_d8f887();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_d8f887();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
+void textureDimensions_d8f887() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_d8f887();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl
new file mode 100644
index 0000000..8210fd2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_d8f887(texture3d<uint, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
+ textureDimensions_d8f887(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_d8f887(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_d8f887(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm
new file mode 100644
index 0000000..a7f40d6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_d8f887 "textureDimensions_d8f887"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_d8f887 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_d8f887
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl
new file mode 100644
index 0000000..3b0a6fd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/d8f887.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8uint, write>;
+
+fn textureDimensions_d8f887() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_d8f887();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_d8f887();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_d8f887();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl
new file mode 100644
index 0000000..72b05e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba32float, write>) -> u32
+fn textureDimensions_da30d2() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_da30d2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_da30d2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_da30d2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..db53401
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_da30d2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_da30d2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_da30d2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..db53401
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_da30d2() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_da30d2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_da30d2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl
new file mode 100644
index 0000000..15c9df4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_da30d2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_da30d2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_da30d2() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_da30d2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl
new file mode 100644
index 0000000..46c48ac
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_da30d2(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_da30d2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_da30d2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_da30d2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm
new file mode 100644
index 0000000..e7b2b01
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_da30d2 "textureDimensions_da30d2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_da30d2 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_da30d2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl
new file mode 100644
index 0000000..fb066ac
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/da30d2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba32float, write>;
+
+fn textureDimensions_da30d2() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_da30d2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_da30d2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_da30d2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl
deleted file mode 100644
index 5eb5422..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<i32>) -> vec2<i32>
-fn textureDimensions_daf7c0() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_daf7c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_daf7c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_daf7c0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b44a6b8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_daf7c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_daf7c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_daf7c0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b44a6b8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_daf7c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_daf7c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_daf7c0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.glsl
deleted file mode 100644
index 5cfbb47..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_daf7c0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_daf7c0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureDimensions_daf7c0() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_daf7c0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.msl
deleted file mode 100644
index 9f811af..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_daf7c0(texture2d_ms<int, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
- textureDimensions_daf7c0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_daf7c0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_daf7c0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.spvasm
deleted file mode 100644
index 05b6fe7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_daf7c0 "textureDimensions_daf7c0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_daf7c0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v2int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_daf7c0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.wgsl
deleted file mode 100644
index cf81583..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/daf7c0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
-
-fn textureDimensions_daf7c0() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_daf7c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_daf7c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_daf7c0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl
deleted file mode 100644
index ff016eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_1d<rgba8uint, write>) -> i32
-fn textureDimensions_dc2dd0() {
- var res: i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc2dd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc2dd0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 20e9146..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_dc2dd0() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc2dd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc2dd0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 20e9146..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture1D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_dc2dd0() {
- int tint_tmp;
- arg_0.GetDimensions(tint_tmp);
- int res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc2dd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc2dd0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.glsl
deleted file mode 100644
index 3d7ac14..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_dc2dd0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'uimage1D' : Reserved word.
-WARNING: 0:4: 'layout' : useless application of layout qualifier
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage1D arg_0;
-void textureDimensions_dc2dd0() {
- int res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_dc2dd0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'uimage1D' : Reserved word.
-WARNING: 0:3: 'layout' : useless application of layout qualifier
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.msl
deleted file mode 100644
index 9e5082a..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_dc2dd0(texture1d<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_width(0));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
- textureDimensions_dc2dd0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_dc2dd0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_dc2dd0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.spvasm
deleted file mode 100644
index 074de23..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Image1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_dc2dd0 "textureDimensions_dc2dd0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_dc2dd0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_dc2dd0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.wgsl
deleted file mode 100644
index 53eaf8f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc2dd0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8uint, write>;
-
-fn textureDimensions_dc2dd0() {
- var res : i32 = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc2dd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc2dd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc2dd0();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl
deleted file mode 100644
index c027716..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureDimensions(texture: texture_2d_array<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_dc7798() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc7798();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc7798();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc7798();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.dxc.hlsl
deleted file mode 100644
index b1b5d48..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_dc7798() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc7798();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc7798();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.fxc.hlsl
deleted file mode 100644
index b1b5d48..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_dc7798() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_dc7798();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_dc7798();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.glsl
deleted file mode 100644
index 030e852..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_dc7798();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_dc7798();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureDimensions_dc7798() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_dc7798();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.msl
deleted file mode 100644
index 7b30672..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_dc7798(texture2d_array<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_dc7798(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_dc7798(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_dc7798(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.spvasm
deleted file mode 100644
index 433c03e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.spvasm
+++ /dev/null
@@ -1,85 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_dc7798 "textureDimensions_dc7798"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_dc7798 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_dc7798
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.wgsl
deleted file mode 100644
index f584475..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/dc7798.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureDimensions_dc7798() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_dc7798();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_dc7798();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_dc7798();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl
new file mode 100644
index 0000000..9f76364
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<r32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<r32uint, write>) -> vec2<u32>
+fn textureDimensions_dc83ce() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dc83ce();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dc83ce();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8f9d770
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_dc83ce() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dc83ce();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dc83ce();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8f9d770
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_dc83ce() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dc83ce();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dc83ce();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl
new file mode 100644
index 0000000..81558b4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_dc83ce();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_dc83ce() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_dc83ce();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl
new file mode 100644
index 0000000..f65454f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dc83ce(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_dc83ce(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dc83ce(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dc83ce(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm
new file mode 100644
index 0000000..77a8eae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dc83ce "textureDimensions_dc83ce"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dc83ce = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_dc83ce
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl
new file mode 100644
index 0000000..696ed4f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dc83ce.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<r32uint, write>;
+
+fn textureDimensions_dc83ce() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dc83ce();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dc83ce();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dc83ce();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl
new file mode 100644
index 0000000..bdb1c2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba8snorm, write>) -> vec2<u32>
+fn textureDimensions_dee461() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dee461();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dee461();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dee461();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a745fb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_dee461() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dee461();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dee461();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a745fb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_dee461() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dee461();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dee461();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl
new file mode 100644
index 0000000..d608c49
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_dee461();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_dee461();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2D arg_0;
+void textureDimensions_dee461() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_dee461();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl
new file mode 100644
index 0000000..ed5309b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dee461(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_dee461(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dee461(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dee461(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm
new file mode 100644
index 0000000..5a31cb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dee461 "textureDimensions_dee461"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dee461 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_dee461
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl
new file mode 100644
index 0000000..52b68e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dee461.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba8snorm, write>;
+
+fn textureDimensions_dee461() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dee461();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dee461();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dee461();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl
new file mode 100644
index 0000000..af5ce97
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2<u32>
+fn textureDimensions_dfdc32() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dfdc32();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dfdc32();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c46a201
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_dfdc32() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dfdc32();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dfdc32();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c46a201
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_dfdc32() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_dfdc32();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_dfdc32();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl
new file mode 100644
index 0000000..b28c401
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_dfdc32();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_dfdc32() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_dfdc32();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl
new file mode 100644
index 0000000..68f883a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_dfdc32(depth2d_array<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_dfdc32(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_dfdc32(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_dfdc32(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm
new file mode 100644
index 0000000..21e5752
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_dfdc32 "textureDimensions_dfdc32"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_dfdc32 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_dfdc32
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl
new file mode 100644
index 0000000..002671d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/dfdc32.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_dfdc32() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_dfdc32();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_dfdc32();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_dfdc32();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl
new file mode 100644
index 0000000..e09efc0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rgba8snorm, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rgba8snorm, write>) -> u32
+fn textureDimensions_e122fe() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e122fe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e122fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e122fe();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..051139d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_e122fe() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e122fe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e122fe();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..051139d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_e122fe() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e122fe();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e122fe();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl
new file mode 100644
index 0000000..5c766e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e122fe();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e122fe();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image1D arg_0;
+void textureDimensions_e122fe() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e122fe();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl
new file mode 100644
index 0000000..a069344
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e122fe(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_e122fe(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e122fe(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e122fe(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm
new file mode 100644
index 0000000..a2f8217
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e122fe "textureDimensions_e122fe"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e122fe = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_e122fe
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c63426
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e122fe.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rgba8snorm, write>;
+
+fn textureDimensions_e122fe() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e122fe();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e122fe();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e122fe();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl
deleted file mode 100644
index 6f4b6a7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureDimensions(texture: texture_cube_array<u32>, level: u32) -> vec2<i32>
-fn textureDimensions_e17db8() {
- var arg_1 = 1u;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e17db8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e17db8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e17db8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index dbcc16e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_e17db8() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e17db8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e17db8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index dbcc16e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_e17db8() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e17db8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e17db8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.glsl
deleted file mode 100644
index bf89199..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e17db8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void fragment_main() {
- textureDimensions_e17db8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureDimensions_e17db8() {
- uint arg_1 = 1u;
- ivec2 res = textureSize(arg_0_1, int(arg_1)).xy;
-}
-
-void compute_main() {
- textureDimensions_e17db8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.msl
deleted file mode 100644
index e6437ed..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e17db8(texturecube_array<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureDimensions_e17db8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e17db8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e17db8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.spvasm
deleted file mode 100644
index a04c591..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,86 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 45
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e17db8 "textureDimensions_e17db8"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %30 = OpConstantNull %v2int
- %31 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e17db8 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v2int Function %30
- OpStore %arg_1 %uint_1
- %26 = OpLoad %11 %arg_0
- %27 = OpLoad %uint %arg_1
- %24 = OpImageQuerySizeLod %v3int %26 %27
- %21 = OpVectorShuffle %v2int %24 %24 0 1
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %31
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %37
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %43 = OpLabel
- %44 = OpFunctionCall %void %textureDimensions_e17db8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.wgsl
deleted file mode 100644
index b1a7a1b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e17db8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureDimensions_e17db8() {
- var arg_1 = 1u;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e17db8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e17db8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e17db8();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl
new file mode 100644
index 0000000..73de72d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureDimensions(texture: texture_2d<u32>, level: u32) -> vec2<u32>
+fn textureDimensions_e18a8b() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e18a8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e18a8b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1b76416
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e18a8b() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e18a8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e18a8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1b76416
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e18a8b() {
+ uint arg_1 = 1u;
+ int3 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e18a8b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e18a8b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl
new file mode 100644
index 0000000..df802d0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e18a8b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureDimensions_e18a8b() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)));
+}
+
+void compute_main() {
+ textureDimensions_e18a8b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl
new file mode 100644
index 0000000..cdc85a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e18a8b(texture2d<uint, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_e18a8b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e18a8b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e18a8b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm
new file mode 100644
index 0000000..3ec4b43
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.spvasm
@@ -0,0 +1,82 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e18a8b "textureDimensions_e18a8b"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %27 = OpConstantNull %v2uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e18a8b = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %27
+ OpStore %arg_1 %uint_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %uint %arg_1
+ %21 = OpImageQuerySizeLod %v2uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_e18a8b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl
new file mode 100644
index 0000000..8b28152
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e18a8b.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureDimensions_e18a8b() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e18a8b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e18a8b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e18a8b();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl
new file mode 100644
index 0000000..551b92b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureDimensions(texture: texture_multisampled_2d<u32>) -> vec2<u32>
+fn textureDimensions_e4bfd2() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4bfd2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4bfd2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..a3ba5e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4bfd2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4bfd2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..a3ba5e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4bfd2() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4bfd2();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4bfd2();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl
new file mode 100644
index 0000000..7e8bd57
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e4bfd2();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureDimensions_e4bfd2() {
+ uvec2 res = uvec2(textureSize(arg_0_1));
+}
+
+void compute_main() {
+ textureDimensions_e4bfd2();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl
new file mode 100644
index 0000000..a80135e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e4bfd2(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureDimensions_e4bfd2(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e4bfd2(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e4bfd2(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm
new file mode 100644
index 0000000..8f34ad1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e4bfd2 "textureDimensions_e4bfd2"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e4bfd2 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e4bfd2
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl
new file mode 100644
index 0000000..5d5b8bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4bfd2.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureDimensions_e4bfd2() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4bfd2();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4bfd2();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4bfd2();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl
new file mode 100644
index 0000000..03dceb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>, level: u32) -> vec2<u32>
+fn textureDimensions_e4e310() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4e310();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4e310();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4e310();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f694447
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4e310() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4e310();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4e310();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f694447
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_e4e310() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e4e310();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e4e310();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl
new file mode 100644
index 0000000..e2cfab4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_e4e310();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_e4e310();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_e4e310() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_e4e310();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl
new file mode 100644
index 0000000..18ffda4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e4e310(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_e4e310(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e4e310(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e4e310(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm
new file mode 100644
index 0000000..e4aa06a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e4e310 "textureDimensions_e4e310"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e4e310 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %21
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %uint_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %uint %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %22 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_e4e310
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl
new file mode 100644
index 0000000..7c23846
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e4e310.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_e4e310() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e4e310();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e4e310();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e4e310();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl
new file mode 100644
index 0000000..eaae710
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureDimensions(texture: texture_3d<u32>, level: i32) -> vec3<u32>
+fn textureDimensions_e5a203() {
+ var arg_1 = 1i;
+ var res: vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e5a203();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e5a203();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e5a203();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4609b60
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e5a203() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e5a203();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e5a203();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4609b60
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureDimensions_e5a203() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint3 res = tint_tmp.xyz;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e5a203();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e5a203();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl
new file mode 100644
index 0000000..237a6c8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e5a203();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_e5a203();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureDimensions_e5a203() {
+ int arg_1 = 1;
+ uvec3 res = uvec3(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_e5a203();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl
new file mode 100644
index 0000000..22cfb73
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e5a203(texture3d<uint, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint3 res = uint3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureDimensions_e5a203(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e5a203(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e5a203(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm
new file mode 100644
index 0000000..382c8e0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 43
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e5a203 "textureDimensions_e5a203"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %21 = OpConstantNull %int
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %28 = OpConstantNull %v3uint
+ %29 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e5a203 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %21
+ %res = OpVariable %_ptr_Function_v3uint Function %28
+ OpStore %arg_1 %int_1
+ %24 = OpLoad %11 %arg_0
+ %25 = OpLoad %int %arg_1
+ %22 = OpImageQuerySizeLod %v3uint %24 %25
+ OpStore %res %22
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %29
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %35
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %41 = OpLabel
+ %42 = OpFunctionCall %void %textureDimensions_e5a203
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl
new file mode 100644
index 0000000..0343a14
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e5a203.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureDimensions_e5a203() {
+ var arg_1 = 1i;
+ var res : vec3<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e5a203();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e5a203();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e5a203();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl
new file mode 100644
index 0000000..e60e2db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rg32sint, write>) -> vec3<u32>
+fn textureDimensions_e738f4() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e738f4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e738f4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e738f4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..32c9a19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_e738f4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e738f4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e738f4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..32c9a19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_e738f4() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e738f4();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e738f4();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl
new file mode 100644
index 0000000..4100c6f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e738f4();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e738f4();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_e738f4() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e738f4();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl
new file mode 100644
index 0000000..4f00a61
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e738f4(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_e738f4(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e738f4(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e738f4(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm
new file mode 100644
index 0000000..f47fb82
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e738f4 "textureDimensions_e738f4"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e738f4 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_e738f4
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl
new file mode 100644
index 0000000..d6b582c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e738f4.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rg32sint, write>;
+
+fn textureDimensions_e738f4() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e738f4();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e738f4();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e738f4();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl
deleted file mode 100644
index 5650d35..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureDimensions(texture: texture_cube_array<i32>) -> vec2<i32>
-fn textureDimensions_e927be() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e927be();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e927be();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e927be();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3be868f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_e927be() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e927be();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e927be();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3be868f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_e927be() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e927be();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e927be();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.glsl
deleted file mode 100644
index a476da2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e927be();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void fragment_main() {
- textureDimensions_e927be();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureDimensions_e927be() {
- ivec2 res = textureSize(arg_0_1, 0).xy;
-}
-
-void compute_main() {
- textureDimensions_e927be();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.msl
deleted file mode 100644
index 709257f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e927be(texturecube_array<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureDimensions_e927be(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e927be(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e927be(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.spvasm
deleted file mode 100644
index 021901e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e927be "textureDimensions_e927be"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %25 = OpConstantNull %v2int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e927be = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureDimensions_e927be
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_e927be
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_e927be
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.wgsl
deleted file mode 100644
index 1c420a1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e927be.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureDimensions_e927be() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e927be();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e927be();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e927be();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl
new file mode 100644
index 0000000..e5025f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba16uint, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba16uint, write>) -> vec2<u32>
+fn textureDimensions_e99308() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e99308();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e99308();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e99308();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2085764
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_e99308() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e99308();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e99308();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2085764
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_e99308() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_e99308();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_e99308();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl
new file mode 100644
index 0000000..51d74f1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_e99308();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_e99308();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2D arg_0;
+void textureDimensions_e99308() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_e99308();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl
new file mode 100644
index 0000000..e74a4e7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_e99308(texture2d<uint, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::write> tint_symbol_2) {
+ textureDimensions_e99308(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_e99308(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_e99308(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm
new file mode 100644
index 0000000..212b7e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_e99308 "textureDimensions_e99308"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_e99308 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v2uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_e99308
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl
new file mode 100644
index 0000000..b3346dc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/e99308.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba16uint, write>;
+
+fn textureDimensions_e99308() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_e99308();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_e99308();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_e99308();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl
deleted file mode 100644
index 4399a36..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<r32float, write>) -> vec2<i32>
-fn textureDimensions_e9e96c() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e9e96c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e9e96c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e9e96c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 510eef8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_e9e96c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e9e96c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e9e96c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 510eef8..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_e9e96c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_e9e96c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_e9e96c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.glsl
deleted file mode 100644
index c167c24..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_e9e96c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_e9e96c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_e9e96c() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_e9e96c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.msl
deleted file mode 100644
index d512809..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_e9e96c(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_e9e96c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_e9e96c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_e9e96c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.spvasm
deleted file mode 100644
index 3bc1dd4..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_e9e96c "textureDimensions_e9e96c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_e9e96c = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_e9e96c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.wgsl
deleted file mode 100644
index 4c37479..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/e9e96c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
-
-fn textureDimensions_e9e96c() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_e9e96c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_e9e96c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_e9e96c();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl
new file mode 100644
index 0000000..ec3f376
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<r32float, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<r32float, write>) -> u32
+fn textureDimensions_ea066c() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea066c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea066c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea066c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..5e0b777
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea066c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea066c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea066c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..5e0b777
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea066c() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea066c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea066c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl
new file mode 100644
index 0000000..70bc37d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ea066c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ea066c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image1D' : Reserved word.
+WARNING: 0:4: 'layout' : useless application of layout qualifier
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(r32f) uniform highp writeonly image1D arg_0;
+void textureDimensions_ea066c() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ea066c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image1D' : Reserved word.
+WARNING: 0:3: 'layout' : useless application of layout qualifier
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl
new file mode 100644
index 0000000..9da6c0d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ea066c(texture1d<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::write> tint_symbol_2) {
+ textureDimensions_ea066c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ea066c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ea066c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm
new file mode 100644
index 0000000..7644858
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ea066c "textureDimensions_ea066c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ea066c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ea066c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl
new file mode 100644
index 0000000..dd5fb14
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea066c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<r32float, write>;
+
+fn textureDimensions_ea066c() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea066c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea066c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea066c();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl
new file mode 100644
index 0000000..ffb3521
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32uint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32uint, write>) -> u32
+fn textureDimensions_ea25bc() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea25bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea25bc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..11fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea25bc() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea25bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea25bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..11fbba9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<uint4> arg_0 : register(u0, space1);
+
+void textureDimensions_ea25bc() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ea25bc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ea25bc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl
new file mode 100644
index 0000000..46e8cb3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ea25bc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage1D arg_0;
+void textureDimensions_ea25bc() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ea25bc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl
new file mode 100644
index 0000000..884b655
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ea25bc(texture1d<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::write> tint_symbol_2) {
+ textureDimensions_ea25bc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ea25bc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ea25bc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm
new file mode 100644
index 0000000..04dabbf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ea25bc "textureDimensions_ea25bc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ea25bc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_ea25bc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl
new file mode 100644
index 0000000..0c96ea0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ea25bc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32uint, write>;
+
+fn textureDimensions_ea25bc() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ea25bc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ea25bc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ea25bc();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl
new file mode 100644
index 0000000..b8c7fbc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureDimensions(texture: texture_depth_2d_array, level: u32) -> vec2<u32>
+fn textureDimensions_eafe19() {
+ var arg_1 = 1u;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eafe19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eafe19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eafe19();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..16f8cae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_eafe19() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eafe19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eafe19();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..16f8cae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureDimensions_eafe19() {
+ uint arg_1 = 1u;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eafe19();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eafe19();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl
new file mode 100644
index 0000000..986faec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_eafe19();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void fragment_main() {
+ textureDimensions_eafe19();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureDimensions_eafe19() {
+ uint arg_1 = 1u;
+ uvec2 res = uvec2(textureSize(arg_0_1, int(arg_1)).xy);
+}
+
+void compute_main() {
+ textureDimensions_eafe19();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl
new file mode 100644
index 0000000..3d8648c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_eafe19(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint arg_1 = 1u;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureDimensions_eafe19(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_eafe19(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_eafe19(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm
new file mode 100644
index 0000000..8bb393e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.spvasm
@@ -0,0 +1,84 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 44
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_eafe19 "textureDimensions_eafe19"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %uint_1 = OpConstant %uint 1
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %20 = OpConstantNull %uint
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %29 = OpConstantNull %v2uint
+ %30 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_eafe19 = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_uint Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %29
+ OpStore %arg_1 %uint_1
+ %25 = OpLoad %11 %arg_0
+ %26 = OpLoad %uint %arg_1
+ %23 = OpImageQuerySizeLod %v3uint %25 %26
+ %21 = OpVectorShuffle %v2uint %23 %23 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %30
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %36
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %42 = OpLabel
+ %43 = OpFunctionCall %void %textureDimensions_eafe19
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl
new file mode 100644
index 0000000..bbf6cfe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eafe19.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureDimensions_eafe19() {
+ var arg_1 = 1u;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eafe19();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eafe19();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eafe19();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl
new file mode 100644
index 0000000..05adc5b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d_array<rgba16float, write>) -> vec2<u32>
+fn textureDimensions_eb03b1() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eb03b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eb03b1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..cbab187
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_eb03b1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eb03b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eb03b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..cbab187
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_eb03b1() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_eb03b1();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_eb03b1();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl
new file mode 100644
index 0000000..dfc6512
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_eb03b1();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureDimensions_eb03b1() {
+ uvec2 res = uvec2(imageSize(arg_0).xy);
+}
+
+void compute_main() {
+ textureDimensions_eb03b1();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl
new file mode 100644
index 0000000..4cfae71
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_eb03b1(texture2d_array<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureDimensions_eb03b1(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_eb03b1(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_eb03b1(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm
new file mode 100644
index 0000000..1685567
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_eb03b1 "textureDimensions_eb03b1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_eb03b1 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %16 = OpVectorShuffle %v2uint %19 %19 0 1
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_eb03b1
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl
new file mode 100644
index 0000000..3eefe24
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/eb03b1.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureDimensions_eb03b1() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_eb03b1();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_eb03b1();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_eb03b1();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl
new file mode 100644
index 0000000..8dec9e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<r32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<r32sint, write>) -> vec3<u32>
+fn textureDimensions_ef2e58() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ef2e58();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ef2e58();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..574ab12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_ef2e58() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ef2e58();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ef2e58();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..574ab12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_ef2e58() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_ef2e58();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_ef2e58();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl
new file mode 100644
index 0000000..15d4aaf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_ef2e58();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage3D arg_0;
+void textureDimensions_ef2e58() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_ef2e58();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl
new file mode 100644
index 0000000..d52234e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_ef2e58(texture3d<int, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::write> tint_symbol_2) {
+ textureDimensions_ef2e58(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_ef2e58(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_ef2e58(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm
new file mode 100644
index 0000000..70ed829
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_ef2e58 "textureDimensions_ef2e58"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %23 = OpConstantNull %v3uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_ef2e58 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %v3uint %20
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureDimensions_ef2e58
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl
new file mode 100644
index 0000000..0a1bbc4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/ef2e58.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<r32sint, write>;
+
+fn textureDimensions_ef2e58() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_ef2e58();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_ef2e58();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_ef2e58();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl
deleted file mode 100644
index 40048ce..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
-
-// fn textureDimensions(texture: texture_multisampled_2d<f32>) -> vec2<i32>
-fn textureDimensions_ef5b89() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ef5b89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ef5b89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ef5b89();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4bc53da..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ef5b89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ef5b89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ef5b89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4bc53da..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_ef5b89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_ef5b89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_ef5b89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.glsl
deleted file mode 100644
index c0c1d74..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_ef5b89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_ef5b89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_ef5b89() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_ef5b89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.msl
deleted file mode 100644
index a0d18a7..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_ef5b89(texture2d_ms<float, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
- textureDimensions_ef5b89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_ef5b89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_ef5b89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.spvasm
deleted file mode 100644
index 2cb1a7f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_ef5b89 "textureDimensions_ef5b89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_ef5b89 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_ef5b89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.wgsl
deleted file mode 100644
index 32a0325..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/ef5b89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
-
-fn textureDimensions_ef5b89() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_ef5b89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_ef5b89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_ef5b89();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl
deleted file mode 100644
index 502cd20..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureDimensions(texture: texture_3d<i32>, level: i32) -> vec3<i32>
-fn textureDimensions_efc8a4() {
- var arg_1 = 1i;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_efc8a4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_efc8a4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_efc8a4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e23fd25..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_efc8a4() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_efc8a4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_efc8a4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e23fd25..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_efc8a4() {
- int arg_1 = 1;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_efc8a4();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_efc8a4();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.glsl
deleted file mode 100644
index 8f4f048..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_efc8a4();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_efc8a4();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureDimensions_efc8a4() {
- int arg_1 = 1;
- ivec3 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_efc8a4();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.msl
deleted file mode 100644
index 12415fb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_efc8a4(texture3d<int, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureDimensions_efc8a4(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_efc8a4(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_efc8a4(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.spvasm
deleted file mode 100644
index dcb7549..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.spvasm
+++ /dev/null
@@ -1,82 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 42
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_efc8a4 "textureDimensions_efc8a4"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %20 = OpConstantNull %int
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %27 = OpConstantNull %v3int
- %28 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_efc8a4 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %20
- %res = OpVariable %_ptr_Function_v3int Function %27
- OpStore %arg_1 %int_1
- %23 = OpLoad %11 %arg_0
- %24 = OpLoad %int %arg_1
- %21 = OpImageQuerySizeLod %v3int %23 %24
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %28
- %30 = OpLabel
- %31 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %34
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %40 = OpLabel
- %41 = OpFunctionCall %void %textureDimensions_efc8a4
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.wgsl
deleted file mode 100644
index c6b604d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/efc8a4.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureDimensions_efc8a4() {
- var arg_1 = 1i;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_efc8a4();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_efc8a4();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_efc8a4();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl
new file mode 100644
index 0000000..bb7fd53
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureDimensions(texture: texture_1d<f32>, level: i32) -> u32
+fn textureDimensions_f17acd() {
+ var arg_1 = 1i;
+ var res: u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f17acd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f17acd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f17acd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8c9b4c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f17acd() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f17acd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f17acd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8c9b4c2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureDimensions_f17acd() {
+ int arg_1 = 1;
+ int2 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.x;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f17acd();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f17acd();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl
new file mode 100644
index 0000000..b9c93dd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.glsl
@@ -0,0 +1,78 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f17acd();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void fragment_main() {
+ textureDimensions_f17acd();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureDimensions_f17acd() {
+ int arg_1 = 1;
+ uint res = uint(textureSize(arg_0_1, arg_1));
+}
+
+void compute_main() {
+ textureDimensions_f17acd();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl
new file mode 100644
index 0000000..f0c2ec8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f17acd(texture1d<float, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureDimensions_f17acd(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f17acd(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f17acd(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm
new file mode 100644
index 0000000..f8f5b8b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.spvasm
@@ -0,0 +1,83 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 42
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f17acd "textureDimensions_f17acd"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %int = OpTypeInt 32 1
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %27 = OpConstantNull %uint
+ %28 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f17acd = OpFunction %void None %12
+ %15 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_uint Function %27
+ OpStore %arg_1 %int_1
+ %23 = OpLoad %11 %arg_0
+ %24 = OpLoad %int %arg_1
+ %21 = OpImageQuerySizeLod %uint %23 %24
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %28
+ %30 = OpLabel
+ %31 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %34
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_f17acd
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl
new file mode 100644
index 0000000..45a3b74
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f17acd.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureDimensions_f17acd() {
+ var arg_1 = 1i;
+ var res : u32 = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f17acd();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f17acd();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f17acd();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl
new file mode 100644
index 0000000..25f67e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_1d<rg32sint, write>;
+
+// fn textureDimensions(texture: texture_storage_1d<rg32sint, write>) -> u32
+fn textureDimensions_f264a3() {
+ var res: u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f264a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f264a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f264a3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bed8fd8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_f264a3() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f264a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f264a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bed8fd8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture1D<int4> arg_0 : register(u0, space1);
+
+void textureDimensions_f264a3() {
+ int tint_tmp;
+ arg_0.GetDimensions(tint_tmp);
+ uint res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f264a3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f264a3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl
new file mode 100644
index 0000000..93568a0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f264a3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f264a3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage1D arg_0;
+void textureDimensions_f264a3() {
+ uint res = uint(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f264a3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl
new file mode 100644
index 0000000..5feaa3c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f264a3(texture1d<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_width(0);
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::write> tint_symbol_2) {
+ textureDimensions_f264a3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f264a3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f264a3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm
new file mode 100644
index 0000000..b148981
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Image1D
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f264a3 "textureDimensions_f264a3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f264a3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySize %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f264a3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl
new file mode 100644
index 0000000..06c76194
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f264a3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_1d<rg32sint, write>;
+
+fn textureDimensions_f264a3() {
+ var res : u32 = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f264a3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f264a3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f264a3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl
deleted file mode 100644
index 08e0d0c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureDimensions(texture: texture_3d<u32>, level: u32) -> vec3<i32>
-fn textureDimensions_f32242() {
- var arg_1 = 1u;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f32242();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f32242();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f32242();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bf7de13..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f32242() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f32242();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f32242();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f32242();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bf7de13..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f32242() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f32242();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f32242();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f32242();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.glsl
deleted file mode 100644
index 85cceb2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_f32242();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_f32242();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureDimensions_f32242() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_f32242();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.msl
deleted file mode 100644
index 77b6336..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f32242(texture3d<uint, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureDimensions_f32242(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f32242(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f32242(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.spvasm
deleted file mode 100644
index 614e908..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f32242 "textureDimensions_f32242"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %28 = OpConstantNull %v3int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f32242 = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v3int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v3int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_f32242
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_f32242
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_f32242
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.wgsl
deleted file mode 100644
index a9d3ca1..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f32242.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureDimensions_f32242() {
- var arg_1 = 1u;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f32242();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f32242();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f32242();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl
new file mode 100644
index 0000000..8c973e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_3d<rgba16float, write>;
+
+// fn textureDimensions(texture: texture_storage_3d<rgba16float, write>) -> vec3<u32>
+fn textureDimensions_f3a2ac() {
+ var res: vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f3a2ac();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f3a2ac();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..13201fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f3a2ac() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f3a2ac();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..13201fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture3D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f3a2ac() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint3 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f3a2ac();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f3a2ac();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl
new file mode 100644
index 0000000..3d3366f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f3a2ac();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image3D arg_0;
+void textureDimensions_f3a2ac() {
+ uvec3 res = uvec3(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f3a2ac();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl
new file mode 100644
index 0000000..1550808
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f3a2ac(texture3d<float, access::write> tint_symbol_1) {
+ uint3 res = uint3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::write> tint_symbol_2) {
+ textureDimensions_f3a2ac(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f3a2ac(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f3a2ac(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm
new file mode 100644
index 0000000..17304eb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f3a2ac "textureDimensions_f3a2ac"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v3uint = OpTypePointer Function %v3uint
+ %22 = OpConstantNull %v3uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f3a2ac = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v3uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v3uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f3a2ac
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl
new file mode 100644
index 0000000..4173903
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f3a2ac.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba16float, write>;
+
+fn textureDimensions_f3a2ac() {
+ var res : vec3<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f3a2ac();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f3a2ac();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f3a2ac();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl
new file mode 100644
index 0000000..7ea7cbb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d<rgba32float, write>;
+
+// fn textureDimensions(texture: texture_storage_2d<rgba32float, write>) -> vec2<u32>
+fn textureDimensions_f4e469() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f4e469();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f4e469();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f4e469();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ae5bd7a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f4e469() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f4e469();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f4e469();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ae5bd7a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2D<float4> arg_0 : register(u0, space1);
+
+void textureDimensions_f4e469() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f4e469();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f4e469();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl
new file mode 100644
index 0000000..07ed54b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f4e469();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void fragment_main() {
+ textureDimensions_f4e469();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2D arg_0;
+void textureDimensions_f4e469() {
+ uvec2 res = uvec2(imageSize(arg_0));
+}
+
+void compute_main() {
+ textureDimensions_f4e469();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl
new file mode 100644
index 0000000..9fba981
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f4e469(texture2d<float, access::write> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
+ textureDimensions_f4e469(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f4e469(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f4e469(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm
new file mode 100644
index 0000000..dbf3eb3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f4e469 "textureDimensions_f4e469"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %22 = OpConstantNull %v2uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f4e469 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySize %v2uint %19
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureDimensions_f4e469
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl
new file mode 100644
index 0000000..fb9261d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f4e469.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d<rgba32float, write>;
+
+fn textureDimensions_f4e469() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f4e469();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f4e469();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f4e469();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl
deleted file mode 100644
index 836def2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
-
-// fn textureDimensions(texture: texture_depth_multisampled_2d) -> vec2<i32>
-fn textureDimensions_f60bdb() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f60bdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f60bdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f60bdb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1609032..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_f60bdb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f60bdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f60bdb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1609032..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_f60bdb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f60bdb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f60bdb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.glsl
deleted file mode 100644
index 9431956..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_f60bdb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void fragment_main() {
- textureDimensions_f60bdb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureDimensions_f60bdb() {
- ivec2 res = textureSize(arg_0_1);
-}
-
-void compute_main() {
- textureDimensions_f60bdb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.msl
deleted file mode 100644
index 1ec0626..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f60bdb(depth2d_ms<float, access::read> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
- textureDimensions_f60bdb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f60bdb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f60bdb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.spvasm
deleted file mode 100644
index e43fe0b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f60bdb "textureDimensions_f60bdb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f60bdb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_f60bdb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.wgsl
deleted file mode 100644
index f22008d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f60bdb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
-
-fn textureDimensions_f60bdb() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f60bdb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f60bdb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f60bdb();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl
new file mode 100644
index 0000000..8c49681
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureDimensions(texture: texture_cube<i32>) -> vec2<u32>
+fn textureDimensions_f626b3() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f626b3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f626b3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f626b3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9c15fdd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f626b3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f626b3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f626b3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9c15fdd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f626b3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f626b3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f626b3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl
new file mode 100644
index 0000000..9e55087
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f626b3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_f626b3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureDimensions_f626b3() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_f626b3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl
new file mode 100644
index 0000000..3c7807b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f626b3(texturecube<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureDimensions_f626b3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f626b3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f626b3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb0bca3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f626b3 "textureDimensions_f626b3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f626b3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_f626b3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl
new file mode 100644
index 0000000..25acd3f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f626b3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureDimensions_f626b3() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f626b3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f626b3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f626b3();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl
deleted file mode 100644
index e7d1787..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureDimensions(texture: texture_2d<u32>, level: i32) -> vec2<i32>
-fn textureDimensions_f7145b() {
- var arg_1 = 1i;
- var res: vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f7145b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f7145b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f7145b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ef35010..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f7145b() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f7145b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f7145b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ef35010..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureDimensions_f7145b() {
- int arg_1 = 1;
- int3 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f7145b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f7145b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.glsl
deleted file mode 100644
index fad3c50..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-vec4 vertex_main() {
- textureDimensions_f7145b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void fragment_main() {
- textureDimensions_f7145b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureDimensions_f7145b() {
- int arg_1 = 1;
- ivec2 res = textureSize(arg_0_1, arg_1);
-}
-
-void compute_main() {
- textureDimensions_f7145b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.msl
deleted file mode 100644
index 140f62b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f7145b(texture2d<uint, access::sample> tint_symbol_1) {
- int arg_1 = 1;
- int2 res = int2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureDimensions_f7145b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f7145b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f7145b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.spvasm
deleted file mode 100644
index 9a315eb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f7145b "textureDimensions_f7145b"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %int_1 = OpConstant %int 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %28 = OpConstantNull %v2int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f7145b = OpFunction %void None %13
- %16 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_int Function %21
- %res = OpVariable %_ptr_Function_v2int Function %28
- OpStore %arg_1 %int_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %int %arg_1
- %22 = OpImageQuerySizeLod %v2int %24 %25
- OpStore %res %22
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_f7145b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.wgsl
deleted file mode 100644
index 6597dc0..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f7145b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureDimensions_f7145b() {
- var arg_1 = 1i;
- var res : vec2<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f7145b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f7145b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f7145b();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl
new file mode 100644
index 0000000..a80d3ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureDimensions(texture: texture_2d<i32>) -> vec2<u32>
+fn textureDimensions_f8522e() {
+ var res: vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f8522e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f8522e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f8522e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c6710be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f8522e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f8522e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f8522e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c6710be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_f8522e() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
+ uint2 res = tint_tmp;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_f8522e();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_f8522e();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl
new file mode 100644
index 0000000..ae80518
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+vec4 vertex_main() {
+ textureDimensions_f8522e();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void fragment_main() {
+ textureDimensions_f8522e();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureDimensions_f8522e() {
+ uvec2 res = uvec2(textureSize(arg_0_1, 0));
+}
+
+void compute_main() {
+ textureDimensions_f8522e();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl
new file mode 100644
index 0000000..8a65be1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_f8522e(texture2d<int, access::sample> tint_symbol_1) {
+ uint2 res = uint2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureDimensions_f8522e(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_f8522e(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_f8522e(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm
new file mode 100644
index 0000000..f912b4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_f8522e "textureDimensions_f8522e"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %int_0 = OpConstant %int 0
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %24 = OpConstantNull %v2uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_f8522e = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_v2uint Function %24
+ %20 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySizeLod %v2uint %20 %int_0
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureDimensions_f8522e
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl
new file mode 100644
index 0000000..a9491d4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/f8522e.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureDimensions_f8522e() {
+ var res : vec2<u32> = textureDimensions(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_f8522e();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_f8522e();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_f8522e();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl
deleted file mode 100644
index e7304f5..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d<r32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d<r32float, write>) -> vec2<i32>
-fn textureDimensions_f931c7() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f931c7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f931c7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f931c7();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 9e231e6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_f931c7() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f931c7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f931c7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 9e231e6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2D<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_f931c7() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_f931c7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_f931c7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.glsl
deleted file mode 100644
index 016f679..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_f931c7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_f931c7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2D arg_0;
-void textureDimensions_f931c7() {
- ivec2 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_f931c7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.msl
deleted file mode 100644
index 7b39e0f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_f931c7(texture2d<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::write> tint_symbol_2) {
- textureDimensions_f931c7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_f931c7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_f931c7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.spvasm
deleted file mode 100644
index 2375b4d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_f931c7 "textureDimensions_f931c7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %22 = OpConstantNull %v2int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_f931c7 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %22
- %19 = OpLoad %11 %arg_0
- %16 = OpImageQuerySize %v2int %19
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureDimensions_f931c7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.wgsl
deleted file mode 100644
index 041ed4c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/f931c7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d<r32float, write>;
-
-fn textureDimensions_f931c7() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_f931c7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_f931c7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_f931c7();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl
deleted file mode 100644
index 0f438d3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureDimensions(texture: texture_2d<i32>) -> vec2<i32>
-fn textureDimensions_fa9859() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fa9859();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fa9859();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fa9859();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4bfdddf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_fa9859() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fa9859();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fa9859();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4bfdddf..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureDimensions_fa9859() {
- int2 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y);
- int2 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fa9859();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fa9859();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.glsl
deleted file mode 100644
index d8e8370..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-vec4 vertex_main() {
- textureDimensions_fa9859();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void fragment_main() {
- textureDimensions_fa9859();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureDimensions_fa9859() {
- ivec2 res = textureSize(arg_0_1, 0);
-}
-
-void compute_main() {
- textureDimensions_fa9859();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.msl
deleted file mode 100644
index 5fca056..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fa9859(texture2d<int, access::sample> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureDimensions_fa9859(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fa9859(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fa9859(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.spvasm
deleted file mode 100644
index 769c44e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fa9859 "textureDimensions_fa9859"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v2int = OpTypeVector %int 2
- %int_0 = OpConstant %int 0
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %23 = OpConstantNull %v2int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fa9859 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %23
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySizeLod %v2int %19 %int_0
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_fa9859
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.wgsl
deleted file mode 100644
index 3acbf7d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fa9859.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureDimensions_fa9859() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fa9859();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fa9859();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fa9859();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl
deleted file mode 100644
index da81f0d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
-
-// fn textureDimensions(texture: texture_storage_2d_array<rg32float, write>) -> vec2<i32>
-fn textureDimensions_fb5670() {
- var res: vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fb5670();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fb5670();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fb5670();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3f6c71f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_fb5670() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fb5670();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fb5670();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3f6c71f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureDimensions_fb5670() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int2 res = tint_tmp.xy;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fb5670();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fb5670();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.glsl
deleted file mode 100644
index 5c3bd40..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-vec4 vertex_main() {
- textureDimensions_fb5670();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void fragment_main() {
- textureDimensions_fb5670();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureDimensions_fb5670() {
- ivec2 res = imageSize(arg_0).xy;
-}
-
-void compute_main() {
- textureDimensions_fb5670();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.msl
deleted file mode 100644
index fed740f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fb5670(texture2d_array<float, access::write> tint_symbol_1) {
- int2 res = int2(tint_symbol_1.get_width(), tint_symbol_1.get_height());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureDimensions_fb5670(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fb5670(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fb5670(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.spvasm
deleted file mode 100644
index c870194..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fb5670 "textureDimensions_fb5670"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v2int = OpTypePointer Function %v2int
- %24 = OpConstantNull %v2int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fb5670 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_v2int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %16 = OpVectorShuffle %v2int %19 %19 0 1
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureDimensions_fb5670
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.wgsl
deleted file mode 100644
index 199f355..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fb5670.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
-
-fn textureDimensions_fb5670() {
- var res : vec2<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fb5670();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fb5670();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fb5670();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl
deleted file mode 100644
index 31013b6..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2022 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureDimensions(texture: texture_3d<f32>, level: u32) -> vec3<i32>
-fn textureDimensions_fbdfb6() {
- var arg_1 = 1u;
- var res: vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fbdfb6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fbdfb6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d6b9fe2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_fbdfb6() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fbdfb6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fbdfb6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d6b9fe2..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,35 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureDimensions_fbdfb6() {
- uint arg_1 = 1u;
- int4 tint_tmp;
- arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int3 res = tint_tmp.xyz;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fbdfb6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fbdfb6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.glsl
deleted file mode 100644
index 62b4cbb..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.glsl
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-vec4 vertex_main() {
- textureDimensions_fbdfb6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureDimensions_fbdfb6() {
- uint arg_1 = 1u;
- ivec3 res = textureSize(arg_0_1, int(arg_1));
-}
-
-void compute_main() {
- textureDimensions_fbdfb6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.msl
deleted file mode 100644
index a9b385d..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.msl
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fbdfb6(texture3d<float, access::sample> tint_symbol_1) {
- uint arg_1 = 1u;
- int3 res = int3(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1), tint_symbol_1.get_depth(arg_1));
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureDimensions_fbdfb6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fbdfb6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fbdfb6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.spvasm
deleted file mode 100644
index cb182db..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,83 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 43
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fbdfb6 "textureDimensions_fbdfb6"
- OpName %arg_1 "arg_1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %uint = OpTypeInt 32 0
- %uint_1 = OpConstant %uint 1
-%_ptr_Function_uint = OpTypePointer Function %uint
- %20 = OpConstantNull %uint
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %28 = OpConstantNull %v3int
- %29 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fbdfb6 = OpFunction %void None %12
- %15 = OpLabel
- %arg_1 = OpVariable %_ptr_Function_uint Function %20
- %res = OpVariable %_ptr_Function_v3int Function %28
- OpStore %arg_1 %uint_1
- %24 = OpLoad %11 %arg_0
- %25 = OpLoad %uint %arg_1
- %21 = OpImageQuerySizeLod %v3int %24 %25
- OpStore %res %21
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %29
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %35
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %41 = OpLabel
- %42 = OpFunctionCall %void %textureDimensions_fbdfb6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.wgsl
deleted file mode 100644
index 2b1a31e..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fbdfb6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,22 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureDimensions_fbdfb6() {
- var arg_1 = 1u;
- var res : vec3<i32> = textureDimensions(arg_0, arg_1);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fbdfb6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fbdfb6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fbdfb6();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl
deleted file mode 100644
index f99ff3f..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_3d<rgba8uint, write>;
-
-// fn textureDimensions(texture: texture_storage_3d<rgba8uint, write>) -> vec3<i32>
-fn textureDimensions_fcac78() {
- var res: vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fcac78();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fcac78();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fcac78();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f02946b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_fcac78() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fcac78();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fcac78();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f02946b..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture3D<uint4> arg_0 : register(u0, space1);
-
-void textureDimensions_fcac78() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int3 res = tint_tmp;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureDimensions_fcac78();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureDimensions_fcac78();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.glsl
deleted file mode 100644
index 9226dcd..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-vec4 vertex_main() {
- textureDimensions_fcac78();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-void fragment_main() {
- textureDimensions_fcac78();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage3D arg_0;
-void textureDimensions_fcac78() {
- ivec3 res = imageSize(arg_0);
-}
-
-void compute_main() {
- textureDimensions_fcac78();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.msl
deleted file mode 100644
index 3c6340c..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureDimensions_fcac78(texture3d<uint, access::write> tint_symbol_1) {
- int3 res = int3(tint_symbol_1.get_width(), tint_symbol_1.get_height(), tint_symbol_1.get_depth());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::write> tint_symbol_2) {
- textureDimensions_fcac78(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureDimensions_fcac78(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureDimensions_fcac78(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.spvasm
deleted file mode 100644
index 2b1c5c3..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureDimensions_fcac78 "textureDimensions_fcac78"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_v3int = OpTypePointer Function %v3int
- %23 = OpConstantNull %v3int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureDimensions_fcac78 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_v3int Function %23
- %20 = OpLoad %11 %arg_0
- %17 = OpImageQuerySize %v3int %20
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureDimensions_fcac78
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.wgsl
deleted file mode 100644
index 3e13671..0000000
--- a/test/tint/builtins/gen/var/textureDimensions/fcac78.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_3d<rgba8uint, write>;
-
-fn textureDimensions_fcac78() {
- var res : vec3<i32> = textureDimensions(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureDimensions_fcac78();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureDimensions_fcac78();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureDimensions_fcac78();
-}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl
new file mode 100644
index 0000000..2359d78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl
@@ -0,0 +1,45 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureDimensions(texture: texture_2d_array<i32>, level: i32) -> vec2<u32>
+fn textureDimensions_fdf6e9() {
+ var arg_1 = 1i;
+ var res: vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdf6e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdf6e9();
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..aa96c91
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_fdf6e9() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdf6e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..aa96c91
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,35 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureDimensions_fdf6e9() {
+ int arg_1 = 1;
+ int4 tint_tmp;
+ arg_0.GetDimensions(arg_1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint2 res = tint_tmp.xy;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureDimensions_fdf6e9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureDimensions_fdf6e9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl
new file mode 100644
index 0000000..c2c98fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.glsl
@@ -0,0 +1,55 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+vec4 vertex_main() {
+ textureDimensions_fdf6e9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureDimensions_fdf6e9() {
+ int arg_1 = 1;
+ uvec2 res = uvec2(textureSize(arg_0_1, arg_1).xy);
+}
+
+void compute_main() {
+ textureDimensions_fdf6e9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl
new file mode 100644
index 0000000..849b694
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.msl
@@ -0,0 +1,34 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureDimensions_fdf6e9(texture2d_array<int, access::sample> tint_symbol_1) {
+ int arg_1 = 1;
+ uint2 res = uint2(tint_symbol_1.get_width(arg_1), tint_symbol_1.get_height(arg_1));
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureDimensions_fdf6e9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureDimensions_fdf6e9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureDimensions_fdf6e9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm
new file mode 100644
index 0000000..de44015
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.spvasm
@@ -0,0 +1,85 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 45
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureDimensions_fdf6e9 "textureDimensions_fdf6e9"
+ OpName %arg_1 "arg_1"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %int_1 = OpConstant %int 1
+%_ptr_Function_int = OpTypePointer Function %int
+ %20 = OpConstantNull %int
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_v2uint = OpTypePointer Function %v2uint
+ %30 = OpConstantNull %v2uint
+ %31 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureDimensions_fdf6e9 = OpFunction %void None %13
+ %16 = OpLabel
+ %arg_1 = OpVariable %_ptr_Function_int Function %20
+ %res = OpVariable %_ptr_Function_v2uint Function %30
+ OpStore %arg_1 %int_1
+ %26 = OpLoad %11 %arg_0
+ %27 = OpLoad %int %arg_1
+ %24 = OpImageQuerySizeLod %v3uint %26 %27
+ %21 = OpVectorShuffle %v2uint %24 %24 0 1
+ OpStore %res %21
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %31
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %37
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %40 = OpLabel
+ %41 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %43 = OpLabel
+ %44 = OpFunctionCall %void %textureDimensions_fdf6e9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl
new file mode 100644
index 0000000..9138c00
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureDimensions/fdf6e9.wgsl.expected.wgsl
@@ -0,0 +1,22 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureDimensions_fdf6e9() {
+ var arg_1 = 1i;
+ var res : vec2<u32> = textureDimensions(arg_0, arg_1);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureDimensions_fdf6e9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureDimensions_fdf6e9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureDimensions_fdf6e9();
+}
diff --git a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
index 7a48c97..d8ba0a3 100644
--- a/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/1b8588.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -35,7 +35,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -59,7 +59,7 @@
uniform highp usampler1D arg_0_1;
void textureLoad_1b8588() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
uvec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
index 4c2d0e6..9f480a3 100644
--- a/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/5a2f9d.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -35,7 +35,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -59,7 +59,7 @@
uniform highp isampler1D arg_0_1;
void textureLoad_5a2f9d() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
ivec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
index 33ebb73..93c2a7a 100644
--- a/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureLoad/81c381.wgsl.expected.glsl
@@ -5,7 +5,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -35,7 +35,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
@@ -59,7 +59,7 @@
uniform highp sampler1D arg_0_1;
void textureLoad_81c381() {
int arg_1 = 1;
- int arg_2 = 0;
+ int arg_2 = 1;
vec4 res = texelFetch(arg_0_1, arg_1, arg_2);
}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl
new file mode 100644
index 0000000..ddc52ad
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> u32
+fn textureNumLayers_014a3b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_014a3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_014a3b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..470f2ac
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_014a3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_014a3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_014a3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..470f2ac
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_014a3b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_014a3b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_014a3b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl
new file mode 100644
index 0000000..c1c9781
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_014a3b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_014a3b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_014a3b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl
new file mode 100644
index 0000000..4a03eda
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_014a3b(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_014a3b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_014a3b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_014a3b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm
new file mode 100644
index 0000000..2acde0b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_014a3b "textureNumLayers_014a3b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_014a3b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_014a3b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl
new file mode 100644
index 0000000..9c87b00
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/014a3b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
+
+fn textureNumLayers_014a3b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_014a3b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_014a3b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_014a3b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl
deleted file mode 100644
index 2abd10d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureNumLayers(texture: texture_2d_array<f32>) -> i32
-fn textureNumLayers_024820() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_024820();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_024820();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_024820();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c54de32..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_024820() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_024820();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_024820();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c54de32..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_024820() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_024820();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_024820();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.glsl
deleted file mode 100644
index 9e3639f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_024820();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_024820();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_024820() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_024820();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.msl
deleted file mode 100644
index 62c3cda..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_024820(texture2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_024820(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_024820(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_024820(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.spvasm
deleted file mode 100644
index 5c65a19..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_024820 "textureNumLayers_024820"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_024820 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_024820
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_024820
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_024820
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.wgsl
deleted file mode 100644
index eaa9cc7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/024820.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureNumLayers_024820() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_024820();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_024820();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_024820();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl
deleted file mode 100644
index e4ee7aa..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureNumLayers(texture: texture_cube_array<u32>) -> i32
-fn textureNumLayers_053df7() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_053df7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_053df7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_053df7();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ec08652..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_053df7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_053df7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_053df7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ec08652..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_053df7() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_053df7();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_053df7();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.glsl
deleted file mode 100644
index e995abb..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_053df7();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_053df7();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLayers_053df7() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_053df7();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.msl
deleted file mode 100644
index 68ceeb4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_053df7(texturecube_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureNumLayers_053df7(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_053df7(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_053df7(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.spvasm
deleted file mode 100644
index a8336ca..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_053df7 "textureNumLayers_053df7"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %25 = OpConstantNull %int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_053df7 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureNumLayers_053df7
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.wgsl
deleted file mode 100644
index 06592ac..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/053df7.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureNumLayers_053df7() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_053df7();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_053df7();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_053df7();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl
deleted file mode 100644
index 205475f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> i32
-fn textureNumLayers_058cc3() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_058cc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_058cc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_058cc3();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0f9f61a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_058cc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_058cc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_058cc3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0f9f61a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_058cc3() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_058cc3();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_058cc3();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.glsl
deleted file mode 100644
index 0730d3a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_058cc3();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_058cc3();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_058cc3() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_058cc3();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.msl
deleted file mode 100644
index f89aa00..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_058cc3(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_058cc3(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_058cc3(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_058cc3(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.spvasm
deleted file mode 100644
index 4737d7e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_058cc3 "textureNumLayers_058cc3"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_058cc3 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_058cc3
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.wgsl
deleted file mode 100644
index a39583b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/058cc3.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
-
-fn textureNumLayers_058cc3() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_058cc3();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_058cc3();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_058cc3();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl
new file mode 100644
index 0000000..4ffee75
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> u32
+fn textureNumLayers_071ebc() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_071ebc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_071ebc();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..11a36cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_071ebc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_071ebc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_071ebc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..11a36cc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_071ebc() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_071ebc();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_071ebc();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl
new file mode 100644
index 0000000..ca8029c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_071ebc();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_071ebc() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_071ebc();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl
new file mode 100644
index 0000000..f9657e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_071ebc(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_071ebc(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_071ebc(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_071ebc(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a70e26
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_071ebc "textureNumLayers_071ebc"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_071ebc = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_071ebc
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl
new file mode 100644
index 0000000..61626de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/071ebc.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
+
+fn textureNumLayers_071ebc() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_071ebc();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_071ebc();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_071ebc();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl
deleted file mode 100644
index 58e1dba..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> i32
-fn textureNumLayers_09d05d() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_09d05d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_09d05d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_09d05d();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index c52cd47..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_09d05d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_09d05d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_09d05d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index c52cd47..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_09d05d() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_09d05d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_09d05d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.glsl
deleted file mode 100644
index 25b7ded..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_09d05d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_09d05d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_09d05d() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_09d05d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.msl
deleted file mode 100644
index 6666c52..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_09d05d(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_09d05d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_09d05d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_09d05d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.spvasm
deleted file mode 100644
index e70fdfc..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_09d05d "textureNumLayers_09d05d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_09d05d = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_09d05d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.wgsl
deleted file mode 100644
index cede280..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/09d05d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
-
-fn textureNumLayers_09d05d() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_09d05d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_09d05d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_09d05d();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl
new file mode 100644
index 0000000..bba0167
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureNumLayers(texture: texture_2d_array<f32>) -> u32
+fn textureNumLayers_0ec222() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_0ec222();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_0ec222();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ff2543
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_0ec222() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_0ec222();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_0ec222();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ff2543
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_0ec222() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_0ec222();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_0ec222();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl
new file mode 100644
index 0000000..37ecbb1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_0ec222();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_0ec222() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_0ec222();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl
new file mode 100644
index 0000000..63e8634
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_0ec222(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_0ec222(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_0ec222(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_0ec222(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm
new file mode 100644
index 0000000..b6d7c2b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_0ec222 "textureNumLayers_0ec222"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_0ec222 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_0ec222
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl
new file mode 100644
index 0000000..3f18e09
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/0ec222.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLayers_0ec222() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_0ec222();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_0ec222();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_0ec222();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl
deleted file mode 100644
index c67abfb..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> i32
-fn textureNumLayers_13b4ce() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_13b4ce();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_13b4ce();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4d9ac8a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_13b4ce() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_13b4ce();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_13b4ce();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4d9ac8a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_13b4ce() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_13b4ce();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_13b4ce();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.glsl
deleted file mode 100644
index f090067..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_13b4ce();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_13b4ce() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_13b4ce();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.msl
deleted file mode 100644
index bb33ae6..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_13b4ce(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_13b4ce(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_13b4ce(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_13b4ce(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.spvasm
deleted file mode 100644
index 651790d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_13b4ce "textureNumLayers_13b4ce"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_13b4ce = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_13b4ce
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.wgsl
deleted file mode 100644
index 15c0d55..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/13b4ce.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
-
-fn textureNumLayers_13b4ce() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_13b4ce();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_13b4ce();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_13b4ce();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl
deleted file mode 100644
index 97c27df..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> i32
-fn textureNumLayers_22e53b() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_22e53b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_22e53b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_22e53b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8611a52..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_22e53b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_22e53b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_22e53b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8611a52..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_22e53b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_22e53b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_22e53b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.glsl
deleted file mode 100644
index 3902bb3..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_22e53b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_22e53b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_22e53b() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_22e53b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.msl
deleted file mode 100644
index 5c5fa33..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_22e53b(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_22e53b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_22e53b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_22e53b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.spvasm
deleted file mode 100644
index 953a4a4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_22e53b "textureNumLayers_22e53b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 R32i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_22e53b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_22e53b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.wgsl
deleted file mode 100644
index 2ac3057..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/22e53b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
-
-fn textureNumLayers_22e53b() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_22e53b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_22e53b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_22e53b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl
new file mode 100644
index 0000000..376f70d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> u32
+fn textureNumLayers_3465ec() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3465ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3465ec();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b8ba0b2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3465ec() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3465ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3465ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b8ba0b2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3465ec() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3465ec();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3465ec();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl
new file mode 100644
index 0000000..0e7b8e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_3465ec();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_3465ec() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_3465ec();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl
new file mode 100644
index 0000000..356deb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_3465ec(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_3465ec(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_3465ec(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_3465ec(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm
new file mode 100644
index 0000000..fae4592
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_3465ec "textureNumLayers_3465ec"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 R32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_3465ec = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_3465ec
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl
new file mode 100644
index 0000000..409c7e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3465ec.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
+
+fn textureNumLayers_3465ec() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3465ec();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3465ec();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3465ec();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl
new file mode 100644
index 0000000..ba4649d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureNumLayers(texture: texture_cube_array<f32>) -> u32
+fn textureNumLayers_34cefa() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_34cefa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_34cefa();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..aafeb23
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_34cefa() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_34cefa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_34cefa();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..aafeb23
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLayers_34cefa() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_34cefa();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_34cefa();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl
new file mode 100644
index 0000000..6cf0e2a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_34cefa();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_34cefa() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_34cefa();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.msl
new file mode 100644
index 0000000..4939f4e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_34cefa(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_34cefa(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_34cefa(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_34cefa(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.spvasm
new file mode 100644
index 0000000..56da867
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_34cefa "textureNumLayers_34cefa"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_34cefa = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_34cefa
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.wgsl
new file mode 100644
index 0000000..9f82af9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/34cefa.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLayers_34cefa() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_34cefa();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_34cefa();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_34cefa();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl
new file mode 100644
index 0000000..881a6d3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32sint, write>) -> u32
+fn textureNumLayers_3580ab() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3580ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3580ab();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..8ff6e3c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3580ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3580ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3580ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..8ff6e3c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_3580ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_3580ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_3580ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl
new file mode 100644
index 0000000..1c54488
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_3580ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_3580ab() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_3580ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl
new file mode 100644
index 0000000..e6235c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_3580ab(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_3580ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_3580ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_3580ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..2e0c867
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_3580ab "textureNumLayers_3580ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rg32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_3580ab = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_3580ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..6434d12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/3580ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32sint, write>;
+
+fn textureNumLayers_3580ab() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_3580ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_3580ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_3580ab();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl
new file mode 100644
index 0000000..d110c44
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureNumLayers(texture: texture_depth_cube_array) -> u32
+fn textureNumLayers_48ef47() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_48ef47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_48ef47();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..16898b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLayers_48ef47() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_48ef47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_48ef47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..16898b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLayers_48ef47() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_48ef47();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_48ef47();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl
new file mode 100644
index 0000000..406b57c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_48ef47();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLayers_48ef47() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_48ef47();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.msl
new file mode 100644
index 0000000..5fd51cb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_48ef47(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_48ef47(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_48ef47(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_48ef47(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.spvasm
new file mode 100644
index 0000000..9e2bf03
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_48ef47 "textureNumLayers_48ef47"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_48ef47 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_48ef47
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.wgsl
new file mode 100644
index 0000000..c39479b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/48ef47.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureNumLayers_48ef47() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_48ef47();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_48ef47();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_48ef47();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl
new file mode 100644
index 0000000..5b17e29
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> u32
+fn textureNumLayers_4c4333() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_4c4333();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_4c4333();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f4f07a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_4c4333() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_4c4333();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_4c4333();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f4f07a9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_4c4333() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_4c4333();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_4c4333();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl
new file mode 100644
index 0000000..0fef0c7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_4c4333();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_4c4333() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_4c4333();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl
new file mode 100644
index 0000000..e7e878d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_4c4333(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_4c4333(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_4c4333(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_4c4333(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm
new file mode 100644
index 0000000..942e442
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_4c4333 "textureNumLayers_4c4333"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_4c4333 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_4c4333
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl
new file mode 100644
index 0000000..3217266
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/4c4333.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
+
+fn textureNumLayers_4c4333() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_4c4333();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_4c4333();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_4c4333();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl
deleted file mode 100644
index 740fc82..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> i32
-fn textureNumLayers_562013() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_562013();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_562013();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_562013();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 59664cc..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_562013() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_562013();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_562013();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 59664cc..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_562013() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_562013();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_562013();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.glsl
deleted file mode 100644
index 713a325..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_562013();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_562013();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_562013() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_562013();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.msl
deleted file mode 100644
index 97a5498..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_562013(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_562013(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_562013(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_562013(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.spvasm
deleted file mode 100644
index 96b0fc2..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_562013 "textureNumLayers_562013"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_562013 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_562013
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_562013
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_562013
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.wgsl
deleted file mode 100644
index c82f593..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/562013.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
-
-fn textureNumLayers_562013() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_562013();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_562013();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_562013();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl
new file mode 100644
index 0000000..6d37cbd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32sint, write>) -> u32
+fn textureNumLayers_59eb57() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59eb57();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59eb57();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ac9329
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_59eb57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59eb57();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59eb57();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ac9329
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_59eb57() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_59eb57();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_59eb57();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl
new file mode 100644
index 0000000..5d27d74
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_59eb57();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_59eb57() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_59eb57();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl
new file mode 100644
index 0000000..bc42953
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_59eb57(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_59eb57(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_59eb57(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_59eb57(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm
new file mode 100644
index 0000000..8fdfad3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_59eb57 "textureNumLayers_59eb57"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 R32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_59eb57 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_59eb57
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl
new file mode 100644
index 0000000..eb6df73
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/59eb57.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32sint, write>;
+
+fn textureNumLayers_59eb57() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_59eb57();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_59eb57();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_59eb57();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl
deleted file mode 100644
index 538aee4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureNumLayers(texture: texture_cube_array<f32>) -> i32
-fn textureNumLayers_5d59cd() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_5d59cd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_5d59cd();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 063ac3b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_5d59cd() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_5d59cd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_5d59cd();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 063ac3b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLayers_5d59cd() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_5d59cd();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_5d59cd();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.glsl
deleted file mode 100644
index c469183..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_5d59cd();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_5d59cd() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_5d59cd();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.msl
deleted file mode 100644
index aa7890e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_5d59cd(texturecube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_5d59cd(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_5d59cd(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_5d59cd(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.spvasm
deleted file mode 100644
index e7f1f9e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_5d59cd "textureNumLayers_5d59cd"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_5d59cd = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_5d59cd
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.wgsl
deleted file mode 100644
index 28bcd65..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/5d59cd.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureNumLayers_5d59cd() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_5d59cd();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_5d59cd();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_5d59cd();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl
new file mode 100644
index 0000000..ef61c18
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> u32
+fn textureNumLayers_61bd23() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_61bd23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_61bd23();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..89f3e18
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_61bd23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_61bd23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_61bd23();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..89f3e18
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_61bd23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_61bd23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_61bd23();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl
new file mode 100644
index 0000000..c709957
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_61bd23();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_61bd23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_61bd23();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl
new file mode 100644
index 0000000..cee795a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_61bd23(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_61bd23(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_61bd23(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_61bd23(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm
new file mode 100644
index 0000000..ca56085
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_61bd23 "textureNumLayers_61bd23"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_61bd23 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_61bd23
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl
new file mode 100644
index 0000000..9a53a59
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/61bd23.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
+
+fn textureNumLayers_61bd23() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_61bd23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_61bd23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_61bd23();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl
deleted file mode 100644
index e7c4f20..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> i32
-fn textureNumLayers_68a65b() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_68a65b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_68a65b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_68a65b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cefd820..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_68a65b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_68a65b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_68a65b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cefd820..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_68a65b() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_68a65b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_68a65b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.glsl
deleted file mode 100644
index 38cd9e7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_68a65b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_68a65b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_68a65b() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_68a65b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.msl
deleted file mode 100644
index 906ffc5..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_68a65b(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_68a65b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_68a65b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_68a65b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.spvasm
deleted file mode 100644
index 53d6ff2..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_68a65b "textureNumLayers_68a65b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_68a65b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_68a65b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.wgsl
deleted file mode 100644
index f7cfa50..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/68a65b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
-
-fn textureNumLayers_68a65b() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_68a65b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_68a65b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_68a65b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl
new file mode 100644
index 0000000..31e32f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureNumLayers(texture: texture_cube_array<i32>) -> u32
+fn textureNumLayers_6b4321() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_6b4321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_6b4321();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e6ebad8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_6b4321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_6b4321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_6b4321();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e6ebad8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_6b4321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_6b4321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_6b4321();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl
new file mode 100644
index 0000000..9fd427f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_6b4321();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLayers_6b4321() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_6b4321();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.msl
new file mode 100644
index 0000000..ee31186
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_6b4321(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureNumLayers_6b4321(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_6b4321(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_6b4321(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.spvasm
new file mode 100644
index 0000000..3504ed0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_6b4321 "textureNumLayers_6b4321"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_6b4321 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_6b4321
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.wgsl
new file mode 100644
index 0000000..952e831
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/6b4321.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLayers_6b4321() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_6b4321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_6b4321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_6b4321();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl
deleted file mode 100644
index 06508d7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureNumLayers(texture: texture_depth_cube_array) -> i32
-fn textureNumLayers_778bd1() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_778bd1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_778bd1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_778bd1();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 198c36b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLayers_778bd1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_778bd1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_778bd1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 198c36b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLayers_778bd1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_778bd1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_778bd1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.glsl
deleted file mode 100644
index 40debcc..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_778bd1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_778bd1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLayers_778bd1() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_778bd1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.msl
deleted file mode 100644
index fc13fba..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_778bd1(depthcube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_778bd1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_778bd1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_778bd1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.spvasm
deleted file mode 100644
index b1fd36b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_778bd1 "textureNumLayers_778bd1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_778bd1 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_778bd1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.wgsl
deleted file mode 100644
index 8274e1e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/778bd1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureNumLayers_778bd1() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_778bd1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_778bd1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_778bd1();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl
new file mode 100644
index 0000000..a5ece22
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureNumLayers(texture: texture_2d_array<i32>) -> u32
+fn textureNumLayers_77be7b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_77be7b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_77be7b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..baad1e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_77be7b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_77be7b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_77be7b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..baad1e8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLayers_77be7b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_77be7b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_77be7b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl
new file mode 100644
index 0000000..6af1d4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_77be7b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLayers_77be7b() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_77be7b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl
new file mode 100644
index 0000000..bb749fd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_77be7b(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureNumLayers_77be7b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_77be7b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_77be7b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm
new file mode 100644
index 0000000..c5d95de
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_77be7b "textureNumLayers_77be7b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_77be7b = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySizeLod %v3uint %21 %int_0
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_77be7b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl
new file mode 100644
index 0000000..e61657d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/77be7b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLayers_77be7b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_77be7b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_77be7b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_77be7b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl
deleted file mode 100644
index cf29588..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> i32
-fn textureNumLayers_7f1937() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_7f1937();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_7f1937();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_7f1937();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl
deleted file mode 100644
index edd423a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_7f1937() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_7f1937();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_7f1937();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl
deleted file mode 100644
index edd423a..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_7f1937() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_7f1937();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_7f1937();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.glsl
deleted file mode 100644
index f6fdbf0..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_7f1937();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_7f1937();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_7f1937() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_7f1937();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.msl
deleted file mode 100644
index 05239da..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_7f1937(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_7f1937(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_7f1937(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_7f1937(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.spvasm
deleted file mode 100644
index 59d909d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_7f1937 "textureNumLayers_7f1937"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_7f1937 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_7f1937
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.wgsl
deleted file mode 100644
index 27ba412..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/7f1937.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
-
-fn textureNumLayers_7f1937() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_7f1937();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_7f1937();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_7f1937();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl
new file mode 100644
index 0000000..9184fe8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rg32float, write>) -> u32
+fn textureNumLayers_7f28cf() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_7f28cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_7f28cf();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..ffe3a19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_7f28cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_7f28cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..ffe3a19
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_7f28cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_7f28cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_7f28cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl
new file mode 100644
index 0000000..6b98fb4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_7f28cf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'image load-store format' : not supported with this profile: es
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+layout(rg32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_7f28cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_7f28cf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'image load-store format' : not supported with this profile: es
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl
new file mode 100644
index 0000000..dfa6427
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_7f28cf(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_7f28cf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_7f28cf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_7f28cf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..fae74c5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability StorageImageExtendedFormats
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_7f28cf "textureNumLayers_7f28cf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rg32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_7f28cf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_7f28cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..9315c01
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/7f28cf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32float, write>;
+
+fn textureNumLayers_7f28cf() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_7f28cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_7f28cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_7f28cf();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl
deleted file mode 100644
index 38bb36e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureNumLayers(texture: texture_cube_array<i32>) -> i32
-fn textureNumLayers_85f980() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_85f980();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_85f980();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_85f980();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.dxc.hlsl
deleted file mode 100644
index bd6cdc4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_85f980() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_85f980();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_85f980();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.fxc.hlsl
deleted file mode 100644
index bd6cdc4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_85f980() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_85f980();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_85f980();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.glsl
deleted file mode 100644
index 529bfb3..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_85f980();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_85f980();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLayers_85f980() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_85f980();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.msl
deleted file mode 100644
index e1b10eb..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_85f980(texturecube_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureNumLayers_85f980(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_85f980(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_85f980(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.spvasm
deleted file mode 100644
index 4484cad..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_85f980 "textureNumLayers_85f980"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_85f980 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_85f980
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.wgsl
deleted file mode 100644
index 5206f51..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/85f980.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureNumLayers_85f980() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_85f980();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_85f980();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_85f980();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl
new file mode 100644
index 0000000..95d81a8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> u32
+fn textureNumLayers_878dea() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_878dea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_878dea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_878dea();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..60c70b1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_878dea() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_878dea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_878dea();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..60c70b1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_878dea() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_878dea();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_878dea();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl
new file mode 100644
index 0000000..e29de3e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_878dea();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_878dea();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_878dea() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_878dea();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl
new file mode 100644
index 0000000..7b10509
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_878dea(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_878dea(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_878dea(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_878dea(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm
new file mode 100644
index 0000000..8426d4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_878dea "textureNumLayers_878dea"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_878dea = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_878dea
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl
new file mode 100644
index 0000000..c164c88
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/878dea.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
+
+fn textureNumLayers_878dea() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_878dea();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_878dea();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_878dea();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl
deleted file mode 100644
index b982487..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureNumLayers(texture: texture_2d_array<u32>) -> i32
-fn textureNumLayers_87953e() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_87953e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_87953e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_87953e();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5c563c4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_87953e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_87953e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_87953e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5c563c4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLayers_87953e() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_87953e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_87953e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.glsl
deleted file mode 100644
index 83bae63..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_87953e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_87953e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLayers_87953e() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_87953e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.msl
deleted file mode 100644
index 971482f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_87953e(texture2d_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureNumLayers_87953e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_87953e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_87953e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.spvasm
deleted file mode 100644
index 109f2d0..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 40
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_87953e "textureNumLayers_87953e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %25 = OpConstantNull %int
- %26 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_87953e = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %25
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySizeLod %v3int %21 %int_0
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %26
- %28 = OpLabel
- %29 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %32
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %38 = OpLabel
- %39 = OpFunctionCall %void %textureNumLayers_87953e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.wgsl
deleted file mode 100644
index 55d0f9d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/87953e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureNumLayers_87953e() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_87953e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_87953e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_87953e();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl
new file mode 100644
index 0000000..4939ab3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> u32
+fn textureNumLayers_87faad() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_87faad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_87faad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_87faad();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..04ccdcf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_87faad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_87faad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_87faad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..04ccdcf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_87faad() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_87faad();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_87faad();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl
new file mode 100644
index 0000000..00057ca
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_87faad();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_87faad();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_87faad() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_87faad();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl
new file mode 100644
index 0000000..acf16b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_87faad(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_87faad(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_87faad(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_87faad(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm
new file mode 100644
index 0000000..4a12d33
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_87faad "textureNumLayers_87faad"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_87faad = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_87faad
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl
new file mode 100644
index 0000000..fcd265c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/87faad.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
+
+fn textureNumLayers_87faad() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_87faad();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_87faad();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_87faad();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl
deleted file mode 100644
index 533a86f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureNumLayers(texture: texture_2d_array<i32>) -> i32
-fn textureNumLayers_893e7c() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_893e7c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_893e7c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_893e7c();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0991385..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_893e7c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_893e7c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_893e7c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0991385..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLayers_893e7c() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_893e7c();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_893e7c();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.glsl
deleted file mode 100644
index e2d0eb6..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_893e7c();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_893e7c();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLayers_893e7c() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_893e7c();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.msl
deleted file mode 100644
index 66d329d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_893e7c(texture2d_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureNumLayers_893e7c(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_893e7c(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_893e7c(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.spvasm
deleted file mode 100644
index 22bfd83..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_893e7c "textureNumLayers_893e7c"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_893e7c = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_893e7c
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.wgsl
deleted file mode 100644
index 1ef4610..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/893e7c.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureNumLayers_893e7c() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_893e7c();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_893e7c();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_893e7c();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl
new file mode 100644
index 0000000..b3f969b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureNumLayers(texture: texture_2d_array<u32>) -> u32
+fn textureNumLayers_8ac32a() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8ac32a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8ac32a();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..92e4a10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_8ac32a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8ac32a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..92e4a10
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_8ac32a() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8ac32a();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8ac32a();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl
new file mode 100644
index 0000000..083cd13
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8ac32a();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLayers_8ac32a() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8ac32a();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl
new file mode 100644
index 0000000..218af14
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8ac32a(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureNumLayers_8ac32a(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8ac32a(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8ac32a(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm
new file mode 100644
index 0000000..febad27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8ac32a "textureNumLayers_8ac32a"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8ac32a = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_8ac32a
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl
new file mode 100644
index 0000000..65a1ae2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8ac32a.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLayers_8ac32a() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8ac32a();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8ac32a();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8ac32a();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl
new file mode 100644
index 0000000..95138eb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32sint, write>) -> u32
+fn textureNumLayers_8bd987() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8bd987();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8bd987();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..dcf3497
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8bd987() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8bd987();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8bd987();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..dcf3497
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8bd987() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8bd987();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8bd987();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl
new file mode 100644
index 0000000..9c3f6ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8bd987();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_8bd987() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8bd987();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl
new file mode 100644
index 0000000..004cbbb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8bd987(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_8bd987(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8bd987(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8bd987(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm
new file mode 100644
index 0000000..bebc91d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8bd987 "textureNumLayers_8bd987"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba32i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8bd987 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_8bd987
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl
new file mode 100644
index 0000000..7183fb6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8bd987.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32sint, write>;
+
+fn textureNumLayers_8bd987() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8bd987();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8bd987();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8bd987();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl
new file mode 100644
index 0000000..3f42b29
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8unorm, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba8unorm, write>) -> u32
+fn textureNumLayers_8dbf23() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8dbf23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8dbf23();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4f752ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8dbf23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8dbf23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4f752ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_8dbf23() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_8dbf23();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_8dbf23();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl
new file mode 100644
index 0000000..9015e24
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_8dbf23();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba8) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_8dbf23() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_8dbf23();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl
new file mode 100644
index 0000000..8643e42
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_8dbf23(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_8dbf23(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_8dbf23(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_8dbf23(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm
new file mode 100644
index 0000000..9c3631f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_8dbf23 "textureNumLayers_8dbf23"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_8dbf23 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_8dbf23
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl
new file mode 100644
index 0000000..a64feba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/8dbf23.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8unorm, write>;
+
+fn textureNumLayers_8dbf23() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_8dbf23();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_8dbf23();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_8dbf23();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl
new file mode 100644
index 0000000..d7a18ea
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> u32
+fn textureNumLayers_9695c6() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_9695c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_9695c6();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..6ff2f32
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_9695c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_9695c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_9695c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..6ff2f32
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<uint4> arg_0 : register(u0, space1);
+
+void textureNumLayers_9695c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_9695c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_9695c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl
new file mode 100644
index 0000000..f8c145d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_9695c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
+void textureNumLayers_9695c6() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_9695c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl
new file mode 100644
index 0000000..827321c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_9695c6(texture2d_array<uint, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
+ textureNumLayers_9695c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_9695c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_9695c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..4d2ffb8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_9695c6 "textureNumLayers_9695c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_9695c6 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_9695c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..117a723
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/9695c6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
+
+fn textureNumLayers_9695c6() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_9695c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_9695c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_9695c6();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl
deleted file mode 100644
index 442d50b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16uint, write>) -> i32
-fn textureNumLayers_9700fb() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_9700fb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_9700fb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_9700fb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 63205b7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_9700fb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_9700fb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_9700fb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 63205b7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_9700fb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_9700fb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_9700fb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.glsl
deleted file mode 100644
index 24b2d5d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_9700fb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_9700fb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_9700fb() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_9700fb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.msl
deleted file mode 100644
index 1b296c7..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_9700fb(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_9700fb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_9700fb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_9700fb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.spvasm
deleted file mode 100644
index 4986494..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_9700fb "textureNumLayers_9700fb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba16ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_9700fb = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_9700fb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.wgsl
deleted file mode 100644
index d260e36..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/9700fb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16uint, write>;
-
-fn textureNumLayers_9700fb() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_9700fb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_9700fb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_9700fb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl
new file mode 100644
index 0000000..b455e68
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16float, write>) -> u32
+fn textureNumLayers_98a9cf() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_98a9cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_98a9cf();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..572767c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_98a9cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_98a9cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..572767c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_98a9cf() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_98a9cf();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_98a9cf();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl
new file mode 100644
index 0000000..b8ccb95
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_98a9cf();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_98a9cf() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_98a9cf();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl
new file mode 100644
index 0000000..b8c1954
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_98a9cf(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_98a9cf(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_98a9cf(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_98a9cf(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm
new file mode 100644
index 0000000..1908b56
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_98a9cf "textureNumLayers_98a9cf"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba16f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_98a9cf = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_98a9cf
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl
new file mode 100644
index 0000000..aa0b1f9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/98a9cf.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16float, write>;
+
+fn textureNumLayers_98a9cf() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_98a9cf();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_98a9cf();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_98a9cf();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl
deleted file mode 100644
index 634b16d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8sint, write>) -> i32
-fn textureNumLayers_a216d2() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_a216d2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_a216d2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_a216d2();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl
deleted file mode 100644
index d9cf500..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_a216d2() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_a216d2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_a216d2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl
deleted file mode 100644
index d9cf500..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_a216d2() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_a216d2();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_a216d2();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.glsl
deleted file mode 100644
index a6deec3..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_a216d2();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_a216d2();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_a216d2() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_a216d2();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.msl
deleted file mode 100644
index 427fe4f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_a216d2(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_a216d2(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_a216d2(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_a216d2(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.spvasm
deleted file mode 100644
index 2d82417..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_a216d2 "textureNumLayers_a216d2"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba8i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_a216d2 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_a216d2
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.wgsl
deleted file mode 100644
index ef09e0b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/a216d2.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8sint, write>;
-
-fn textureNumLayers_a216d2() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_a216d2();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_a216d2();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_a216d2();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl
new file mode 100644
index 0000000..9c1cbc6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureNumLayers(texture: texture_depth_2d_array) -> u32
+fn textureNumLayers_a9d3f5() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_a9d3f5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_a9d3f5();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fca4556
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLayers_a9d3f5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_a9d3f5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fca4556
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLayers_a9d3f5() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_a9d3f5();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_a9d3f5();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl
new file mode 100644
index 0000000..9e5f8bc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_a9d3f5();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLayers_a9d3f5() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_a9d3f5();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl
new file mode 100644
index 0000000..74a0acb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_a9d3f5(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLayers_a9d3f5(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_a9d3f5(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_a9d3f5(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm
new file mode 100644
index 0000000..7d3120e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_a9d3f5 "textureNumLayers_a9d3f5"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_a9d3f5 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_a9d3f5
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl
new file mode 100644
index 0000000..83afd90
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/a9d3f5.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureNumLayers_a9d3f5() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_a9d3f5();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_a9d3f5();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_a9d3f5();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl
new file mode 100644
index 0000000..7d67267
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureNumLayers(texture: texture_cube_array<u32>) -> u32
+fn textureNumLayers_c1eca9() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_c1eca9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_c1eca9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2a8173c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c1eca9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_c1eca9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2a8173c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLayers_c1eca9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_c1eca9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_c1eca9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl
new file mode 100644
index 0000000..367aaab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_c1eca9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLayers_c1eca9() {
+ uint res = uint(textureSize(arg_0_1, 0).z);
+}
+
+void compute_main() {
+ textureNumLayers_c1eca9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.msl
new file mode 100644
index 0000000..49ce989
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_c1eca9(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureNumLayers_c1eca9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_c1eca9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_c1eca9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.spvasm
new file mode 100644
index 0000000..a80fd6a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.spvasm
@@ -0,0 +1,79 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 40
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_c1eca9 "textureNumLayers_c1eca9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %v3uint = OpTypeVector %uint 3
+ %int = OpTypeInt 32 1
+ %int_0 = OpConstant %int 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %25 = OpConstantNull %uint
+ %26 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_c1eca9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %25
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySizeLod %v3uint %20 %int_0
+ %17 = OpCompositeExtract %uint %18 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %26
+ %28 = OpLabel
+ %29 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %32
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %38 = OpLabel
+ %39 = OpFunctionCall %void %textureNumLayers_c1eca9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.wgsl
new file mode 100644
index 0000000..bd0368e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/c1eca9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLayers_c1eca9() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_c1eca9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_c1eca9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_c1eca9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl
deleted file mode 100644
index b58bc74..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba32uint, write>) -> i32
-fn textureNumLayers_cd5dc8() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_cd5dc8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_cd5dc8();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index ca5a80c..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_cd5dc8() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_cd5dc8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_cd5dc8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index ca5a80c..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_cd5dc8() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_cd5dc8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_cd5dc8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.glsl
deleted file mode 100644
index 95fdcf4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_cd5dc8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_cd5dc8() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_cd5dc8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.msl
deleted file mode 100644
index bff98ca..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_cd5dc8(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_cd5dc8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_cd5dc8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_cd5dc8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.spvasm
deleted file mode 100644
index 996f85e..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_cd5dc8 "textureNumLayers_cd5dc8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_cd5dc8 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_cd5dc8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.wgsl
deleted file mode 100644
index 7fa1228..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/cd5dc8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32uint, write>;
-
-fn textureNumLayers_cd5dc8() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_cd5dc8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_cd5dc8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_cd5dc8();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl
deleted file mode 100644
index 91ac33b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32float, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32float, write>) -> i32
-fn textureNumLayers_d5b228() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_d5b228();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_d5b228();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_d5b228();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a8c82b0..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_d5b228() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_d5b228();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_d5b228();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a8c82b0..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_d5b228() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_d5b228();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_d5b228();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.glsl
deleted file mode 100644
index 0daa0a3..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_d5b228();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_d5b228();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32f) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_d5b228() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_d5b228();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.msl
deleted file mode 100644
index d2a1011..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_d5b228(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_d5b228(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_d5b228(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_d5b228(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.spvasm
deleted file mode 100644
index 08a45ee..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_d5b228 "textureNumLayers_d5b228"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 R32f
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_d5b228 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_d5b228
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.wgsl
deleted file mode 100644
index 9cf3683..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/d5b228.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32float, write>;
-
-fn textureNumLayers_d5b228() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_d5b228();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_d5b228();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_d5b228();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl
new file mode 100644
index 0000000..979ac02
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba32float, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba32float, write>) -> u32
+fn textureNumLayers_d75a0b() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_d75a0b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_d75a0b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f358a3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_d75a0b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_d75a0b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f358a3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<float4> arg_0 : register(u0, space1);
+
+void textureNumLayers_d75a0b() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_d75a0b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_d75a0b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl
new file mode 100644
index 0000000..597783b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_d75a0b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba32f) uniform highp writeonly image2DArray arg_0;
+void textureNumLayers_d75a0b() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_d75a0b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl
new file mode 100644
index 0000000..dfc443c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_d75a0b(texture2d_array<float, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
+ textureNumLayers_d75a0b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_d75a0b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_d75a0b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm
new file mode 100644
index 0000000..7a3a47f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.spvasm
@@ -0,0 +1,77 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 38
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_d75a0b "textureNumLayers_d75a0b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 2 Rgba32f
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %23 = OpConstantNull %uint
+ %24 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_d75a0b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %23
+ %20 = OpLoad %11 %arg_0
+ %18 = OpImageQuerySize %v3uint %20
+ %16 = OpCompositeExtract %uint %18 2
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %24
+ %26 = OpLabel
+ %27 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %29 = OpLabel
+ %30 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %30
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %36 = OpLabel
+ %37 = OpFunctionCall %void %textureNumLayers_d75a0b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl
new file mode 100644
index 0000000..c5e7e0e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/d75a0b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba32float, write>;
+
+fn textureNumLayers_d75a0b() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_d75a0b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_d75a0b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_d75a0b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl
new file mode 100644
index 0000000..647b9db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
+
+// fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> u32
+fn textureNumLayers_de8087() {
+ var res: u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_de8087();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_de8087();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_de8087();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4502c30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_de8087() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_de8087();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_de8087();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4502c30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+RWTexture2DArray<int4> arg_0 : register(u0, space1);
+
+void textureNumLayers_de8087() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLayers_de8087();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLayers_de8087();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl
new file mode 100644
index 0000000..6fb197a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.glsl
@@ -0,0 +1,52 @@
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+vec4 vertex_main() {
+ textureNumLayers_de8087();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+#version 310 es
+precision mediump float;
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void fragment_main() {
+ textureNumLayers_de8087();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+#version 310 es
+
+layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
+void textureNumLayers_de8087() {
+ uint res = uint(imageSize(arg_0).z);
+}
+
+void compute_main() {
+ textureNumLayers_de8087();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl
new file mode 100644
index 0000000..cd677f5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLayers_de8087(texture2d_array<int, access::write> tint_symbol_1) {
+ uint res = tint_symbol_1.get_array_size();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
+ textureNumLayers_de8087(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
+ textureNumLayers_de8087(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
+ textureNumLayers_de8087(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm
new file mode 100644
index 0000000..3065daf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.spvasm
@@ -0,0 +1,78 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 39
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLayers_de8087 "textureNumLayers_de8087"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 NonReadable
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+ %v3uint = OpTypeVector %uint 3
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %24 = OpConstantNull %uint
+ %25 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLayers_de8087 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %24
+ %21 = OpLoad %11 %arg_0
+ %19 = OpImageQuerySize %v3uint %21
+ %17 = OpCompositeExtract %uint %19 2
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %25
+ %27 = OpLabel
+ %28 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %30 = OpLabel
+ %31 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %31
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %textureNumLayers_de8087
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl
new file mode 100644
index 0000000..fdab8ff
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLayers/de8087.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
+
+fn textureNumLayers_de8087() {
+ var res : u32 = textureNumLayers(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLayers_de8087();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLayers_de8087();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLayers_de8087();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl
deleted file mode 100644
index 5de9836..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8snorm, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8snorm, write>) -> i32
-fn textureNumLayers_e31be1() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e31be1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e31be1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e31be1();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6aca3c5..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_e31be1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e31be1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e31be1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6aca3c5..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<float4> arg_0 : register(u0, space1);
-
-void textureNumLayers_e31be1() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e31be1();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e31be1();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.glsl
deleted file mode 100644
index e5e4797..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_e31be1();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_e31be1();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8_snorm) uniform highp writeonly image2DArray arg_0;
-void textureNumLayers_e31be1() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_e31be1();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.msl
deleted file mode 100644
index 3b5b47f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_e31be1(texture2d_array<float, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::write> tint_symbol_2) {
- textureNumLayers_e31be1(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_e31be1(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_e31be1(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.spvasm
deleted file mode 100644
index 192aa63..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_e31be1 "textureNumLayers_e31be1"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 2 Rgba8Snorm
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_e31be1 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_e31be1
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.wgsl
deleted file mode 100644
index c930384..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e31be1.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8snorm, write>;
-
-fn textureNumLayers_e31be1() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e31be1();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e31be1();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e31be1();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl
deleted file mode 100644
index c4a290d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureNumLayers(texture: texture_depth_2d_array) -> i32
-fn textureNumLayers_e653c0() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e653c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e653c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e653c0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 07d21c4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLayers_e653c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e653c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e653c0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 07d21c4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLayers_e653c0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_e653c0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_e653c0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.glsl
deleted file mode 100644
index c622a34..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_e653c0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void fragment_main() {
- textureNumLayers_e653c0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLayers_e653c0() {
- int res = textureSize(arg_0_1, 0).z;
-}
-
-void compute_main() {
- textureNumLayers_e653c0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.msl
deleted file mode 100644
index ade75dd..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_e653c0(depth2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureNumLayers_e653c0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_e653c0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_e653c0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.spvasm
deleted file mode 100644
index 52ed923..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_e653c0 "textureNumLayers_e653c0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
- %int_0 = OpConstant %int 0
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_e653c0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySizeLod %v3int %20 %int_0
- %16 = OpCompositeExtract %int %18 2
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_e653c0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.wgsl
deleted file mode 100644
index 601ce1f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/e653c0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureNumLayers_e653c0() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_e653c0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_e653c0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_e653c0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl
deleted file mode 100644
index f47b3a2..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<r32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<r32uint, write>) -> i32
-fn textureNumLayers_ee942f() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ee942f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ee942f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ee942f();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6b49235..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ee942f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ee942f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ee942f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6b49235..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ee942f() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ee942f();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ee942f();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.glsl
deleted file mode 100644
index f5996d3..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_ee942f();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_ee942f();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(r32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ee942f() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_ee942f();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.msl
deleted file mode 100644
index d8f0821..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_ee942f(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_ee942f(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_ee942f(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_ee942f(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.spvasm
deleted file mode 100644
index e0a11d9..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_ee942f "textureNumLayers_ee942f"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 R32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_ee942f = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_ee942f
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.wgsl
deleted file mode 100644
index c6d26dd..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ee942f.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<r32uint, write>;
-
-fn textureNumLayers_ee942f() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ee942f();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ee942f();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ee942f();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl
deleted file mode 100644
index 97533d2..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba16sint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba16sint, write>) -> i32
-fn textureNumLayers_f33005() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_f33005();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_f33005();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_f33005();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4f341b1..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_f33005() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_f33005();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_f33005();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4f341b1..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<int4> arg_0 : register(u0, space1);
-
-void textureNumLayers_f33005() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_f33005();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_f33005();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.glsl
deleted file mode 100644
index 541d029..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_f33005();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_f33005();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba16i) uniform highp writeonly iimage2DArray arg_0;
-void textureNumLayers_f33005() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_f33005();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.msl
deleted file mode 100644
index d415304..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_f33005(texture2d_array<int, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::write> tint_symbol_2) {
- textureNumLayers_f33005(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_f33005(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_f33005(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.spvasm
deleted file mode 100644
index a6a6224..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.spvasm
+++ /dev/null
@@ -1,77 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 38
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_f33005 "textureNumLayers_f33005"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 2 Rgba16i
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %23 = OpConstantNull %int
- %24 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_f33005 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %23
- %20 = OpLoad %11 %arg_0
- %18 = OpImageQuerySize %v3int %20
- %17 = OpCompositeExtract %int %18 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %24
- %26 = OpLabel
- %27 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %29 = OpLabel
- %30 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %30
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %33 = OpLabel
- %34 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %36 = OpLabel
- %37 = OpFunctionCall %void %textureNumLayers_f33005
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.wgsl
deleted file mode 100644
index 8d7eee4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/f33005.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba16sint, write>;
-
-fn textureNumLayers_f33005() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_f33005();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_f33005();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_f33005();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl
deleted file mode 100644
index eafec6d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rg32uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rg32uint, write>) -> i32
-fn textureNumLayers_fcec98() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_fcec98();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_fcec98();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_fcec98();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 5ded29d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_fcec98() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_fcec98();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_fcec98();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 5ded29d..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_fcec98() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_fcec98();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_fcec98();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.glsl
deleted file mode 100644
index bfaa76f..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_fcec98();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_fcec98();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'image load-store format' : not supported with this profile: es
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-layout(rg32ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_fcec98() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_fcec98();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'image load-store format' : not supported with this profile: es
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.msl
deleted file mode 100644
index 6233574..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_fcec98(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_fcec98(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_fcec98(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_fcec98(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.spvasm
deleted file mode 100644
index b33d57b..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.spvasm
+++ /dev/null
@@ -1,79 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability StorageImageExtendedFormats
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_fcec98 "textureNumLayers_fcec98"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rg32ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_fcec98 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_fcec98
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.wgsl
deleted file mode 100644
index 1c1e179..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/fcec98.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rg32uint, write>;
-
-fn textureNumLayers_fcec98() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_fcec98();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_fcec98();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_fcec98();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl
deleted file mode 100644
index 1c14665..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_storage_2d_array<rgba8uint, write>;
-
-// fn textureNumLayers(texture: texture_storage_2d_array<rgba8uint, write>) -> i32
-fn textureNumLayers_ff5e89() {
- var res: i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ff5e89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ff5e89();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4ff6d2c..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ff5e89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ff5e89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ff5e89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4ff6d2c..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-RWTexture2DArray<uint4> arg_0 : register(u0, space1);
-
-void textureNumLayers_ff5e89() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLayers_ff5e89();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLayers_ff5e89();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.glsl
deleted file mode 100644
index 76ca5cc..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.glsl
+++ /dev/null
@@ -1,52 +0,0 @@
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-vec4 vertex_main() {
- textureNumLayers_ff5e89();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-#version 310 es
-precision mediump float;
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-void fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-void main() {
- fragment_main();
- return;
-}
-#version 310 es
-
-layout(rgba8ui) uniform highp writeonly uimage2DArray arg_0;
-void textureNumLayers_ff5e89() {
- int res = imageSize(arg_0).z;
-}
-
-void compute_main() {
- textureNumLayers_ff5e89();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.msl
deleted file mode 100644
index 2fb0509..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLayers_ff5e89(texture2d_array<uint, access::write> tint_symbol_1) {
- int res = int(tint_symbol_1.get_array_size());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::write> tint_symbol_2) {
- textureNumLayers_ff5e89(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::write> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::write> tint_symbol_4 [[texture(0)]]) {
- textureNumLayers_ff5e89(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::write> tint_symbol_5 [[texture(0)]]) {
- textureNumLayers_ff5e89(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.spvasm
deleted file mode 100644
index ae6e277..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.spvasm
+++ /dev/null
@@ -1,78 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 39
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLayers_ff5e89 "textureNumLayers_ff5e89"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 NonReadable
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 2 Rgba8ui
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
- %v3int = OpTypeVector %int 3
-%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpConstantNull %int
- %25 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLayers_ff5e89 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %24
- %21 = OpLoad %11 %arg_0
- %19 = OpImageQuerySize %v3int %21
- %17 = OpCompositeExtract %int %19 2
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %25
- %27 = OpLabel
- %28 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %30 = OpLabel
- %31 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %31
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %37 = OpLabel
- %38 = OpFunctionCall %void %textureNumLayers_ff5e89
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.wgsl
deleted file mode 100644
index e7b51b4..0000000
--- a/test/tint/builtins/gen/var/textureNumLayers/ff5e89.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_storage_2d_array<rgba8uint, write>;
-
-fn textureNumLayers_ff5e89() {
- var res : i32 = textureNumLayers(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLayers_ff5e89();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLayers_ff5e89();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLayers_ff5e89();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl
deleted file mode 100644
index adec74f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube;
-
-// fn textureNumLevels(texture: texture_depth_cube) -> i32
-fn textureNumLevels_076cb5() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_076cb5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_076cb5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_076cb5();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 7688db9..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureNumLevels_076cb5() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_076cb5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_076cb5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 7688db9..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube arg_0 : register(t0, space1);
-
-void textureNumLevels_076cb5() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_076cb5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_076cb5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.glsl
deleted file mode 100644
index 6b93674..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_076cb5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_076cb5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_076cb5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_076cb5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.msl
deleted file mode 100644
index db09bf4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_076cb5(depthcube<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
- textureNumLevels_076cb5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_076cb5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_076cb5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.spvasm
deleted file mode 100644
index 7b36c19..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_076cb5 "textureNumLevels_076cb5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_076cb5 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_076cb5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.wgsl
deleted file mode 100644
index 0470c75..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/076cb5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube;
-
-fn textureNumLevels_076cb5() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_076cb5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_076cb5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_076cb5();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl
deleted file mode 100644
index 8ef73a7..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<i32>;
-
-// fn textureNumLevels(texture: texture_cube<i32>) -> i32
-fn textureNumLevels_080d95() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_080d95();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_080d95();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_080d95();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 633e7be..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_080d95() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_080d95();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_080d95();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 633e7be..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_080d95() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_080d95();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_080d95();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.glsl
deleted file mode 100644
index 367bb7a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_080d95();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_080d95();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCube arg_0_1;
-void textureNumLevels_080d95() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_080d95();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.msl
deleted file mode 100644
index c592ea2..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_080d95(texturecube<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
- textureNumLevels_080d95(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_080d95(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_080d95(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.spvasm
deleted file mode 100644
index bcbd3c7..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_080d95 "textureNumLevels_080d95"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_080d95 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_080d95
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.wgsl
deleted file mode 100644
index f6f058f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/080d95.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<i32>;
-
-fn textureNumLevels_080d95() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_080d95();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_080d95();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_080d95();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl
deleted file mode 100644
index f9f4d80..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<u32>;
-
-// fn textureNumLevels(texture: texture_2d<u32>) -> i32
-fn textureNumLevels_09ddd0() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_09ddd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_09ddd0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index fa2c673..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_09ddd0() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_09ddd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_09ddd0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index fa2c673..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_09ddd0() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_09ddd0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_09ddd0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.glsl
deleted file mode 100644
index 0691d9b..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_09ddd0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2D arg_0_1;
-void textureNumLevels_09ddd0() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_09ddd0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.msl
deleted file mode 100644
index 43e4904..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_09ddd0(texture2d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_09ddd0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_09ddd0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_09ddd0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.spvasm
deleted file mode 100644
index 13e73f5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_09ddd0 "textureNumLevels_09ddd0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_09ddd0 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_09ddd0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.wgsl
deleted file mode 100644
index 4cebcab..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/09ddd0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<u32>;
-
-fn textureNumLevels_09ddd0() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_09ddd0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_09ddd0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_09ddd0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl
deleted file mode 100644
index 61e6a3f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
-
-// fn textureNumLevels(texture: texture_2d_array<f32>) -> i32
-fn textureNumLevels_105988() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_105988();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_105988();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_105988();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 608355f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_105988() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_105988();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_105988();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_105988();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 608355f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_105988() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_105988();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_105988();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_105988();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.glsl
deleted file mode 100644
index 90e28da..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_105988();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_105988();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_105988() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_105988();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.msl
deleted file mode 100644
index c27305e..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_105988(texture2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_105988(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_105988(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_105988(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.spvasm
deleted file mode 100644
index fd629e8..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_105988 "textureNumLevels_105988"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_105988 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_105988
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_105988
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_105988
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.wgsl
deleted file mode 100644
index 8eb140d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/105988.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
-
-fn textureNumLevels_105988() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_105988();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_105988();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_105988();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl
new file mode 100644
index 0000000..6068edc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
+
+// fn textureNumLevels(texture: texture_2d_array<u32>) -> u32
+fn textureNumLevels_181090() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_181090();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_181090();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_181090();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..fa19226
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_181090() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_181090();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_181090();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..fa19226
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_181090() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_181090();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_181090();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.glsl
new file mode 100644
index 0000000..c7664b0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_181090();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_181090();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2DArray arg_0_1;
+void textureNumLevels_181090() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_181090();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl
new file mode 100644
index 0000000..b685d58
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_181090(texture2d_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_181090(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_181090(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_181090(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm
new file mode 100644
index 0000000..b2fba9b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_181090 "textureNumLevels_181090"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_181090 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_181090
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl
new file mode 100644
index 0000000..cca5c8c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/181090.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
+
+fn textureNumLevels_181090() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_181090();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_181090();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_181090();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl
new file mode 100644
index 0000000..4aaac8f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<i32>;
+
+// fn textureNumLevels(texture: texture_2d<i32>) -> u32
+fn textureNumLevels_1a3fa9() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a3fa9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a3fa9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b613075
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a3fa9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a3fa9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b613075
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a3fa9() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a3fa9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a3fa9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.glsl
new file mode 100644
index 0000000..fbcdb5a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_1a3fa9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2D arg_0_1;
+void textureNumLevels_1a3fa9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_1a3fa9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl
new file mode 100644
index 0000000..a5903ae
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_1a3fa9(texture2d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_1a3fa9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_1a3fa9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_1a3fa9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm
new file mode 100644
index 0000000..21e699e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_1a3fa9 "textureNumLevels_1a3fa9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_1a3fa9 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_1a3fa9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl
new file mode 100644
index 0000000..f5ad42c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a3fa9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<i32>;
+
+fn textureNumLevels_1a3fa9() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a3fa9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a3fa9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a3fa9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl
new file mode 100644
index 0000000..f08517f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<u32>;
+
+// fn textureNumLevels(texture: texture_1d<u32>) -> u32
+fn textureNumLevels_1a7fc3() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a7fc3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a7fc3();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..72945be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a7fc3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a7fc3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..72945be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_1a7fc3() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_1a7fc3();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_1a7fc3();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.glsl
new file mode 100644
index 0000000..a0dc02a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_1a7fc3();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler1D arg_0_1;
+void textureNumLevels_1a7fc3() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_1a7fc3();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl
new file mode 100644
index 0000000..7acfb61
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_1a7fc3(texture1d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_1a7fc3(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_1a7fc3(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_1a7fc3(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm
new file mode 100644
index 0000000..0a2fd38
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_1a7fc3 "textureNumLevels_1a7fc3"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_1a7fc3 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_1a7fc3
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl
new file mode 100644
index 0000000..d092a9f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/1a7fc3.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<u32>;
+
+fn textureNumLevels_1a7fc3() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_1a7fc3();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_1a7fc3();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_1a7fc3();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl
deleted file mode 100644
index ae28bc6..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<u32>;
-
-// fn textureNumLevels(texture: texture_1d<u32>) -> i32
-fn textureNumLevels_1e6f3b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_1e6f3b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_1e6f3b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 938309a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_1e6f3b() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_1e6f3b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_1e6f3b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 938309a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_1e6f3b() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_1e6f3b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_1e6f3b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.glsl
deleted file mode 100644
index 50f6f13..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_1e6f3b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler1D arg_0_1;
-void textureNumLevels_1e6f3b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_1e6f3b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.msl
deleted file mode 100644
index 00356f0..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_1e6f3b(texture1d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_1e6f3b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_1e6f3b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_1e6f3b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.spvasm
deleted file mode 100644
index 80c21ea..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_1e6f3b "textureNumLevels_1e6f3b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_1e6f3b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_1e6f3b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.wgsl
deleted file mode 100644
index 58a28d7..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/1e6f3b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<u32>;
-
-fn textureNumLevels_1e6f3b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_1e6f3b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_1e6f3b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_1e6f3b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl
new file mode 100644
index 0000000..6086ab5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<i32>;
+
+// fn textureNumLevels(texture: texture_cube<i32>) -> u32
+fn textureNumLevels_2267d8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2267d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2267d8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..0ada818
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2267d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2267d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2267d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..0ada818
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2267d8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2267d8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2267d8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.glsl
new file mode 100644
index 0000000..8ba1aa1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2267d8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCube arg_0_1;
+void textureNumLevels_2267d8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2267d8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl
new file mode 100644
index 0000000..082aa8c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2267d8(texturecube<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<int, access::sample> tint_symbol_2) {
+ textureNumLevels_2267d8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2267d8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2267d8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm
new file mode 100644
index 0000000..0f18866
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2267d8 "textureNumLevels_2267d8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2267d8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_2267d8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl
new file mode 100644
index 0000000..5714150
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2267d8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<i32>;
+
+fn textureNumLevels_2267d8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2267d8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2267d8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2267d8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl
deleted file mode 100644
index 046b0a8..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<i32>;
-
-// fn textureNumLevels(texture: texture_2d<i32>) -> i32
-fn textureNumLevels_23f750() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_23f750();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_23f750();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_23f750();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 230c77c..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_23f750() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_23f750();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_23f750();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 230c77c..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_23f750() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_23f750();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_23f750();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.glsl
deleted file mode 100644
index 8b96498..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_23f750();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_23f750();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2D arg_0_1;
-void textureNumLevels_23f750() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_23f750();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.msl
deleted file mode 100644
index 571d0a4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_23f750(texture2d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<int, access::sample> tint_symbol_2) {
- textureNumLevels_23f750(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_23f750(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_23f750(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.spvasm
deleted file mode 100644
index 8dd3517..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_23f750 "textureNumLevels_23f750"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_23f750 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_23f750
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.wgsl
deleted file mode 100644
index 1ce13f7..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/23f750.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<i32>;
-
-fn textureNumLevels_23f750() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_23f750();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_23f750();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_23f750();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl
new file mode 100644
index 0000000..1a638e9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<f32>;
+
+// fn textureNumLevels(texture: texture_2d<f32>) -> u32
+fn textureNumLevels_24b2c6() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_24b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_24b2c6();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..47607cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_24b2c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_24b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..47607cf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_24b2c6() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_24b2c6();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_24b2c6();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.glsl
new file mode 100644
index 0000000..a355d45
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_24b2c6();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_24b2c6() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_24b2c6();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl
new file mode 100644
index 0000000..a532f60
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_24b2c6(texture2d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_24b2c6(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_24b2c6(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_24b2c6(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm
new file mode 100644
index 0000000..5e5b33c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_24b2c6 "textureNumLevels_24b2c6"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_24b2c6 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_24b2c6
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl
new file mode 100644
index 0000000..9ffcb78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/24b2c6.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<f32>;
+
+fn textureNumLevels_24b2c6() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_24b2c6();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_24b2c6();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_24b2c6();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl
new file mode 100644
index 0000000..07b2473
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube_array;
+
+// fn textureNumLevels(texture: texture_depth_cube_array) -> u32
+fn textureNumLevels_2bea6c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2bea6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2bea6c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..62d1125
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLevels_2bea6c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2bea6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..62d1125
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray arg_0 : register(t0, space1);
+
+void textureNumLevels_2bea6c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2bea6c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2bea6c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.glsl
new file mode 100644
index 0000000..2cc5e70
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2bea6c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_2bea6c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2bea6c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl
new file mode 100644
index 0000000..480e5f0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2bea6c(depthcube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_2bea6c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2bea6c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2bea6c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm
new file mode 100644
index 0000000..e4cf270
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2bea6c "textureNumLevels_2bea6c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2bea6c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_2bea6c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl
new file mode 100644
index 0000000..b37c0d6
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2bea6c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
+
+fn textureNumLevels_2bea6c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2bea6c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2bea6c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2bea6c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl
deleted file mode 100644
index 98cf2c6..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_cube_array;
-
-// fn textureNumLevels(texture: texture_depth_cube_array) -> i32
-fn textureNumLevels_2c3575() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_2c3575();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_2c3575();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_2c3575();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 969b67a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLevels_2c3575() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_2c3575();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_2c3575();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 969b67a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray arg_0 : register(t0, space1);
-
-void textureNumLevels_2c3575() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_2c3575();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_2c3575();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.glsl
deleted file mode 100644
index 2de59fc..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_2c3575();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_2c3575();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_2c3575() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_2c3575();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.msl
deleted file mode 100644
index 8f7ed02..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_2c3575(depthcube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depthcube_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_2c3575(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depthcube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depthcube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_2c3575(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depthcube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_2c3575(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.spvasm
deleted file mode 100644
index ef03d8a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_2c3575 "textureNumLevels_2c3575"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_2c3575 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_2c3575
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.wgsl
deleted file mode 100644
index 8e01960..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/2c3575.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_cube_array;
-
-fn textureNumLevels_2c3575() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_2c3575();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_2c3575();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_2c3575();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl
new file mode 100644
index 0000000..ddc2d13
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<f32>;
+
+// fn textureNumLevels(texture: texture_cube<f32>) -> u32
+fn textureNumLevels_2df1ab() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2df1ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2df1ab();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..10020ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2df1ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2df1ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..10020ec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_2df1ab() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_2df1ab();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_2df1ab();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.glsl
new file mode 100644
index 0000000..980291b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_2df1ab();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_2df1ab() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_2df1ab();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl
new file mode 100644
index 0000000..ecf68db
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_2df1ab(texturecube<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
+ textureNumLevels_2df1ab(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_2df1ab(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_2df1ab(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm
new file mode 100644
index 0000000..edaef1a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_2df1ab "textureNumLevels_2df1ab"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_2df1ab = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_2df1ab
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl
new file mode 100644
index 0000000..769cb30
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/2df1ab.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<f32>;
+
+fn textureNumLevels_2df1ab() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_2df1ab();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_2df1ab();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_2df1ab();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl
deleted file mode 100644
index 9773aa4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<i32>;
-
-// fn textureNumLevels(texture: texture_1d<i32>) -> i32
-fn textureNumLevels_32a0ae() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_32a0ae();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_32a0ae();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 8caa756..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_32a0ae() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_32a0ae();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_32a0ae();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 8caa756..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_32a0ae() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_32a0ae();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_32a0ae();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.glsl
deleted file mode 100644
index b0cdc31..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_32a0ae();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler1D arg_0_1;
-void textureNumLevels_32a0ae() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_32a0ae();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.msl
deleted file mode 100644
index 11c0362..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_32a0ae(texture1d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
- textureNumLevels_32a0ae(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_32a0ae(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_32a0ae(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.spvasm
deleted file mode 100644
index 283d160..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_32a0ae "textureNumLevels_32a0ae"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_32a0ae = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_32a0ae
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.wgsl
deleted file mode 100644
index 13377ce..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/32a0ae.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<i32>;
-
-fn textureNumLevels_32a0ae() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_32a0ae();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_32a0ae();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_32a0ae();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl
new file mode 100644
index 0000000..9da74a3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<f32>;
+
+// fn textureNumLevels(texture: texture_2d_array<f32>) -> u32
+fn textureNumLevels_46dbd8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_46dbd8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_46dbd8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..496e96a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_46dbd8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_46dbd8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..496e96a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_46dbd8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_46dbd8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_46dbd8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.glsl
new file mode 100644
index 0000000..bf08402
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_46dbd8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_46dbd8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_46dbd8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl
new file mode 100644
index 0000000..e8b2b34
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_46dbd8(texture2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_46dbd8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_46dbd8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_46dbd8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ddaa69f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_46dbd8 "textureNumLevels_46dbd8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_46dbd8 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_46dbd8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl
new file mode 100644
index 0000000..c2e380d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/46dbd8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<f32>;
+
+fn textureNumLevels_46dbd8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_46dbd8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_46dbd8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_46dbd8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl
deleted file mode 100644
index d92d07f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<u32>;
-
-// fn textureNumLevels(texture: texture_2d_array<u32>) -> i32
-fn textureNumLevels_5101cf() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_5101cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_5101cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_5101cf();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index f638579..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_5101cf() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_5101cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_5101cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index f638579..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_5101cf() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_5101cf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_5101cf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.glsl
deleted file mode 100644
index e372765..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_5101cf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_5101cf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2DArray arg_0_1;
-void textureNumLevels_5101cf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_5101cf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.msl
deleted file mode 100644
index 4a17faa..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_5101cf(texture2d_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<uint, access::sample> tint_symbol_2) {
- textureNumLevels_5101cf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_5101cf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_5101cf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.spvasm
deleted file mode 100644
index 321f409..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_5101cf "textureNumLevels_5101cf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_5101cf = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_5101cf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.wgsl
deleted file mode 100644
index 3425bb2..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/5101cf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<u32>;
-
-fn textureNumLevels_5101cf() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_5101cf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_5101cf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_5101cf();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl
deleted file mode 100644
index ec4aa99..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_1d<f32>;
-
-// fn textureNumLevels(texture: texture_1d<f32>) -> i32
-fn textureNumLevels_51b5bb() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_51b5bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_51b5bb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index e41c4df..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_51b5bb() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_51b5bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_51b5bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index e41c4df..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture1D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_51b5bb() {
- int2 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
- int res = tint_tmp.y;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_51b5bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_51b5bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.glsl
deleted file mode 100644
index 8969352..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_51b5bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'sampler1D' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler1D arg_0_1;
-void textureNumLevels_51b5bb() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_51b5bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'sampler1D' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.msl
deleted file mode 100644
index 7acc809..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_51b5bb(texture1d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
- textureNumLevels_51b5bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_51b5bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_51b5bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.spvasm
deleted file mode 100644
index 2fa2c76..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability Sampled1D
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_51b5bb "textureNumLevels_51b5bb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_51b5bb = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_51b5bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.wgsl
deleted file mode 100644
index 71883b0..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/51b5bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_1d<f32>;
-
-fn textureNumLevels_51b5bb() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_51b5bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_51b5bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_51b5bb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl
new file mode 100644
index 0000000..3de5217
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<u32>;
+
+// fn textureNumLevels(texture: texture_3d<u32>) -> u32
+fn textureNumLevels_60d9b8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_60d9b8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_60d9b8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..354f39f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_60d9b8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_60d9b8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..354f39f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_60d9b8() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_60d9b8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_60d9b8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.glsl
new file mode 100644
index 0000000..4709283
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_60d9b8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler3D arg_0_1;
+void textureNumLevels_60d9b8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_60d9b8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl
new file mode 100644
index 0000000..663fb4b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_60d9b8(texture3d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_60d9b8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_60d9b8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_60d9b8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm
new file mode 100644
index 0000000..3aed187
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_60d9b8 "textureNumLevels_60d9b8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_60d9b8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_60d9b8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl
new file mode 100644
index 0000000..70615e2
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/60d9b8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<u32>;
+
+fn textureNumLevels_60d9b8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_60d9b8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_60d9b8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_60d9b8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl
deleted file mode 100644
index 5c1e1a3..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<f32>;
-
-// fn textureNumLevels(texture: texture_cube<f32>) -> i32
-fn textureNumLevels_897aaf() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_897aaf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_897aaf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_897aaf();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 1dc79b1..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_897aaf() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_897aaf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_897aaf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 1dc79b1..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_897aaf() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_897aaf();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_897aaf();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.glsl
deleted file mode 100644
index f7d707e..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_897aaf();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_897aaf();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCube arg_0_1;
-void textureNumLevels_897aaf() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_897aaf();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.msl
deleted file mode 100644
index 5f6ffc4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_897aaf(texturecube<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<float, access::sample> tint_symbol_2) {
- textureNumLevels_897aaf(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_897aaf(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_897aaf(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.spvasm
deleted file mode 100644
index 2daa6e8..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_897aaf "textureNumLevels_897aaf"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_897aaf = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_897aaf
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.wgsl
deleted file mode 100644
index 473da66..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/897aaf.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<f32>;
-
-fn textureNumLevels_897aaf() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_897aaf();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_897aaf();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_897aaf();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl
new file mode 100644
index 0000000..178aec9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
+
+// fn textureNumLevels(texture: texture_cube_array<i32>) -> u32
+fn textureNumLevels_903920() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_903920();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_903920();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_903920();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..c70af53
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_903920() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_903920();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_903920();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..c70af53
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_903920() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_903920();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_903920();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.glsl
new file mode 100644
index 0000000..337fd1f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_903920();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_903920();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isamplerCubeArray arg_0_1;
+void textureNumLevels_903920() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_903920();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl
new file mode 100644
index 0000000..883fee7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_903920(texturecube_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
+ textureNumLevels_903920(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_903920(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_903920(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm
new file mode 100644
index 0000000..ac2e7d7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_903920 "textureNumLevels_903920"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_903920 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_903920
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl
new file mode 100644
index 0000000..b924f23
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/903920.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
+
+fn textureNumLevels_903920() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_903920();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_903920();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_903920();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl
new file mode 100644
index 0000000..410ef17
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<i32>;
+
+// fn textureNumLevels(texture: texture_3d<i32>) -> u32
+fn textureNumLevels_9a1a65() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_9a1a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_9a1a65();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9c9b0cd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_9a1a65() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_9a1a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9c9b0cd
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_9a1a65() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_9a1a65();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_9a1a65();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.glsl
new file mode 100644
index 0000000..5f05e9a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_9a1a65();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler3D arg_0_1;
+void textureNumLevels_9a1a65() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_9a1a65();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl
new file mode 100644
index 0000000..548d2fa
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_9a1a65(texture3d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_9a1a65(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_9a1a65(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_9a1a65(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm
new file mode 100644
index 0000000..c308aff
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_9a1a65 "textureNumLevels_9a1a65"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_9a1a65 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_9a1a65
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl
new file mode 100644
index 0000000..e6d5452
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/9a1a65.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<i32>;
+
+fn textureNumLevels_9a1a65() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_9a1a65();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_9a1a65();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_9a1a65();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl
deleted file mode 100644
index a297fa0..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<i32>;
-
-// fn textureNumLevels(texture: texture_3d<i32>) -> i32
-fn textureNumLevels_9da7a5() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_9da7a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_9da7a5();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 621c547..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_9da7a5() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_9da7a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_9da7a5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 621c547..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_9da7a5() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_9da7a5();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_9da7a5();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.glsl
deleted file mode 100644
index 83706c6..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_9da7a5();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler3D arg_0_1;
-void textureNumLevels_9da7a5() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_9da7a5();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.msl
deleted file mode 100644
index f813901..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_9da7a5(texture3d<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<int, access::sample> tint_symbol_2) {
- textureNumLevels_9da7a5(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_9da7a5(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_9da7a5(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.spvasm
deleted file mode 100644
index 522fe68..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_9da7a5 "textureNumLevels_9da7a5"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_9da7a5 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_9da7a5
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.wgsl
deleted file mode 100644
index 13135d5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/9da7a5.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<i32>;
-
-fn textureNumLevels_9da7a5() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_9da7a5();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_9da7a5();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_9da7a5();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl
deleted file mode 100644
index 2d2b3e9..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<i32>;
-
-// fn textureNumLevels(texture: texture_cube_array<i32>) -> i32
-fn textureNumLevels_a91c03() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_a91c03();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_a91c03();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_a91c03();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 97c379d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_a91c03() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_a91c03();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_a91c03();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 97c379d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_a91c03() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_a91c03();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_a91c03();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.glsl
deleted file mode 100644
index 684bc1b..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_a91c03();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_a91c03();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isamplerCubeArray arg_0_1;
-void textureNumLevels_a91c03() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_a91c03();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'isamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.msl
deleted file mode 100644
index 4a151f0..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_a91c03(texturecube_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<int, access::sample> tint_symbol_2) {
- textureNumLevels_a91c03(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_a91c03(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_a91c03(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.spvasm
deleted file mode 100644
index ba04989..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_a91c03 "textureNumLevels_a91c03"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_a91c03 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_a91c03
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.wgsl
deleted file mode 100644
index 69e569b..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/a91c03.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<i32>;
-
-fn textureNumLevels_a91c03() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_a91c03();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_a91c03();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_a91c03();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl
new file mode 100644
index 0000000..19188f3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
+
+// fn textureNumLevels(texture: texture_2d_array<i32>) -> u32
+fn textureNumLevels_adc783() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_adc783();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_adc783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_adc783();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..2ec43ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_adc783() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_adc783();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_adc783();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..2ec43ed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_adc783() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_adc783();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_adc783();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.glsl
new file mode 100644
index 0000000..2eab57c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_adc783();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_adc783();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2DArray arg_0_1;
+void textureNumLevels_adc783() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_adc783();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl
new file mode 100644
index 0000000..47f6910
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_adc783(texture2d_array<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
+ textureNumLevels_adc783(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_adc783(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_adc783(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm
new file mode 100644
index 0000000..30e6a8c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_adc783 "textureNumLevels_adc783"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_adc783 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_adc783
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl
new file mode 100644
index 0000000..b9595bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/adc783.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
+
+fn textureNumLevels_adc783() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_adc783();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_adc783();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_adc783();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl
new file mode 100644
index 0000000..f279f4d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d_array;
+
+// fn textureNumLevels(texture: texture_depth_2d_array) -> u32
+fn textureNumLevels_ae911c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ae911c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ae911c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..f17da78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLevels_ae911c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ae911c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ae911c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..f17da78
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DArray arg_0 : register(t0, space1);
+
+void textureNumLevels_ae911c() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ae911c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ae911c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.glsl
new file mode 100644
index 0000000..93d9256
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_ae911c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DArray arg_0_1;
+void textureNumLevels_ae911c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_ae911c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl
new file mode 100644
index 0000000..24d1b4a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_ae911c(depth2d_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_ae911c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_ae911c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_ae911c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm
new file mode 100644
index 0000000..c50b3b7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_ae911c "textureNumLevels_ae911c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_ae911c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_ae911c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl
new file mode 100644
index 0000000..de4db0c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ae911c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
+
+fn textureNumLevels_ae911c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ae911c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ae911c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ae911c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl
deleted file mode 100644
index 3f14e55..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
-
-// fn textureNumLevels(texture: texture_cube_array<f32>) -> i32
-fn textureNumLevels_aee7c8() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_aee7c8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_aee7c8();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6511a2d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_aee7c8() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_aee7c8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_aee7c8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6511a2d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_aee7c8() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_aee7c8();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_aee7c8();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.glsl
deleted file mode 100644
index 6fbe762..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_aee7c8();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'samplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp samplerCubeArray arg_0_1;
-void textureNumLevels_aee7c8() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_aee7c8();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'samplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.msl
deleted file mode 100644
index a4627cd..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_aee7c8(texturecube_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_aee7c8(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_aee7c8(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_aee7c8(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.spvasm
deleted file mode 100644
index d5f9d13..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_aee7c8 "textureNumLevels_aee7c8"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_aee7c8 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_aee7c8
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.wgsl
deleted file mode 100644
index a9336a0..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/aee7c8.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
-
-fn textureNumLevels_aee7c8() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_aee7c8();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_aee7c8();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_aee7c8();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl
deleted file mode 100644
index 9f8cbc5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d;
-
-// fn textureNumLevels(texture: texture_depth_2d) -> i32
-fn textureNumLevels_b1b12b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b1b12b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b1b12b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index cd908dc..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureNumLevels_b1b12b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b1b12b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b1b12b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index cd908dc..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D arg_0 : register(t0, space1);
-
-void textureNumLevels_b1b12b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b1b12b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b1b12b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.glsl
deleted file mode 100644
index 2a2119a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_b1b12b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_b1b12b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_b1b12b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.msl
deleted file mode 100644
index cdda66a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_b1b12b(depth2d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
- textureNumLevels_b1b12b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_b1b12b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_b1b12b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.spvasm
deleted file mode 100644
index dcd4a66..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_b1b12b "textureNumLevels_b1b12b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_b1b12b = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_b1b12b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.wgsl
deleted file mode 100644
index cfb7e4b..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b1b12b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d;
-
-fn textureNumLevels_b1b12b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b1b12b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b1b12b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b1b12b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl
deleted file mode 100644
index 978bbde..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<u32>;
-
-// fn textureNumLevels(texture: texture_3d<u32>) -> i32
-fn textureNumLevels_b4f5ea() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b4f5ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b4f5ea();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 92162ad..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_b4f5ea() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b4f5ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b4f5ea();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 92162ad..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_b4f5ea() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_b4f5ea();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_b4f5ea();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.glsl
deleted file mode 100644
index a857a8a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_b4f5ea();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler3D arg_0_1;
-void textureNumLevels_b4f5ea() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_b4f5ea();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.msl
deleted file mode 100644
index 8c251ea..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_b4f5ea(texture3d<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<uint, access::sample> tint_symbol_2) {
- textureNumLevels_b4f5ea(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_b4f5ea(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_b4f5ea(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.spvasm
deleted file mode 100644
index 6508bca..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_b4f5ea "textureNumLevels_b4f5ea"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_b4f5ea = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_b4f5ea
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.wgsl
deleted file mode 100644
index d1f829a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/b4f5ea.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<u32>;
-
-fn textureNumLevels_b4f5ea() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_b4f5ea();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_b4f5ea();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_b4f5ea();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl
new file mode 100644
index 0000000..c2befb8
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube<u32>;
+
+// fn textureNumLevels(texture: texture_cube<u32>) -> u32
+fn textureNumLevels_c386c8() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c386c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c386c8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..09ec1bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c386c8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c386c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c386c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..09ec1bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c386c8() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c386c8();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c386c8();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.glsl
new file mode 100644
index 0000000..f5f25b1
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c386c8();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCube arg_0_1;
+void textureNumLevels_c386c8() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c386c8();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl
new file mode 100644
index 0000000..0aa6d50
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c386c8(texturecube<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_c386c8(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c386c8(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c386c8(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm
new file mode 100644
index 0000000..ae0b33e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c386c8 "textureNumLevels_c386c8"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c386c8 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c386c8
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl
new file mode 100644
index 0000000..a5df507
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c386c8.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube<u32>;
+
+fn textureNumLevels_c386c8() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c386c8();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c386c8();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c386c8();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl
new file mode 100644
index 0000000..81e95be
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<f32>;
+
+// fn textureNumLevels(texture: texture_1d<f32>) -> u32
+fn textureNumLevels_c399f9() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c399f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c399f9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..b0e7a2c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c399f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c399f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c399f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..b0e7a2c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_c399f9() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c399f9();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c399f9();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.glsl
new file mode 100644
index 0000000..91caecf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c399f9();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'sampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler1D arg_0_1;
+void textureNumLevels_c399f9() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c399f9();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'sampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl
new file mode 100644
index 0000000..1b81eda
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c399f9(texture1d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_c399f9(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c399f9(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c399f9(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm
new file mode 100644
index 0000000..ad86c06
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c399f9 "textureNumLevels_c399f9"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c399f9 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c399f9
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl
new file mode 100644
index 0000000..b3bd844
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c399f9.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<f32>;
+
+fn textureNumLevels_c399f9() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c399f9();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c399f9();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c399f9();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl
new file mode 100644
index 0000000..814ecdf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_cube;
+
+// fn textureNumLevels(texture: texture_depth_cube) -> u32
+fn textureNumLevels_c8c25c() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c8c25c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c8c25c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..82cd2ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureNumLevels_c8c25c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c8c25c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..82cd2ba
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCube arg_0 : register(t0, space1);
+
+void textureNumLevels_c8c25c() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_c8c25c();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_c8c25c();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.glsl
new file mode 100644
index 0000000..a2e9ed3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_c8c25c();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCube arg_0_1;
+void textureNumLevels_c8c25c() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_c8c25c();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl
new file mode 100644
index 0000000..3373867
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_c8c25c(depthcube<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depthcube<float, access::sample> tint_symbol_2) {
+ textureNumLevels_c8c25c(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depthcube<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depthcube<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_c8c25c(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depthcube<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_c8c25c(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm
new file mode 100644
index 0000000..302f9ab
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_c8c25c "textureNumLevels_c8c25c"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_c8c25c = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_c8c25c
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl
new file mode 100644
index 0000000..e04b76d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/c8c25c.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_cube;
+
+fn textureNumLevels_c8c25c() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_c8c25c();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_c8c25c();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_c8c25c();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl
deleted file mode 100644
index 17c58e1..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d_array<i32>;
-
-// fn textureNumLevels(texture: texture_2d_array<i32>) -> i32
-fn textureNumLevels_d004a9() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_d004a9();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_d004a9();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_d004a9();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 34731d5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_d004a9() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_d004a9();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_d004a9();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 34731d5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray<int4> arg_0 : register(t0, space1);
-
-void textureNumLevels_d004a9() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_d004a9();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_d004a9();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.glsl
deleted file mode 100644
index 926ded3..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_d004a9();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_d004a9();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2DArray arg_0_1;
-void textureNumLevels_d004a9() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_d004a9();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.msl
deleted file mode 100644
index d0d19fe..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_d004a9(texture2d_array<int, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_array<int, access::sample> tint_symbol_2) {
- textureNumLevels_d004a9(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_array<int, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_array<int, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_d004a9(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_array<int, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_d004a9(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.spvasm
deleted file mode 100644
index 48fe3de..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_d004a9 "textureNumLevels_d004a9"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_d004a9 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_d004a9
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.wgsl
deleted file mode 100644
index ce8d24d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/d004a9.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d_array<i32>;
-
-fn textureNumLevels_d004a9() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_d004a9();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_d004a9();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_d004a9();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl
new file mode 100644
index 0000000..dac0818
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_2d;
+
+// fn textureNumLevels(texture: texture_depth_2d) -> u32
+fn textureNumLevels_d63126() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d63126();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d63126();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d63126();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..3ff9634
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureNumLevels_d63126() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d63126();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d63126();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..3ff9634
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D arg_0 : register(t0, space1);
+
+void textureNumLevels_d63126() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d63126();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d63126();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.glsl
new file mode 100644
index 0000000..1c2e0fc
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_d63126();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_d63126();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2D arg_0_1;
+void textureNumLevels_d63126() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_d63126();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl
new file mode 100644
index 0000000..dbfdf59
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_d63126(depth2d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_d63126(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_d63126(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_d63126(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm
new file mode 100644
index 0000000..897b81c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_d63126 "textureNumLevels_d63126"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_d63126 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_d63126
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl
new file mode 100644
index 0000000..29d43d5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d63126.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_2d;
+
+fn textureNumLevels_d63126() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d63126();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d63126();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d63126();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl
new file mode 100644
index 0000000..fc67fd5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<f32>;
+
+// fn textureNumLevels(texture: texture_cube_array<f32>) -> u32
+fn textureNumLevels_d8f73b() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d8f73b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d8f73b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..168d30f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_d8f73b() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d8f73b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..168d30f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_d8f73b() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_d8f73b();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_d8f73b();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.glsl
new file mode 100644
index 0000000..642af9e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_d8f73b();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'samplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp samplerCubeArray arg_0_1;
+void textureNumLevels_d8f73b() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_d8f73b();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'samplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl
new file mode 100644
index 0000000..235bcec
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_d8f73b(texturecube_array<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<float, access::sample> tint_symbol_2) {
+ textureNumLevels_d8f73b(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_d8f73b(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_d8f73b(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm
new file mode 100644
index 0000000..aac36d9
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_d8f73b "textureNumLevels_d8f73b"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_d8f73b = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_d8f73b
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl
new file mode 100644
index 0000000..3aa9f91
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/d8f73b.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<f32>;
+
+fn textureNumLevels_d8f73b() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_d8f73b();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_d8f73b();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_d8f73b();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl
deleted file mode 100644
index e7b032c..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_3d<f32>;
-
-// fn textureNumLevels(texture: texture_3d<f32>) -> i32
-fn textureNumLevels_dca09e() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_dca09e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_dca09e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_dca09e();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 01307a4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_dca09e() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_dca09e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_dca09e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 01307a4..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture3D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_dca09e() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_dca09e();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_dca09e();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.glsl
deleted file mode 100644
index ba0c815..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_dca09e();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_dca09e();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler3D arg_0_1;
-void textureNumLevels_dca09e() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_dca09e();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.msl
deleted file mode 100644
index e7813c5..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_dca09e(texture3d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
- textureNumLevels_dca09e(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_dca09e(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_dca09e(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.spvasm
deleted file mode 100644
index 3ee917e..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_dca09e "textureNumLevels_dca09e"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_dca09e = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_dca09e
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.wgsl
deleted file mode 100644
index d5e1e54..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/dca09e.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_3d<f32>;
-
-fn textureNumLevels_dca09e() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_dca09e();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_dca09e();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_dca09e();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl
deleted file mode 100644
index bfec435..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_2d<f32>;
-
-// fn textureNumLevels(texture: texture_2d<f32>) -> i32
-fn textureNumLevels_e67231() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_e67231();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_e67231();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_e67231();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.dxc.hlsl
deleted file mode 100644
index a6f8a6f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_e67231() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_e67231();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_e67231();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.fxc.hlsl
deleted file mode 100644
index a6f8a6f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2D<float4> arg_0 : register(t0, space1);
-
-void textureNumLevels_e67231() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_e67231();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_e67231();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.glsl
deleted file mode 100644
index 5345038..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_e67231();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_e67231();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2D arg_0_1;
-void textureNumLevels_e67231() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_e67231();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.msl
deleted file mode 100644
index 0a9f1ef..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_e67231(texture2d<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d<float, access::sample> tint_symbol_2) {
- textureNumLevels_e67231(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_e67231(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_e67231(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.spvasm
deleted file mode 100644
index f2974bb..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_e67231 "textureNumLevels_e67231"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_e67231 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_e67231
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.wgsl
deleted file mode 100644
index a42349d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/e67231.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_2d<f32>;
-
-fn textureNumLevels_e67231() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_e67231();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_e67231();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_e67231();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl
deleted file mode 100644
index 9ad4dca..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube<u32>;
-
-// fn textureNumLevels(texture: texture_cube<u32>) -> i32
-fn textureNumLevels_ed078b() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_ed078b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_ed078b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_ed078b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 75d40ea..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_ed078b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_ed078b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_ed078b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 75d40ea..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCube<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_ed078b() {
- int3 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_ed078b();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_ed078b();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.glsl
deleted file mode 100644
index 3293d1e..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_ed078b();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_ed078b();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCube arg_0_1;
-void textureNumLevels_ed078b() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_ed078b();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.msl
deleted file mode 100644
index 74d6563..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_ed078b(texturecube<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube<uint, access::sample> tint_symbol_2) {
- textureNumLevels_ed078b(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_ed078b(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_ed078b(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.spvasm
deleted file mode 100644
index 78cf143..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_ed078b "textureNumLevels_ed078b"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 0 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_ed078b = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_ed078b
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.wgsl
deleted file mode 100644
index 3a95130..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/ed078b.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube<u32>;
-
-fn textureNumLevels_ed078b() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_ed078b();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_ed078b();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_ed078b();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl
new file mode 100644
index 0000000..3904443
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_3d<f32>;
+
+// fn textureNumLevels(texture: texture_3d<f32>) -> u32
+fn textureNumLevels_ef7944() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ef7944();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ef7944();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4b71eed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_ef7944() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ef7944();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ef7944();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4b71eed
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture3D<float4> arg_0 : register(t0, space1);
+
+void textureNumLevels_ef7944() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_ef7944();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_ef7944();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.glsl
new file mode 100644
index 0000000..3e6a49a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_ef7944();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler3D arg_0_1;
+void textureNumLevels_ef7944() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_ef7944();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl
new file mode 100644
index 0000000..e63ad5f
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_ef7944(texture3d<float, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture3d<float, access::sample> tint_symbol_2) {
+ textureNumLevels_ef7944(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture3d<float, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture3d<float, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_ef7944(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture3d<float, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_ef7944(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm
new file mode 100644
index 0000000..b1b27b3
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_ef7944 "textureNumLevels_ef7944"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 3D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_ef7944 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQueryLevels %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_ef7944
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl
new file mode 100644
index 0000000..cdf4c05
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/ef7944.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_3d<f32>;
+
+fn textureNumLevels_ef7944() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_ef7944();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_ef7944();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_ef7944();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl
new file mode 100644
index 0000000..3304810
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_2d<u32>;
+
+// fn textureNumLevels(texture: texture_2d<u32>) -> u32
+fn textureNumLevels_efd6df() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_efd6df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_efd6df();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..d053690
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_efd6df() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_efd6df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_efd6df();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..d053690
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2D<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_efd6df() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_efd6df();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_efd6df();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.glsl
new file mode 100644
index 0000000..21c3943
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_efd6df();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2D arg_0_1;
+void textureNumLevels_efd6df() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_efd6df();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl
new file mode 100644
index 0000000..d0e4baf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_efd6df(texture2d<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_efd6df(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_efd6df(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_efd6df(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm
new file mode 100644
index 0000000..818380b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_efd6df "textureNumLevels_efd6df"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_efd6df = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_efd6df
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl
new file mode 100644
index 0000000..2f962e4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/efd6df.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_2d<u32>;
+
+fn textureNumLevels_efd6df() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_efd6df();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_efd6df();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_efd6df();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl
deleted file mode 100644
index f32f53f..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
-
-// fn textureNumLevels(texture: texture_cube_array<u32>) -> i32
-fn textureNumLevels_f46ec6() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f46ec6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f46ec6();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 3a16309..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_f46ec6() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f46ec6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f46ec6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 3a16309..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-TextureCubeArray<uint4> arg_0 : register(t0, space1);
-
-void textureNumLevels_f46ec6() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f46ec6();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f46ec6();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.glsl
deleted file mode 100644
index 1da3a81..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.glsl
+++ /dev/null
@@ -1,75 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_f46ec6();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:4: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usamplerCubeArray arg_0_1;
-void textureNumLevels_f46ec6() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_f46ec6();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
-ERROR: 0:3: '' : compilation terminated
-ERROR: 2 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.msl
deleted file mode 100644
index 83873b6..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_f46ec6(texturecube_array<uint, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
- textureNumLevels_f46ec6(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_f46ec6(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_f46ec6(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.spvasm
deleted file mode 100644
index 7650c28..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.spvasm
+++ /dev/null
@@ -1,76 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability SampledCubeArray
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_f46ec6 "textureNumLevels_f46ec6"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_f46ec6 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQueryLevels %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumLevels_f46ec6
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.wgsl
deleted file mode 100644
index b162138..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f46ec6.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
-
-fn textureNumLevels_f46ec6() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f46ec6();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f46ec6();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f46ec6();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl
deleted file mode 100644
index 009134e..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_2d_array;
-
-// fn textureNumLevels(texture: texture_depth_2d_array) -> i32
-fn textureNumLevels_f5828d() {
- var res: i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f5828d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f5828d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f5828d();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 05d604d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLevels_f5828d() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f5828d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f5828d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 05d604d..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DArray arg_0 : register(t0, space1);
-
-void textureNumLevels_f5828d() {
- int4 tint_tmp;
- arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
- int res = tint_tmp.w;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumLevels_f5828d();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumLevels_f5828d();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.glsl
deleted file mode 100644
index e810a1a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumLevels_f5828d();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void fragment_main() {
- textureNumLevels_f5828d();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DArray arg_0_1;
-void textureNumLevels_f5828d() {
- int res = textureQueryLevels(arg_0_1);
-}
-
-void compute_main() {
- textureNumLevels_f5828d();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.msl
deleted file mode 100644
index 0a15025..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumLevels_f5828d(depth2d_array<float, access::sample> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_mip_levels());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_array<float, access::sample> tint_symbol_2) {
- textureNumLevels_f5828d(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_array<float, access::sample> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_array<float, access::sample> tint_symbol_4 [[texture(0)]]) {
- textureNumLevels_f5828d(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_array<float, access::sample> tint_symbol_5 [[texture(0)]]) {
- textureNumLevels_f5828d(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.spvasm
deleted file mode 100644
index 6af2f4a..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumLevels_f5828d "textureNumLevels_f5828d"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 1 0 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumLevels_f5828d = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQueryLevels %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumLevels_f5828d
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.wgsl
deleted file mode 100644
index 02fdd80..0000000
--- a/test/tint/builtins/gen/var/textureNumLevels/f5828d.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_2d_array;
-
-fn textureNumLevels_f5828d() {
- var res : i32 = textureNumLevels(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumLevels_f5828d();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumLevels_f5828d();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumLevels_f5828d();
-}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl
new file mode 100644
index 0000000..8dbf86d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_1d<i32>;
+
+// fn textureNumLevels(texture: texture_1d<i32>) -> u32
+fn textureNumLevels_f742c0() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_f742c0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_f742c0();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..e909b27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_f742c0() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_f742c0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f742c0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..e909b27
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture1D<int4> arg_0 : register(t0, space1);
+
+void textureNumLevels_f742c0() {
+ int2 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y);
+ uint res = tint_tmp.y;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_f742c0();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_f742c0();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.glsl
new file mode 100644
index 0000000..c34994e
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_f742c0();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'isampler1D' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler1D arg_0_1;
+void textureNumLevels_f742c0() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_f742c0();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'isampler1D' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl
new file mode 100644
index 0000000..e4bd743
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_f742c0(texture1d<int, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture1d<int, access::sample> tint_symbol_2) {
+ textureNumLevels_f742c0(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture1d<int, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture1d<int, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_f742c0(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture1d<int, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_f742c0(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm
new file mode 100644
index 0000000..2cbb0e7
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.spvasm
@@ -0,0 +1,76 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability Sampled1D
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_f742c0 "textureNumLevels_f742c0"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 1D 0 0 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_f742c0 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumLevels_f742c0
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl
new file mode 100644
index 0000000..37f7f4c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/f742c0.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_1d<i32>;
+
+fn textureNumLevels_f742c0() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_f742c0();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_f742c0();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_f742c0();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl
new file mode 100644
index 0000000..2a5c129
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_cube_array<u32>;
+
+// fn textureNumLevels(texture: texture_cube_array<u32>) -> u32
+fn textureNumLevels_fe2171() {
+ var res: u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_fe2171();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_fe2171();
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..622e968
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_fe2171() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_fe2171();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_fe2171();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..622e968
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+TextureCubeArray<uint4> arg_0 : register(t0, space1);
+
+void textureNumLevels_fe2171() {
+ int4 tint_tmp;
+ arg_0.GetDimensions(0, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w);
+ uint res = tint_tmp.w;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumLevels_fe2171();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumLevels_fe2171();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.glsl
new file mode 100644
index 0000000..f768306
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumLevels_fe2171();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:4: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:4: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usamplerCubeArray arg_0_1;
+void textureNumLevels_fe2171() {
+ uint res = uint(textureQueryLevels(arg_0_1));
+}
+
+void compute_main() {
+ textureNumLevels_fe2171();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:3: 'usamplerCubeArray' : Reserved word.
+ERROR: 0:3: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl
new file mode 100644
index 0000000..a8221bf
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumLevels_fe2171(texturecube_array<uint, access::sample> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_mip_levels();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texturecube_array<uint, access::sample> tint_symbol_2) {
+ textureNumLevels_fe2171(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texturecube_array<uint, access::sample> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texturecube_array<uint, access::sample> tint_symbol_4 [[texture(0)]]) {
+ textureNumLevels_fe2171(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texturecube_array<uint, access::sample> tint_symbol_5 [[texture(0)]]) {
+ textureNumLevels_fe2171(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm
new file mode 100644
index 0000000..1382ffe
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability SampledCubeArray
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumLevels_fe2171 "textureNumLevels_fe2171"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint Cube 0 1 0 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumLevels_fe2171 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQueryLevels %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumLevels_fe2171
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl
new file mode 100644
index 0000000..8a0ab54
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumLevels/fe2171.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_cube_array<u32>;
+
+fn textureNumLevels_fe2171() {
+ var res : u32 = textureNumLevels(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumLevels_fe2171();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumLevels_fe2171();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumLevels_fe2171();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl
deleted file mode 100644
index 208dec8..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> i32
-fn textureNumSamples_2c6f14() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_2c6f14();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_2c6f14();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 6c3feaf..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_2c6f14() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_2c6f14();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_2c6f14();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 6c3feaf..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_2c6f14() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_2c6f14();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_2c6f14();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.glsl
deleted file mode 100644
index 5abe128..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_2c6f14();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_2c6f14() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_2c6f14();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.msl
deleted file mode 100644
index b062129..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_2c6f14(texture2d_ms<float, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
- textureNumSamples_2c6f14(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_2c6f14(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_2c6f14(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.spvasm
deleted file mode 100644
index f1b55e4..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_2c6f14 "textureNumSamples_2c6f14"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_2c6f14 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySamples %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_2c6f14
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.wgsl
deleted file mode 100644
index 460b4e2..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/2c6f14.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
-
-fn textureNumSamples_2c6f14() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_2c6f14();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_2c6f14();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_2c6f14();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl
deleted file mode 100644
index a308412..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> i32
-fn textureNumSamples_42f8bb() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_42f8bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_42f8bb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 415abda..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureNumSamples_42f8bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_42f8bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_42f8bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 415abda..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<uint4> arg_0 : register(t0, space1);
-
-void textureNumSamples_42f8bb() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_42f8bb();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_42f8bb();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.glsl
deleted file mode 100644
index 8a06334..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_42f8bb();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp usampler2DMS arg_0_1;
-void textureNumSamples_42f8bb() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_42f8bb();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.msl
deleted file mode 100644
index d951a7e..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_42f8bb(texture2d_ms<uint, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
- textureNumSamples_42f8bb(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_42f8bb(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_42f8bb(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.spvasm
deleted file mode 100644
index a8b6504..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.spvasm
+++ /dev/null
@@ -1,75 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 37
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_42f8bb "textureNumSamples_42f8bb"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %uint = OpTypeInt 32 0
- %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %22 = OpConstantNull %int
- %23 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_42f8bb = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %22
- %19 = OpLoad %11 %arg_0
- %17 = OpImageQuerySamples %int %19
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %23
- %25 = OpLabel
- %26 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %28 = OpLabel
- %29 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %29
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %32 = OpLabel
- %33 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %35 = OpLabel
- %36 = OpFunctionCall %void %textureNumSamples_42f8bb
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.wgsl
deleted file mode 100644
index e62f047..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/42f8bb.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
-
-fn textureNumSamples_42f8bb() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_42f8bb();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_42f8bb();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_42f8bb();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl
deleted file mode 100644
index 9680606..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
-
-// fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> i32
-fn textureNumSamples_449d23() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_449d23();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_449d23();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_449d23();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 4dbf2f0..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureNumSamples_449d23() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_449d23();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_449d23();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 4dbf2f0..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<int4> arg_0 : register(t0, space1);
-
-void textureNumSamples_449d23() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_449d23();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_449d23();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.glsl
deleted file mode 100644
index 2b60dd5..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_449d23();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_449d23();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp isampler2DMS arg_0_1;
-void textureNumSamples_449d23() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_449d23();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.msl
deleted file mode 100644
index 18e0ad7..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_449d23(texture2d_ms<int, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
- textureNumSamples_449d23(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_449d23(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_449d23(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.spvasm
deleted file mode 100644
index f89f901..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_449d23 "textureNumSamples_449d23"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %int = OpTypeInt 32 1
- %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %13 = OpTypeFunction %void
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_449d23 = OpFunction %void None %13
- %16 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %17 = OpImageQuerySamples %int %18
- OpStore %res %17
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %13
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %13
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %13
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_449d23
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.wgsl
deleted file mode 100644
index 0c9fd1f..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/449d23.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
-
-fn textureNumSamples_449d23() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_449d23();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_449d23();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_449d23();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl
new file mode 100644
index 0000000..47d2f3d
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<u32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<u32>) -> u32
+fn textureNumSamples_50f399() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_50f399();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_50f399();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_50f399();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..bfe4d22
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureNumSamples_50f399() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_50f399();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_50f399();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..bfe4d22
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<uint4> arg_0 : register(t0, space1);
+
+void textureNumSamples_50f399() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_50f399();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_50f399();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.glsl
new file mode 100644
index 0000000..d971b8c
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_50f399();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_50f399();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp usampler2DMS arg_0_1;
+void textureNumSamples_50f399() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_50f399();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl
new file mode 100644
index 0000000..4de37b0
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_50f399(texture2d_ms<uint, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<uint, access::read> tint_symbol_2) {
+ textureNumSamples_50f399(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<uint, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<uint, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_50f399(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<uint, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_50f399(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm
new file mode 100644
index 0000000..57be983
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_50f399 "textureNumSamples_50f399"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %uint = OpTypeInt 32 0
+ %11 = OpTypeImage %uint 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_50f399 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySamples %uint %18
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_50f399
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl
new file mode 100644
index 0000000..a2d6199
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/50f399.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<u32>;
+
+fn textureNumSamples_50f399() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_50f399();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_50f399();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_50f399();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl
deleted file mode 100644
index bddc529..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2021 The Tint Authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-////////////////////////////////////////////////////////////////////////////////
-// File generated by tools/src/cmd/gen
-// using the template:
-// test/tint/builtins/gen/gen.wgsl.tmpl
-//
-// Do not modify this file directly
-////////////////////////////////////////////////////////////////////////////////
-
-@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
-
-// fn textureNumSamples(texture: texture_depth_multisampled_2d) -> i32
-fn textureNumSamples_a3c8a0() {
- var res: i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_a3c8a0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_a3c8a0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl
deleted file mode 100644
index 0eb375a..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.dxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_a3c8a0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_a3c8a0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_a3c8a0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl
deleted file mode 100644
index 0eb375a..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.fxc.hlsl
+++ /dev/null
@@ -1,34 +0,0 @@
-Texture2DMS<float4> arg_0 : register(t0, space1);
-
-void textureNumSamples_a3c8a0() {
- int3 tint_tmp;
- arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- int res = tint_tmp.z;
-}
-
-struct tint_symbol {
- float4 value : SV_Position;
-};
-
-float4 vertex_main_inner() {
- textureNumSamples_a3c8a0();
- return (0.0f).xxxx;
-}
-
-tint_symbol vertex_main() {
- const float4 inner_result = vertex_main_inner();
- tint_symbol wrapper_result = (tint_symbol)0;
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
- return;
-}
-
-[numthreads(1, 1, 1)]
-void compute_main() {
- textureNumSamples_a3c8a0();
- return;
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.glsl
deleted file mode 100644
index 826c680..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-SKIP: FAILED
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-vec4 vertex_main() {
- textureNumSamples_a3c8a0();
- return vec4(0.0f);
-}
-
-void main() {
- gl_PointSize = 1.0;
- vec4 inner_result = vertex_main();
- gl_Position = inner_result;
- gl_Position.y = -(gl_Position.y);
- gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-precision mediump float;
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-void fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-void main() {
- fragment_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
-ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
-#version 310 es
-
-uniform highp sampler2DMS arg_0_1;
-void textureNumSamples_a3c8a0() {
- int res = textureSamples(arg_0_1);
-}
-
-void compute_main() {
- textureNumSamples_a3c8a0();
-}
-
-layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
-void main() {
- compute_main();
- return;
-}
-Error parsing GLSL shader:
-ERROR: 0:5: 'textureSamples' : no matching overloaded function found
-ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
-ERROR: 0:5: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
-
-
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.msl
deleted file mode 100644
index c3db04e..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.msl
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-
-using namespace metal;
-void textureNumSamples_a3c8a0(depth2d_ms<float, access::read> tint_symbol_1) {
- int res = int(tint_symbol_1.get_num_samples());
-}
-
-struct tint_symbol {
- float4 value [[position]];
-};
-
-float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
- textureNumSamples_a3c8a0(tint_symbol_2);
- return float4(0.0f);
-}
-
-vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
- float4 const inner_result = vertex_main_inner(tint_symbol_3);
- tint_symbol wrapper_result = {};
- wrapper_result.value = inner_result;
- return wrapper_result;
-}
-
-fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
- textureNumSamples_a3c8a0(tint_symbol_4);
- return;
-}
-
-kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
- textureNumSamples_a3c8a0(tint_symbol_5);
- return;
-}
-
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.spvasm
deleted file mode 100644
index a6f64b1..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.spvasm
+++ /dev/null
@@ -1,74 +0,0 @@
-; SPIR-V
-; Version: 1.3
-; Generator: Google Tint Compiler; 0
-; Bound: 36
-; Schema: 0
- OpCapability Shader
- OpCapability ImageQuery
- OpMemoryModel Logical GLSL450
- OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
- OpEntryPoint Fragment %fragment_main "fragment_main"
- OpEntryPoint GLCompute %compute_main "compute_main"
- OpExecutionMode %fragment_main OriginUpperLeft
- OpExecutionMode %compute_main LocalSize 1 1 1
- OpName %value "value"
- OpName %vertex_point_size "vertex_point_size"
- OpName %arg_0 "arg_0"
- OpName %textureNumSamples_a3c8a0 "textureNumSamples_a3c8a0"
- OpName %res "res"
- OpName %vertex_main_inner "vertex_main_inner"
- OpName %vertex_main "vertex_main"
- OpName %fragment_main "fragment_main"
- OpName %compute_main "compute_main"
- OpDecorate %value BuiltIn Position
- OpDecorate %vertex_point_size BuiltIn PointSize
- OpDecorate %arg_0 DescriptorSet 1
- OpDecorate %arg_0 Binding 0
- %float = OpTypeFloat 32
- %v4float = OpTypeVector %float 4
-%_ptr_Output_v4float = OpTypePointer Output %v4float
- %5 = OpConstantNull %v4float
- %value = OpVariable %_ptr_Output_v4float Output %5
-%_ptr_Output_float = OpTypePointer Output %float
- %8 = OpConstantNull %float
-%vertex_point_size = OpVariable %_ptr_Output_float Output %8
- %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
-%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
- %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
- %void = OpTypeVoid
- %12 = OpTypeFunction %void
- %int = OpTypeInt 32 1
-%_ptr_Function_int = OpTypePointer Function %int
- %21 = OpConstantNull %int
- %22 = OpTypeFunction %v4float
- %float_1 = OpConstant %float 1
-%textureNumSamples_a3c8a0 = OpFunction %void None %12
- %15 = OpLabel
- %res = OpVariable %_ptr_Function_int Function %21
- %18 = OpLoad %11 %arg_0
- %16 = OpImageQuerySamples %int %18
- OpStore %res %16
- OpReturn
- OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %22
- %24 = OpLabel
- %25 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturnValue %5
- OpFunctionEnd
-%vertex_main = OpFunction %void None %12
- %27 = OpLabel
- %28 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %28
- OpStore %vertex_point_size %float_1
- OpReturn
- OpFunctionEnd
-%fragment_main = OpFunction %void None %12
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturn
- OpFunctionEnd
-%compute_main = OpFunction %void None %12
- %34 = OpLabel
- %35 = OpFunctionCall %void %textureNumSamples_a3c8a0
- OpReturn
- OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.wgsl
deleted file mode 100644
index c78e101..0000000
--- a/test/tint/builtins/gen/var/textureNumSamples/a3c8a0.wgsl.expected.wgsl
+++ /dev/null
@@ -1,21 +0,0 @@
-@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
-
-fn textureNumSamples_a3c8a0() {
- var res : i32 = textureNumSamples(arg_0);
-}
-
-@vertex
-fn vertex_main() -> @builtin(position) vec4<f32> {
- textureNumSamples_a3c8a0();
- return vec4<f32>();
-}
-
-@fragment
-fn fragment_main() {
- textureNumSamples_a3c8a0();
-}
-
-@compute @workgroup_size(1)
-fn compute_main() {
- textureNumSamples_a3c8a0();
-}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl
new file mode 100644
index 0000000..dbae081
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<i32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<i32>) -> u32
+fn textureNumSamples_c1a777() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_c1a777();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_c1a777();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..4998404
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureNumSamples_c1a777() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_c1a777();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_c1a777();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..4998404
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<int4> arg_0 : register(t0, space1);
+
+void textureNumSamples_c1a777() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_c1a777();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_c1a777();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.glsl
new file mode 100644
index 0000000..1c6ab36
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_c1a777();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp isampler2DMS arg_0_1;
+void textureNumSamples_c1a777() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_c1a777();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl
new file mode 100644
index 0000000..a8cdede
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_c1a777(texture2d_ms<int, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<int, access::read> tint_symbol_2) {
+ textureNumSamples_c1a777(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<int, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<int, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_c1a777(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<int, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_c1a777(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm
new file mode 100644
index 0000000..cb9cc2a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.spvasm
@@ -0,0 +1,75 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 37
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_c1a777 "textureNumSamples_c1a777"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %int = OpTypeInt 32 1
+ %11 = OpTypeImage %int 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %13 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %22 = OpConstantNull %uint
+ %23 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_c1a777 = OpFunction %void None %13
+ %16 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %22
+ %19 = OpLoad %11 %arg_0
+ %17 = OpImageQuerySamples %uint %19
+ OpStore %res %17
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %23
+ %25 = OpLabel
+ %26 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %13
+ %28 = OpLabel
+ %29 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %29
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %13
+ %32 = OpLabel
+ %33 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %13
+ %35 = OpLabel
+ %36 = OpFunctionCall %void %textureNumSamples_c1a777
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl
new file mode 100644
index 0000000..564ccf5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/c1a777.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<i32>;
+
+fn textureNumSamples_c1a777() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_c1a777();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_c1a777();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_c1a777();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl
new file mode 100644
index 0000000..5c9fcbb
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_multisampled_2d<f32>;
+
+// fn textureNumSamples(texture: texture_multisampled_2d<f32>) -> u32
+fn textureNumSamples_dbb799() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_dbb799();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_dbb799();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..1878090
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_dbb799() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_dbb799();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_dbb799();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..1878090
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_dbb799() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_dbb799();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_dbb799();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.glsl
new file mode 100644
index 0000000..642c5e5
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_dbb799();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_dbb799() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_dbb799();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl
new file mode 100644
index 0000000..2d6f774
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_dbb799(texture2d_ms<float, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(texture2d_ms<float, access::read> tint_symbol_2) {
+ textureNumSamples_dbb799(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(texture2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(texture2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_dbb799(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(texture2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_dbb799(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm
new file mode 100644
index 0000000..b48af47
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_dbb799 "textureNumSamples_dbb799"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_dbb799 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySamples %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_dbb799
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl
new file mode 100644
index 0000000..79ad99b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/dbb799.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_multisampled_2d<f32>;
+
+fn textureNumSamples_dbb799() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_dbb799();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_dbb799();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_dbb799();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl
new file mode 100644
index 0000000..9389a95
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl
@@ -0,0 +1,44 @@
+// Copyright 2022 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+////////////////////////////////////////////////////////////////////////////////
+// File generated by tools/src/cmd/gen
+// using the template:
+// test/tint/builtins/gen/gen.wgsl.tmpl
+//
+// Do not modify this file directly
+////////////////////////////////////////////////////////////////////////////////
+
+@group(1) @binding(0) var arg_0: texture_depth_multisampled_2d;
+
+// fn textureNumSamples(texture: texture_depth_multisampled_2d) -> u32
+fn textureNumSamples_ecd321() {
+ var res: u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_ecd321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_ecd321();
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
new file mode 100644
index 0000000..9015e45
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.dxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_ecd321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_ecd321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_ecd321();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
new file mode 100644
index 0000000..9015e45
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.fxc.hlsl
@@ -0,0 +1,34 @@
+Texture2DMS<float4> arg_0 : register(t0, space1);
+
+void textureNumSamples_ecd321() {
+ int3 tint_tmp;
+ arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
+ uint res = tint_tmp.z;
+}
+
+struct tint_symbol {
+ float4 value : SV_Position;
+};
+
+float4 vertex_main_inner() {
+ textureNumSamples_ecd321();
+ return (0.0f).xxxx;
+}
+
+tint_symbol vertex_main() {
+ const float4 inner_result = vertex_main_inner();
+ tint_symbol wrapper_result = (tint_symbol)0;
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+ return;
+}
+
+[numthreads(1, 1, 1)]
+void compute_main() {
+ textureNumSamples_ecd321();
+ return;
+}
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.glsl
new file mode 100644
index 0000000..746dd12
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.glsl
@@ -0,0 +1,75 @@
+SKIP: FAILED
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+vec4 vertex_main() {
+ textureNumSamples_ecd321();
+ return vec4(0.0f);
+}
+
+void main() {
+ gl_PointSize = 1.0;
+ vec4 inner_result = vertex_main();
+ gl_Position = inner_result;
+ gl_Position.y = -(gl_Position.y);
+ gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+precision mediump float;
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+void main() {
+ fragment_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:6: 'textureSamples' : no matching overloaded function found
+ERROR: 0:6: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
+#version 310 es
+
+uniform highp sampler2DMS arg_0_1;
+void textureNumSamples_ecd321() {
+ uint res = uint(textureSamples(arg_0_1));
+}
+
+void compute_main() {
+ textureNumSamples_ecd321();
+}
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+void main() {
+ compute_main();
+ return;
+}
+Error parsing GLSL shader:
+ERROR: 0:5: 'textureSamples' : no matching overloaded function found
+ERROR: 0:5: '' : compilation terminated
+ERROR: 2 compilation errors. No code generated.
+
+
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl
new file mode 100644
index 0000000..95ee5b4
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.msl
@@ -0,0 +1,33 @@
+#include <metal_stdlib>
+
+using namespace metal;
+void textureNumSamples_ecd321(depth2d_ms<float, access::read> tint_symbol_1) {
+ uint res = tint_symbol_1.get_num_samples();
+}
+
+struct tint_symbol {
+ float4 value [[position]];
+};
+
+float4 vertex_main_inner(depth2d_ms<float, access::read> tint_symbol_2) {
+ textureNumSamples_ecd321(tint_symbol_2);
+ return float4(0.0f);
+}
+
+vertex tint_symbol vertex_main(depth2d_ms<float, access::read> tint_symbol_3 [[texture(0)]]) {
+ float4 const inner_result = vertex_main_inner(tint_symbol_3);
+ tint_symbol wrapper_result = {};
+ wrapper_result.value = inner_result;
+ return wrapper_result;
+}
+
+fragment void fragment_main(depth2d_ms<float, access::read> tint_symbol_4 [[texture(0)]]) {
+ textureNumSamples_ecd321(tint_symbol_4);
+ return;
+}
+
+kernel void compute_main(depth2d_ms<float, access::read> tint_symbol_5 [[texture(0)]]) {
+ textureNumSamples_ecd321(tint_symbol_5);
+ return;
+}
+
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm
new file mode 100644
index 0000000..41ea05b
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.spvasm
@@ -0,0 +1,74 @@
+; SPIR-V
+; Version: 1.3
+; Generator: Google Tint Compiler; 0
+; Bound: 36
+; Schema: 0
+ OpCapability Shader
+ OpCapability ImageQuery
+ OpMemoryModel Logical GLSL450
+ OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
+ OpEntryPoint Fragment %fragment_main "fragment_main"
+ OpEntryPoint GLCompute %compute_main "compute_main"
+ OpExecutionMode %fragment_main OriginUpperLeft
+ OpExecutionMode %compute_main LocalSize 1 1 1
+ OpName %value "value"
+ OpName %vertex_point_size "vertex_point_size"
+ OpName %arg_0 "arg_0"
+ OpName %textureNumSamples_ecd321 "textureNumSamples_ecd321"
+ OpName %res "res"
+ OpName %vertex_main_inner "vertex_main_inner"
+ OpName %vertex_main "vertex_main"
+ OpName %fragment_main "fragment_main"
+ OpName %compute_main "compute_main"
+ OpDecorate %value BuiltIn Position
+ OpDecorate %vertex_point_size BuiltIn PointSize
+ OpDecorate %arg_0 DescriptorSet 1
+ OpDecorate %arg_0 Binding 0
+ %float = OpTypeFloat 32
+ %v4float = OpTypeVector %float 4
+%_ptr_Output_v4float = OpTypePointer Output %v4float
+ %5 = OpConstantNull %v4float
+ %value = OpVariable %_ptr_Output_v4float Output %5
+%_ptr_Output_float = OpTypePointer Output %float
+ %8 = OpConstantNull %float
+%vertex_point_size = OpVariable %_ptr_Output_float Output %8
+ %11 = OpTypeImage %float 2D 0 0 1 1 Unknown
+%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
+ %arg_0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
+ %void = OpTypeVoid
+ %12 = OpTypeFunction %void
+ %uint = OpTypeInt 32 0
+%_ptr_Function_uint = OpTypePointer Function %uint
+ %21 = OpConstantNull %uint
+ %22 = OpTypeFunction %v4float
+ %float_1 = OpConstant %float 1
+%textureNumSamples_ecd321 = OpFunction %void None %12
+ %15 = OpLabel
+ %res = OpVariable %_ptr_Function_uint Function %21
+ %18 = OpLoad %11 %arg_0
+ %16 = OpImageQuerySamples %uint %18
+ OpStore %res %16
+ OpReturn
+ OpFunctionEnd
+%vertex_main_inner = OpFunction %v4float None %22
+ %24 = OpLabel
+ %25 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturnValue %5
+ OpFunctionEnd
+%vertex_main = OpFunction %void None %12
+ %27 = OpLabel
+ %28 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %28
+ OpStore %vertex_point_size %float_1
+ OpReturn
+ OpFunctionEnd
+%fragment_main = OpFunction %void None %12
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturn
+ OpFunctionEnd
+%compute_main = OpFunction %void None %12
+ %34 = OpLabel
+ %35 = OpFunctionCall %void %textureNumSamples_ecd321
+ OpReturn
+ OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl
new file mode 100644
index 0000000..881972a
--- /dev/null
+++ b/test/tint/builtins/gen/var/textureNumSamples/ecd321.wgsl.expected.wgsl
@@ -0,0 +1,21 @@
+@group(1) @binding(0) var arg_0 : texture_depth_multisampled_2d;
+
+fn textureNumSamples_ecd321() {
+ var res : u32 = textureNumSamples(arg_0);
+}
+
+@vertex
+fn vertex_main() -> @builtin(position) vec4<f32> {
+ textureNumSamples_ecd321();
+ return vec4<f32>();
+}
+
+@fragment
+fn fragment_main() {
+ textureNumSamples_ecd321();
+}
+
+@compute @workgroup_size(1)
+fn compute_main() {
+ textureNumSamples_ecd321();
+}
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 d26800b..c791249 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.glsl
@@ -33,10 +33,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
@@ -111,10 +111,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
@@ -183,10 +183,10 @@
vec4 textureSampleExternal(highp sampler2D plane0_1, highp sampler2D plane1_1, highp sampler2D plane0_smp, highp sampler2D plane1_smp, vec2 coord, ExternalTextureParams params) {
- vec2 plane0_dims = vec2(textureSize(plane0_1, 0));
+ vec2 plane0_dims = vec2(uvec2(textureSize(plane0_1, 0)));
vec2 plane0_half_texel = (vec2(0.5f) / plane0_dims);
vec2 plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- vec2 plane1_dims = vec2(textureSize(plane1_1, 0));
+ vec2 plane1_dims = vec2(uvec2(textureSize(plane1_1, 0)));
vec2 plane1_half_texel = (vec2(0.5f) / plane1_dims);
vec2 plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
vec3 color = vec3(0.0f, 0.0f, 0.0f);
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 d2a442a..a712ee8 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.msl
@@ -43,10 +43,10 @@
}
float4 textureSampleExternal(texture2d<float, access::sample> plane0, texture2d<float, access::sample> plane1, sampler smp, float2 coord, ExternalTextureParams params) {
- float2 const plane0_dims = float2(int2(plane0.get_width(0), plane0.get_height(0)));
+ float2 const plane0_dims = float2(uint2(plane0.get_width(0), plane0.get_height(0)));
float2 const plane0_half_texel = (float2(0.5f) / plane0_dims);
float2 const plane0_clamped = clamp(coord, plane0_half_texel, (1.0f - plane0_half_texel));
- float2 const plane1_dims = float2(int2(plane1.get_width(0), plane1.get_height(0)));
+ float2 const plane1_dims = float2(uint2(plane1.get_width(0), plane1.get_height(0)));
float2 const plane1_half_texel = (float2(0.5f) / plane1_dims);
float2 const plane1_clamped = clamp(coord, plane1_half_texel, (1.0f - plane1_half_texel));
float3 color = 0.0f;
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 1c6d7d4..76ec885 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/7c04e6.wgsl.expected.spvasm
@@ -115,8 +115,8 @@
%45 = OpConstantNull %v3float
%v2float = OpTypeVector %float 2
%65 = OpTypeFunction %v4float %11 %11 %24 %v2float %ExternalTextureParams
+ %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
%78 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5
%80 = OpConstantComposite %v2float %float_0_5 %float_0_5
@@ -178,14 +178,14 @@
%85 = OpVariable %_ptr_Function_v2float Function %87
%94 = OpVariable %_ptr_Function_v2float Function %87
%color = OpVariable %_ptr_Function_v3float Function %45
- %75 = OpImageQuerySizeLod %v2int %plane0 %78
- %74 = OpConvertSToF %v2float %75
+ %75 = OpImageQuerySizeLod %v2uint %plane0 %78
+ %74 = OpConvertUToF %v2float %75
%81 = OpFDiv %v2float %80 %74
%88 = OpCompositeConstruct %v2float %float_1 %float_1
%84 = OpFSub %v2float %88 %81
%82 = OpExtInst %v2float %31 NClamp %coord %81 %84
- %90 = OpImageQuerySizeLod %v2int %plane1 %78
- %89 = OpConvertSToF %v2float %90
+ %90 = OpImageQuerySizeLod %v2uint %plane1 %78
+ %89 = OpConvertUToF %v2float %90
%91 = OpFDiv %v2float %80 %89
%95 = OpCompositeConstruct %v2float %float_1 %float_1
%93 = OpFSub %v2float %95 %91
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
index 9a5c5ef..0a11b0e 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.glsl
@@ -2,7 +2,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
@@ -33,7 +33,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
@@ -58,7 +58,7 @@
vec4 tint_textureSampleBaseClampToEdge(highp sampler2D t_1, highp sampler2D t_s, vec2 coord) {
- vec2 dims = vec2(textureSize(t_1, 0));
+ vec2 dims = vec2(uvec2(textureSize(t_1, 0)));
vec2 half_texel = (vec2(0.5f) / dims);
vec2 clamped = clamp(coord, half_texel, (1.0f - half_texel));
return textureLod(t_s, clamped, 0.0f);
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
index 3b64f95..04222ae 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.msl
@@ -2,7 +2,7 @@
using namespace metal;
float4 tint_textureSampleBaseClampToEdge(texture2d<float, access::sample> t, sampler s, float2 coord) {
- float2 const dims = float2(int2(t.get_width(0), t.get_height(0)));
+ float2 const dims = float2(uint2(t.get_width(0), t.get_height(0)));
float2 const half_texel = (float2(0.5f) / dims);
float2 const clamped = clamp(coord, half_texel, (1.0f - half_texel));
return t.sample(s, clamped, level(0.0f));
diff --git a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
index a130f40..31905a1 100644
--- a/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
+++ b/test/tint/builtins/gen/var/textureSampleBaseClampToEdge/9ca02c.wgsl.expected.spvasm
@@ -1,11 +1,11 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 65
+; Bound: 66
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
- %31 = OpExtInstImport "GLSL.std.450"
+ %32 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Vertex %vertex_main "vertex_main" %value %vertex_point_size
OpEntryPoint Fragment %fragment_main "fragment_main"
@@ -49,66 +49,67 @@
%arg_1 = OpVariable %_ptr_UniformConstant_14 UniformConstant
%v2float = OpTypeVector %float 2
%15 = OpTypeFunction %v4float %11 %14 %v2float
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
%int = OpTypeInt 32 1
- %v2int = OpTypeVector %int 2
- %26 = OpConstantNull %int
+ %27 = OpConstantNull %int
%float_0_5 = OpConstant %float 0.5
- %28 = OpConstantComposite %v2float %float_0_5 %float_0_5
+ %29 = OpConstantComposite %v2float %float_0_5 %float_0_5
%float_1 = OpConstant %float 1
%_ptr_Function_v2float = OpTypePointer Function %v2float
- %36 = OpConstantNull %v2float
- %39 = OpTypeSampledImage %11
+ %37 = OpConstantNull %v2float
+ %40 = OpTypeSampledImage %11
%void = OpTypeVoid
- %41 = OpTypeFunction %void
+ %42 = OpTypeFunction %void
%_ptr_Function_v4float = OpTypePointer Function %v4float
- %52 = OpTypeFunction %v4float
+ %53 = OpTypeFunction %v4float
%tint_textureSampleBaseClampToEdge = OpFunction %v4float None %15
%t = OpFunctionParameter %11
%s = OpFunctionParameter %14
%coord = OpFunctionParameter %v2float
%21 = OpLabel
- %34 = OpVariable %_ptr_Function_v2float Function %36
- %23 = OpImageQuerySizeLod %v2int %t %26
- %22 = OpConvertSToF %v2float %23
- %29 = OpFDiv %v2float %28 %22
- %37 = OpCompositeConstruct %v2float %float_1 %float_1
- %33 = OpFSub %v2float %37 %29
- %30 = OpExtInst %v2float %31 NClamp %coord %29 %33
- %40 = OpSampledImage %39 %t %s
- %38 = OpImageSampleExplicitLod %v4float %40 %30 Lod %8
- OpReturnValue %38
+ %35 = OpVariable %_ptr_Function_v2float Function %37
+ %23 = OpImageQuerySizeLod %v2uint %t %27
+ %22 = OpConvertUToF %v2float %23
+ %30 = OpFDiv %v2float %29 %22
+ %38 = OpCompositeConstruct %v2float %float_1 %float_1
+ %34 = OpFSub %v2float %38 %30
+ %31 = OpExtInst %v2float %32 NClamp %coord %30 %34
+ %41 = OpSampledImage %40 %t %s
+ %39 = OpImageSampleExplicitLod %v4float %41 %31 Lod %8
+ OpReturnValue %39
OpFunctionEnd
-%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %41
- %44 = OpLabel
- %arg_2 = OpVariable %_ptr_Function_v2float Function %36
+%textureSampleBaseClampToEdge_9ca02c = OpFunction %void None %42
+ %45 = OpLabel
+ %arg_2 = OpVariable %_ptr_Function_v2float Function %37
%res = OpVariable %_ptr_Function_v4float Function %5
- OpStore %arg_2 %36
- %47 = OpLoad %11 %arg_0
- %48 = OpLoad %14 %arg_1
- %49 = OpLoad %v2float %arg_2
- %46 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %47 %48 %49
- OpStore %res %46
+ OpStore %arg_2 %37
+ %48 = OpLoad %11 %arg_0
+ %49 = OpLoad %14 %arg_1
+ %50 = OpLoad %v2float %arg_2
+ %47 = OpFunctionCall %v4float %tint_textureSampleBaseClampToEdge %48 %49 %50
+ OpStore %res %47
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %v4float None %52
- %54 = OpLabel
- %55 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%vertex_main_inner = OpFunction %v4float None %53
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturnValue %5
OpFunctionEnd
-%vertex_main = OpFunction %void None %41
- %57 = OpLabel
- %58 = OpFunctionCall %v4float %vertex_main_inner
- OpStore %value %58
+%vertex_main = OpFunction %void None %42
+ %58 = OpLabel
+ %59 = OpFunctionCall %v4float %vertex_main_inner
+ OpStore %value %59
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
-%fragment_main = OpFunction %void None %41
- %60 = OpLabel
- %61 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%fragment_main = OpFunction %void None %42
+ %61 = OpLabel
+ %62 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturn
OpFunctionEnd
-%compute_main = OpFunction %void None %41
- %63 = OpLabel
- %64 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
+%compute_main = OpFunction %void None %42
+ %64 = OpLabel
+ %65 = OpFunctionCall %void %textureSampleBaseClampToEdge_9ca02c
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
index 19d3183..39ada01 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1b0291.wgsl.expected.glsl
@@ -6,7 +6,7 @@
void textureSampleLevel_1b0291() {
vec3 arg_2 = vec3(0.0f);
- int arg_3 = 0;
+ int arg_3 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, 0.0f), float(arg_3));
}
@@ -37,7 +37,7 @@
void textureSampleLevel_1b0291() {
vec3 arg_2 = vec3(0.0f);
- int arg_3 = 0;
+ int arg_3 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, 0.0f), float(arg_3));
}
@@ -62,7 +62,7 @@
void textureSampleLevel_1b0291() {
vec3 arg_2 = vec3(0.0f);
- int arg_3 = 0;
+ int arg_3 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, 0.0f), float(arg_3));
}
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
index 910156b..fdc66c1 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/1bf73e.wgsl.expected.glsl
@@ -7,7 +7,7 @@
void textureSampleLevel_1bf73e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4));
}
@@ -39,7 +39,7 @@
void textureSampleLevel_1bf73e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4));
}
@@ -65,7 +65,7 @@
void textureSampleLevel_1bf73e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4));
}
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
index 643f052..eafbee8 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/36780e.wgsl.expected.glsl
@@ -7,7 +7,7 @@
void textureSampleLevel_36780e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLodOffset(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4), ivec2(0));
}
@@ -39,7 +39,7 @@
void textureSampleLevel_36780e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLodOffset(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4), ivec2(0));
}
@@ -65,7 +65,7 @@
void textureSampleLevel_36780e() {
vec2 arg_2 = vec2(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLodOffset(arg_0_arg_1, vec4(vec3(arg_2, float(arg_3)), 0.0f), float(arg_4), ivec2(0));
}
diff --git a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
index 9c64c66..03fa0be 100644
--- a/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
+++ b/test/tint/builtins/gen/var/textureSampleLevel/ae5e39.wgsl.expected.glsl
@@ -7,7 +7,7 @@
void textureSampleLevel_ae5e39() {
vec3 arg_2 = vec3(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, float(arg_3)), float(arg_4));
}
@@ -39,7 +39,7 @@
void textureSampleLevel_ae5e39() {
vec3 arg_2 = vec3(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, float(arg_3)), float(arg_4));
}
@@ -65,7 +65,7 @@
void textureSampleLevel_ae5e39() {
vec3 arg_2 = vec3(0.0f);
int arg_3 = 1;
- int arg_4 = 0;
+ int arg_4 = 1;
float res = textureLod(arg_0_arg_1, vec4(arg_2, float(arg_3)), float(arg_4));
}
diff --git a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.glsl b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.glsl
index d4d4faf..3208918 100644
--- a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.glsl
+++ b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.glsl
@@ -4,7 +4,7 @@
uniform highp sampler2DMS arg_0_1;
void textureDimensions_f60bdb() {
ivec2 res = ivec2(0);
- ivec2 x_16 = ivec2(textureSize(arg_0_1));
+ ivec2 x_16 = ivec2(uvec2(textureSize(arg_0_1)));
res = x_16;
return;
}
@@ -44,7 +44,7 @@
uniform highp sampler2DMS arg_0_1;
void textureDimensions_f60bdb() {
ivec2 res = ivec2(0);
- ivec2 x_16 = ivec2(textureSize(arg_0_1));
+ ivec2 x_16 = ivec2(uvec2(textureSize(arg_0_1)));
res = x_16;
return;
}
@@ -71,7 +71,7 @@
uniform highp sampler2DMS arg_0_1;
void textureDimensions_f60bdb() {
ivec2 res = ivec2(0);
- ivec2 x_16 = ivec2(textureSize(arg_0_1));
+ ivec2 x_16 = ivec2(uvec2(textureSize(arg_0_1)));
res = x_16;
return;
}
diff --git a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.msl b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.msl
index 888f685..865461f 100644
--- a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.msl
+++ b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.msl
@@ -3,7 +3,7 @@
using namespace metal;
void textureDimensions_f60bdb(depth2d_ms<float, access::read> tint_symbol_5) {
int2 res = int2(0);
- int2 const x_16 = int2(int2(tint_symbol_5.get_width(), tint_symbol_5.get_height()));
+ int2 const x_16 = int2(uint2(tint_symbol_5.get_width(), tint_symbol_5.get_height()));
res = x_16;
return;
}
diff --git a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.spvasm b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.spvasm
index d551eb8..8149908 100644
--- a/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.spvasm
+++ b/test/tint/builtins/textureDimensions/depth_ms.spvasm.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 58
+; Bound: 60
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
@@ -52,63 +52,66 @@
%v2int = OpTypeVector %int 2
%20 = OpConstantNull %v2int
%_ptr_Function_v2int = OpTypePointer Function %v2int
- %26 = OpTypeFunction %void %v4float
+ %uint = OpTypeInt 32 0
+ %v2uint = OpTypeVector %uint 2
+ %28 = OpTypeFunction %void %v4float
%vertex_main_out = OpTypeStruct %v4float
- %34 = OpTypeFunction %vertex_main_out
+ %36 = OpTypeFunction %vertex_main_out
%float_1 = OpConstant %float 1
%textureDimensions_f60bdb = OpFunction %void None %14
%17 = OpLabel
%res = OpVariable %_ptr_Function_v2int Function %20
OpStore %res %20
- %25 = OpLoad %11 %arg_0
- %24 = OpImageQuerySize %v2int %25
- OpStore %res %24
+ %27 = OpLoad %11 %arg_0
+ %24 = OpImageQuerySize %v2uint %27
+ %23 = OpBitcast %v2int %24
+ OpStore %res %23
OpReturn
OpFunctionEnd
-%tint_symbol_2 = OpFunction %void None %26
+%tint_symbol_2 = OpFunction %void None %28
%tint_symbol = OpFunctionParameter %v4float
- %29 = OpLabel
+ %31 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main_1 = OpFunction %void None %14
- %31 = OpLabel
- %32 = OpFunctionCall %void %textureDimensions_f60bdb
- %33 = OpFunctionCall %void %tint_symbol_2 %5
+ %33 = OpLabel
+ %34 = OpFunctionCall %void %textureDimensions_f60bdb
+ %35 = OpFunctionCall %void %tint_symbol_2 %5
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %vertex_main_out None %34
- %37 = OpLabel
- %38 = OpFunctionCall %void %vertex_main_1
- %39 = OpLoad %v4float %tint_symbol_1
- %40 = OpCompositeConstruct %vertex_main_out %39
- OpReturnValue %40
+%vertex_main_inner = OpFunction %vertex_main_out None %36
+ %39 = OpLabel
+ %40 = OpFunctionCall %void %vertex_main_1
+ %41 = OpLoad %v4float %tint_symbol_1
+ %42 = OpCompositeConstruct %vertex_main_out %41
+ OpReturnValue %42
OpFunctionEnd
%vertex_main = OpFunction %void None %14
- %42 = OpLabel
- %43 = OpFunctionCall %vertex_main_out %vertex_main_inner
- %44 = OpCompositeExtract %v4float %43 0
- OpStore %tint_symbol_1_1_1 %44
+ %44 = OpLabel
+ %45 = OpFunctionCall %vertex_main_out %vertex_main_inner
+ %46 = OpCompositeExtract %v4float %45 0
+ OpStore %tint_symbol_1_1_1 %46
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main_1 = OpFunction %void None %14
- %47 = OpLabel
- %48 = OpFunctionCall %void %textureDimensions_f60bdb
+ %49 = OpLabel
+ %50 = OpFunctionCall %void %textureDimensions_f60bdb
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
- %50 = OpLabel
- %51 = OpFunctionCall %void %fragment_main_1
+ %52 = OpLabel
+ %53 = OpFunctionCall %void %fragment_main_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %14
- %53 = OpLabel
- %54 = OpFunctionCall %void %textureDimensions_f60bdb
+ %55 = OpLabel
+ %56 = OpFunctionCall %void %textureDimensions_f60bdb
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
- %56 = OpLabel
- %57 = OpFunctionCall %void %compute_main_1
+ %58 = OpLabel
+ %59 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.dxc.hlsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.dxc.hlsl
index 2fd5b5e..5c46dd4 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.dxc.hlsl
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.dxc.hlsl
@@ -5,7 +5,7 @@
int res = 0;
int3 tint_tmp;
arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- const int x_16 = tint_tmp.z;
+ const int x_16 = int(tint_tmp.z);
res = x_16;
return;
}
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.fxc.hlsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.fxc.hlsl
index 2fd5b5e..5c46dd4 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.fxc.hlsl
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.fxc.hlsl
@@ -5,7 +5,7 @@
int res = 0;
int3 tint_tmp;
arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z);
- const int x_16 = tint_tmp.z;
+ const int x_16 = int(tint_tmp.z);
res = x_16;
return;
}
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.glsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.glsl
index 6a38e8a..aeeb396 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.glsl
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.glsl
@@ -6,7 +6,7 @@
uniform highp sampler2DMS arg_0_1;
void textureNumSamples_a3c8a0() {
int res = 0;
- int x_16 = textureSamples(arg_0_1);
+ int x_16 = int(uint(textureSamples(arg_0_1)));
res = x_16;
return;
}
@@ -42,9 +42,8 @@
}
Error parsing GLSL shader:
ERROR: 0:7: 'textureSamples' : no matching overloaded function found
-ERROR: 0:7: '=' : cannot convert from ' const float' to ' temp highp int'
ERROR: 0:7: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
@@ -54,7 +53,7 @@
uniform highp sampler2DMS arg_0_1;
void textureNumSamples_a3c8a0() {
int res = 0;
- int x_16 = textureSamples(arg_0_1);
+ int x_16 = int(uint(textureSamples(arg_0_1)));
res = x_16;
return;
}
@@ -78,9 +77,8 @@
}
Error parsing GLSL shader:
ERROR: 0:7: 'textureSamples' : no matching overloaded function found
-ERROR: 0:7: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:7: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
@@ -89,7 +87,7 @@
uniform highp sampler2DMS arg_0_1;
void textureNumSamples_a3c8a0() {
int res = 0;
- int x_16 = textureSamples(arg_0_1);
+ int x_16 = int(uint(textureSamples(arg_0_1)));
res = x_16;
return;
}
@@ -114,9 +112,8 @@
}
Error parsing GLSL shader:
ERROR: 0:6: 'textureSamples' : no matching overloaded function found
-ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp highp int'
ERROR: 0:6: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.spvasm b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.spvasm
index 9c7f8a5..c23eba7 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.spvasm
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.spvasm
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
-; Bound: 56
+; Bound: 58
; Schema: 0
OpCapability Shader
OpCapability ImageQuery
@@ -51,63 +51,65 @@
%int = OpTypeInt 32 1
%19 = OpConstantNull %int
%_ptr_Function_int = OpTypePointer Function %int
- %24 = OpTypeFunction %void %v4float
+ %uint = OpTypeInt 32 0
+ %26 = OpTypeFunction %void %v4float
%vertex_main_out = OpTypeStruct %v4float
- %32 = OpTypeFunction %vertex_main_out
+ %34 = OpTypeFunction %vertex_main_out
%float_1 = OpConstant %float 1
%textureNumSamples_a3c8a0 = OpFunction %void None %14
%17 = OpLabel
%res = OpVariable %_ptr_Function_int Function %19
OpStore %res %19
- %23 = OpLoad %11 %arg_0
- %22 = OpImageQuerySamples %int %23
+ %25 = OpLoad %11 %arg_0
+ %23 = OpImageQuerySamples %uint %25
+ %22 = OpBitcast %int %23
OpStore %res %22
OpReturn
OpFunctionEnd
-%tint_symbol_2 = OpFunction %void None %24
+%tint_symbol_2 = OpFunction %void None %26
%tint_symbol = OpFunctionParameter %v4float
- %27 = OpLabel
+ %29 = OpLabel
OpStore %tint_symbol_1 %tint_symbol
OpReturn
OpFunctionEnd
%vertex_main_1 = OpFunction %void None %14
- %29 = OpLabel
- %30 = OpFunctionCall %void %textureNumSamples_a3c8a0
- %31 = OpFunctionCall %void %tint_symbol_2 %5
+ %31 = OpLabel
+ %32 = OpFunctionCall %void %textureNumSamples_a3c8a0
+ %33 = OpFunctionCall %void %tint_symbol_2 %5
OpReturn
OpFunctionEnd
-%vertex_main_inner = OpFunction %vertex_main_out None %32
- %35 = OpLabel
- %36 = OpFunctionCall %void %vertex_main_1
- %37 = OpLoad %v4float %tint_symbol_1
- %38 = OpCompositeConstruct %vertex_main_out %37
- OpReturnValue %38
+%vertex_main_inner = OpFunction %vertex_main_out None %34
+ %37 = OpLabel
+ %38 = OpFunctionCall %void %vertex_main_1
+ %39 = OpLoad %v4float %tint_symbol_1
+ %40 = OpCompositeConstruct %vertex_main_out %39
+ OpReturnValue %40
OpFunctionEnd
%vertex_main = OpFunction %void None %14
- %40 = OpLabel
- %41 = OpFunctionCall %vertex_main_out %vertex_main_inner
- %42 = OpCompositeExtract %v4float %41 0
- OpStore %tint_symbol_1_1_1 %42
+ %42 = OpLabel
+ %43 = OpFunctionCall %vertex_main_out %vertex_main_inner
+ %44 = OpCompositeExtract %v4float %43 0
+ OpStore %tint_symbol_1_1_1 %44
OpStore %vertex_point_size %float_1
OpReturn
OpFunctionEnd
%fragment_main_1 = OpFunction %void None %14
- %45 = OpLabel
- %46 = OpFunctionCall %void %textureNumSamples_a3c8a0
+ %47 = OpLabel
+ %48 = OpFunctionCall %void %textureNumSamples_a3c8a0
OpReturn
OpFunctionEnd
%fragment_main = OpFunction %void None %14
- %48 = OpLabel
- %49 = OpFunctionCall %void %fragment_main_1
+ %50 = OpLabel
+ %51 = OpFunctionCall %void %fragment_main_1
OpReturn
OpFunctionEnd
%compute_main_1 = OpFunction %void None %14
- %51 = OpLabel
- %52 = OpFunctionCall %void %textureNumSamples_a3c8a0
+ %53 = OpLabel
+ %54 = OpFunctionCall %void %textureNumSamples_a3c8a0
OpReturn
OpFunctionEnd
%compute_main = OpFunction %void None %14
- %54 = OpLabel
- %55 = OpFunctionCall %void %compute_main_1
+ %56 = OpLabel
+ %57 = OpFunctionCall %void %compute_main_1
OpReturn
OpFunctionEnd
diff --git a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl
index b2c5a8d..c843210 100644
--- a/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl
+++ b/test/tint/builtins/textureNumSamples/depth_ms.spvasm.expected.wgsl
@@ -4,7 +4,7 @@
fn textureNumSamples_a3c8a0() {
var res : i32 = 0i;
- let x_16 : i32 = textureNumSamples(arg_0);
+ let x_16 : i32 = i32(textureNumSamples(arg_0));
res = x_16;
return;
}
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
index ffee0b3..0e04171 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
index b1a7cac..213d7c4 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.glsl
index fce900e..54ae2f0 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_2.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
index 3f50534..d3ba8e3 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.glsl
index 466d054..87f55dd 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_4.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.glsl
index ffee0b3..0e04171 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_5.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.glsl
index b1a7cac..213d7c4 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_6.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.glsl
index 3f50534..d3ba8e3 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_7.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureQueryLevels' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_8.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_8.spvasm.expected.glsl
index 466d054..87f55dd 100644
--- a/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_8.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQueryLevels_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_8.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureQueryLevels(x_20_1);
+ int x_99 = int(uint(textureQueryLevels(x_20_1)));
return;
}
diff --git a/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
index 43c81f6..394a766 100644
--- a/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQuerySamples_SignedResult_SpvParserHandleTest_SampledImageAccessTest_Variable_0.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- int x_99 = textureSamples(x_20_1);
+ int x_99 = int(uint(textureSamples(x_20_1)));
return;
}
@@ -36,9 +36,8 @@
}
Error parsing GLSL shader:
ERROR: 0:23: 'textureSamples' : no matching overloaded function found
-ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:23: '' : compilation terminated
-ERROR: 3 compilation errors. No code generated.
+ERROR: 2 compilation errors. No code generated.
diff --git a/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
index c124d09..8fef0c3 100644
--- a/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_1.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- ivec3 x_99 = ivec3(textureSize(x_20_1, i1).xy.xy, textureSize(x_20_1, 0).z);
+ ivec3 x_99 = ivec3(uvec3(uvec2(textureSize(x_20_1, i1).xy).xy, uint(textureSize(x_20_1, 0).z)));
return;
}
diff --git a/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl b/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
index c124d09..8fef0c3 100644
--- a/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
+++ b/test/tint/unittest/reader/spirv/ImageQuerySizeLod_Arrayed_SignedResult_SignedLevel_SpvParserHandleTest_SampledImageAccessTest_Variable_3.spvasm.expected.glsl
@@ -22,7 +22,7 @@
vec2 coords12 = vf12;
vec3 coords123 = vf123;
vec4 coords1234 = vf1234;
- ivec3 x_99 = ivec3(textureSize(x_20_1, i1).xy.xy, textureSize(x_20_1, 0).z);
+ ivec3 x_99 = ivec3(uvec3(uvec2(textureSize(x_20_1, i1).xy).xy, uint(textureSize(x_20_1, 0).z)));
return;
}