diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index f5af1fbbb0..3ff6360eda 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -266,7 +266,7 @@ std::vector TextureOverloadCase::ValidCases() { }, { ValidTextureOverload::kDimensionsCube, - "textureDimensions(t : texture_cube) -> vec3", + "textureDimensions(t : texture_cube) -> vec2", TextureKind::kRegular, ast::SamplerKind::kSampler, ast::TextureDimension::kCube, @@ -277,7 +277,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsCubeLevel, "textureDimensions(t : texture_cube,\n" - " level : i32) -> vec3", + " level : i32) -> vec2", TextureKind::kRegular, ast::SamplerKind::kSampler, ast::TextureDimension::kCube, @@ -287,7 +287,7 @@ std::vector TextureOverloadCase::ValidCases() { }, { ValidTextureOverload::kDimensionsCubeArray, - "textureDimensions(t : texture_cube_array) -> vec3", + "textureDimensions(t : texture_cube_array) -> vec2", TextureKind::kRegular, ast::SamplerKind::kSampler, ast::TextureDimension::kCubeArray, @@ -298,7 +298,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsCubeArrayLevel, "textureDimensions(t : texture_cube_array,\n" - " level : i32) -> vec3", + " level : i32) -> vec2", TextureKind::kRegular, ast::SamplerKind::kSampler, ast::TextureDimension::kCubeArray, @@ -360,7 +360,7 @@ std::vector TextureOverloadCase::ValidCases() { }, { ValidTextureOverload::kDimensionsDepthCube, - "textureDimensions(t : texture_depth_cube) -> vec3", + "textureDimensions(t : texture_depth_cube) -> vec2", TextureKind::kDepth, ast::SamplerKind::kSampler, ast::TextureDimension::kCube, @@ -371,7 +371,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsDepthCubeLevel, "textureDimensions(t : texture_depth_cube,\n" - " level : i32) -> vec3", + " level : i32) -> vec2", TextureKind::kDepth, ast::SamplerKind::kSampler, ast::TextureDimension::kCube, @@ -381,7 +381,7 @@ std::vector TextureOverloadCase::ValidCases() { }, { ValidTextureOverload::kDimensionsDepthCubeArray, - "textureDimensions(t : texture_depth_cube_array) -> vec3", + "textureDimensions(t : texture_depth_cube_array) -> vec2", TextureKind::kDepth, ast::SamplerKind::kSampler, ast::TextureDimension::kCubeArray, @@ -392,7 +392,7 @@ std::vector TextureOverloadCase::ValidCases() { { ValidTextureOverload::kDimensionsDepthCubeArrayLevel, "textureDimensions(t : texture_depth_cube_array,\n" - " level : i32) -> vec3", + " level : i32) -> vec2", TextureKind::kDepth, ast::SamplerKind::kSampler, ast::TextureDimension::kCubeArray, diff --git a/src/intrinsic_table.inl b/src/intrinsic_table.inl index 4c46077045..e6bf000085 100644 --- a/src/intrinsic_table.inl +++ b/src/intrinsic_table.inl @@ -4874,7 +4874,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[1], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[505], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -4886,7 +4886,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[1], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[467], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -4898,7 +4898,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[1], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[484], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -4910,7 +4910,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[1], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[471], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -4982,7 +4982,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[4], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[481], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -4994,7 +4994,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[4], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[473], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -5006,7 +5006,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[4], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[483], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -5018,7 +5018,7 @@ constexpr OverloadInfo kOverloads[] = { /* open types */ &kOpenTypes[4], /* open numbers */ &kOpenNumbers[7], /* parameters */ &kParameters[469], - /* return matcher indices */ &kMatcherIndices[138], + /* return matcher indices */ &kMatcherIndices[132], /* supported_stages */ PipelineStageSet(PipelineStage::kVertex, PipelineStage::kFragment, PipelineStage::kCompute), /* is_deprecated */ false, }, @@ -8538,19 +8538,19 @@ constexpr IntrinsicInfo kIntrinsics[] = { /* fn textureDimensions(texture: texture_2d_array, level: i32) -> vec2 */ /* fn textureDimensions(texture: texture_3d) -> vec3 */ /* fn textureDimensions(texture: texture_3d, level: i32) -> vec3 */ - /* fn textureDimensions(texture: texture_cube) -> vec3 */ - /* fn textureDimensions(texture: texture_cube, level: i32) -> vec3 */ - /* fn textureDimensions(texture: texture_cube_array) -> vec3 */ - /* fn textureDimensions(texture: texture_cube_array, level: i32) -> vec3 */ + /* fn textureDimensions(texture: texture_cube) -> vec2 */ + /* fn textureDimensions(texture: texture_cube, level: i32) -> vec2 */ + /* fn textureDimensions(texture: texture_cube_array) -> vec2 */ + /* fn textureDimensions(texture: texture_cube_array, level: i32) -> vec2 */ /* fn textureDimensions(texture: texture_multisampled_2d) -> vec2 */ /* fn textureDimensions(texture: texture_depth_2d) -> vec2 */ /* fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2 */ /* fn textureDimensions(texture: texture_depth_2d_array) -> vec2 */ /* fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2 */ - /* fn textureDimensions(texture: texture_depth_cube) -> vec3 */ - /* fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec3 */ - /* fn textureDimensions(texture: texture_depth_cube_array) -> vec3 */ - /* fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec3 */ + /* fn textureDimensions(texture: texture_depth_cube) -> vec2 */ + /* fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2 */ + /* fn textureDimensions(texture: texture_depth_cube_array) -> vec2 */ + /* fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2 */ /* fn textureDimensions(texture: texture_storage_1d) -> i32 */ /* fn textureDimensions(texture: texture_storage_2d) -> vec2 */ /* fn textureDimensions(texture: texture_storage_2d_array) -> vec2 */ diff --git a/src/intrinsic_table_test.cc b/src/intrinsic_table_test.cc index 309d42a37c..d52ee0376a 100644 --- a/src/intrinsic_table_test.cc +++ b/src/intrinsic_table_test.cc @@ -484,23 +484,23 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) { textureDimensions(texture: texture_2d, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d_array, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_3d, level: i32) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube, level: i32) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube_array, level: i32) -> vec3 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube, level: i32) -> vec2 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube_array, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_depth_2d, level: i32) -> vec2 textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2 - textureDimensions(texture: texture_depth_cube, level: i32) -> vec3 - textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec3 + textureDimensions(texture: texture_depth_cube, level: i32) -> vec2 + textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2 textureDimensions(texture: texture_1d) -> i32 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d_array) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_3d) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube_array) -> vec3 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube) -> vec2 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube_array) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_multisampled_2d) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_depth_2d) -> vec2 textureDimensions(texture: texture_depth_2d_array) -> vec2 - textureDimensions(texture: texture_depth_cube) -> vec3 - textureDimensions(texture: texture_depth_cube_array) -> vec3 + textureDimensions(texture: texture_depth_cube) -> vec2 + textureDimensions(texture: texture_depth_cube_array) -> vec2 textureDimensions(texture: texture_storage_1d) -> i32 where: A is read or write textureDimensions(texture: texture_storage_2d) -> vec2 where: A is read or write textureDimensions(texture: texture_storage_2d_array) -> vec2 where: A is read or write @@ -523,21 +523,21 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) { textureDimensions(texture: texture_2d, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d_array, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_3d, level: i32) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube, level: i32) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube_array, level: i32) -> vec3 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube, level: i32) -> vec2 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube_array, level: i32) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2 - textureDimensions(texture: texture_depth_cube, level: i32) -> vec3 - textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec3 + textureDimensions(texture: texture_depth_cube, level: i32) -> vec2 + textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2 textureDimensions(texture: texture_1d) -> i32 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_2d_array) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_3d) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube) -> vec3 where: T is f32, i32 or u32 - textureDimensions(texture: texture_cube_array) -> vec3 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube) -> vec2 where: T is f32, i32 or u32 + textureDimensions(texture: texture_cube_array) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_multisampled_2d) -> vec2 where: T is f32, i32 or u32 textureDimensions(texture: texture_depth_2d_array) -> vec2 - textureDimensions(texture: texture_depth_cube) -> vec3 - textureDimensions(texture: texture_depth_cube_array) -> vec3 + textureDimensions(texture: texture_depth_cube) -> vec2 + textureDimensions(texture: texture_depth_cube_array) -> vec2 textureDimensions(texture: texture_storage_1d) -> i32 where: A is read or write textureDimensions(texture: texture_storage_2d) -> vec2 where: A is read or write textureDimensions(texture: texture_storage_2d_array) -> vec2 where: A is read or write diff --git a/src/intrinsics.def b/src/intrinsics.def index f551ef01c1..4229e730a6 100644 --- a/src/intrinsics.def +++ b/src/intrinsics.def @@ -394,19 +394,19 @@ fn textureDimensions(texture: texture_2d_array) -> vec2 fn textureDimensions(texture: texture_2d_array, level: i32) -> vec2 fn textureDimensions(texture: texture_3d) -> vec3 fn textureDimensions(texture: texture_3d, level: i32) -> vec3 -fn textureDimensions(texture: texture_cube) -> vec3 -fn textureDimensions(texture: texture_cube, level: i32) -> vec3 -fn textureDimensions(texture: texture_cube_array) -> vec3 -fn textureDimensions(texture: texture_cube_array, level: i32) -> vec3 +fn textureDimensions(texture: texture_cube) -> vec2 +fn textureDimensions(texture: texture_cube, level: i32) -> vec2 +fn textureDimensions(texture: texture_cube_array) -> vec2 +fn textureDimensions(texture: texture_cube_array, level: i32) -> vec2 fn textureDimensions(texture: texture_multisampled_2d) -> vec2 fn textureDimensions(texture: texture_depth_2d) -> vec2 fn textureDimensions(texture: texture_depth_2d, level: i32) -> vec2 fn textureDimensions(texture: texture_depth_2d_array) -> vec2 fn textureDimensions(texture: texture_depth_2d_array, level: i32) -> vec2 -fn textureDimensions(texture: texture_depth_cube) -> vec3 -fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec3 -fn textureDimensions(texture: texture_depth_cube_array) -> vec3 -fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec3 +fn textureDimensions(texture: texture_depth_cube) -> vec2 +fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2 +fn textureDimensions(texture: texture_depth_cube_array) -> vec2 +fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2 fn textureDimensions(texture: texture_storage_1d) -> i32 fn textureDimensions(texture: texture_storage_2d) -> vec2 fn textureDimensions(texture: texture_storage_2d_array) -> vec2 diff --git a/src/resolver/intrinsic_test.cc b/src/resolver/intrinsic_test.cc index 7363d9037b..34ed7f0273 100644 --- a/src/resolver/intrinsic_test.cc +++ b/src/resolver/intrinsic_test.cc @@ -1969,16 +1969,16 @@ TEST_P(ResolverIntrinsicTest_Texture, Call) { EXPECT_TRUE(TypeOf(call)->Is()); break; case ast::TextureDimension::k2d: - case ast::TextureDimension::k2dArray: { + case ast::TextureDimension::k2dArray: + case ast::TextureDimension::kCube: + case ast::TextureDimension::kCubeArray: { auto* vec = As(TypeOf(call)); ASSERT_NE(vec, nullptr); EXPECT_EQ(vec->size(), 2u); EXPECT_TRUE(vec->type()->Is()); break; } - case ast::TextureDimension::k3d: - case ast::TextureDimension::kCube: - case ast::TextureDimension::kCubeArray: { + case ast::TextureDimension::k3d: { auto* vec = As(TypeOf(call)); ASSERT_NE(vec, nullptr); EXPECT_EQ(vec->size(), 3u); diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index b9cd81c2e4..2d164f0129 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -1415,16 +1415,11 @@ bool GeneratorImpl::EmitTextureCall(std::ostream& pre, num_dimensions = 3; break; case ast::TextureDimension::kCube: - // width == height == depth for cubes - // See https://github.com/gpuweb/gpuweb/issues/1345 num_dimensions = 2; - swizzle = ".xyy"; // [width, height, height] break; case ast::TextureDimension::kCubeArray: - // width == height == depth for cubes - // See https://github.com/gpuweb/gpuweb/issues/1345 num_dimensions = 3; - swizzle = ".xyy"; // [width, height, height] + swizzle = ".xy"; break; } break; diff --git a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc index d468fd601b..e35e50315f 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc @@ -89,7 +89,7 @@ ExpectedResult expected_texture_overload( R"(int2 tint_tmp; tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y); )", - "tint_tmp.xyy", + "tint_tmp", }; case ValidTextureOverload::kDimensionsCubeArray: case ValidTextureOverload::kDimensionsDepthCubeArray: @@ -97,7 +97,7 @@ ExpectedResult expected_texture_overload( R"(int3 tint_tmp; tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); )", - "tint_tmp.xyy", + "tint_tmp.xy", }; case ValidTextureOverload::kDimensions2dLevel: case ValidTextureOverload::kDimensionsDepth2dLevel: @@ -128,7 +128,7 @@ ExpectedResult expected_texture_overload( R"(int3 tint_tmp; tint_symbol.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z); )", - "tint_tmp.xyy", + "tint_tmp.xy", }; case ValidTextureOverload::kDimensionsCubeArrayLevel: case ValidTextureOverload::kDimensionsDepthCubeArrayLevel: @@ -136,7 +136,7 @@ ExpectedResult expected_texture_overload( R"(int4 tint_tmp; tint_symbol.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); )", - "tint_tmp.xyy", + "tint_tmp.xy", }; case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index cfc51cc8d8..9fea868ace 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -464,17 +464,13 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, break; case ast::TextureDimension::k2d: case ast::TextureDimension::k2dArray: + case ast::TextureDimension::kCube: + case ast::TextureDimension::kCubeArray: dims = {"width", "height"}; break; case ast::TextureDimension::k3d: dims = {"width", "height", "depth"}; break; - case ast::TextureDimension::kCube: - case ast::TextureDimension::kCubeArray: - // width == height == depth for cubes - // See https://github.com/gpuweb/gpuweb/issues/1345 - dims = {"width", "height", "height"}; - break; } auto get_dim = [&](const char* name) { diff --git a/src/writer/msl/generator_impl_intrinsic_texture_test.cc b/src/writer/msl/generator_impl_intrinsic_texture_test.cc index ff2b0eb6f3..bf6958eeab 100644 --- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc @@ -31,9 +31,13 @@ std::string expected_texture_overload( return R"(int(texture.get_width()))"; case ValidTextureOverload::kDimensions2d: case ValidTextureOverload::kDimensions2dArray: + case ValidTextureOverload::kDimensionsCube: + case ValidTextureOverload::kDimensionsCubeArray: case ValidTextureOverload::kDimensionsMultisampled2d: case ValidTextureOverload::kDimensionsDepth2d: case ValidTextureOverload::kDimensionsDepth2dArray: + case ValidTextureOverload::kDimensionsDepthCube: + case ValidTextureOverload::kDimensionsDepthCubeArray: case ValidTextureOverload::kDimensionsStorageRO2d: case ValidTextureOverload::kDimensionsStorageRO2dArray: case ValidTextureOverload::kDimensionsStorageWO2d: @@ -43,23 +47,17 @@ std::string expected_texture_overload( case ValidTextureOverload::kDimensionsStorageRO3d: case ValidTextureOverload::kDimensionsStorageWO3d: return R"(int3(texture.get_width(), texture.get_height(), texture.get_depth()))"; - case ValidTextureOverload::kDimensionsCube: - case ValidTextureOverload::kDimensionsCubeArray: - case ValidTextureOverload::kDimensionsDepthCube: - case ValidTextureOverload::kDimensionsDepthCubeArray: - return R"(int3(texture.get_width(), texture.get_height(), texture.get_height()))"; case ValidTextureOverload::kDimensions2dLevel: + case ValidTextureOverload::kDimensionsCubeLevel: + case ValidTextureOverload::kDimensionsCubeArrayLevel: case ValidTextureOverload::kDimensions2dArrayLevel: case ValidTextureOverload::kDimensionsDepth2dLevel: case ValidTextureOverload::kDimensionsDepth2dArrayLevel: + case ValidTextureOverload::kDimensionsDepthCubeLevel: + case ValidTextureOverload::kDimensionsDepthCubeArrayLevel: return R"(int2(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)))"; - case ValidTextureOverload::kDimensionsCubeLevel: - case ValidTextureOverload::kDimensionsCubeArrayLevel: - case ValidTextureOverload::kDimensionsDepthCubeLevel: - case ValidTextureOverload::kDimensionsDepthCubeArrayLevel: - return R"(int3(texture.get_width(1), texture.get_height(1), texture.get_height(1)))"; case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersCubeArray: case ValidTextureOverload::kNumLayersDepth2dArray: diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index 32dae138bb..463e8228c0 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -2662,19 +2662,13 @@ bool Builder::GenerateTextureIntrinsic(ast::CallExpression* call, case ast::TextureDimension::k1d: case ast::TextureDimension::k2d: case ast::TextureDimension::k3d: - break; // No swizzle needed case ast::TextureDimension::kCube: - swizzle = {0, 1, 1}; // Duplicate height for depth - spirv_dims = 2; // [width, height] - break; + break; // No swizzle needed + case ast::TextureDimension::kCubeArray: case ast::TextureDimension::k2dArray: swizzle = {0, 1}; // Strip array index spirv_dims = 3; // [width, height, array_count] break; - case ast::TextureDimension::kCubeArray: - swizzle = {0, 1, 1}; // Strip array index, duplicate height for depth - spirv_dims = 3; // [width, height, array_count] - break; } if (!append_result_type_and_id_to_spirv_params_swizzled(spirv_dims, diff --git a/src/writer/spirv/builder_intrinsic_texture_test.cc b/src/writer/spirv/builder_intrinsic_texture_test.cc index dc96667f47..2197133bd9 100644 --- a/src/writer/spirv/builder_intrinsic_texture_test.cc +++ b/src/writer/spirv/builder_intrinsic_texture_test.cc @@ -196,14 +196,12 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%12 = OpTypeVector %10 2 -%14 = OpConstant %10 0 +%9 = OpTypeVector %10 2 +%12 = OpConstant %10 0 )", R"( -%13 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %12 %13 %14 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%11 = OpLoad %3 %1 +%8 = OpImageQuerySizeLod %9 %11 %12 )", R"( OpCapability ImageQuery @@ -219,14 +217,12 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%12 = OpTypeVector %10 2 -%14 = OpConstant %10 1 +%9 = OpTypeVector %10 2 +%12 = OpConstant %10 1 )", R"( -%13 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %12 %13 %14 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%11 = OpLoad %3 %1 +%8 = OpImageQuerySizeLod %9 %11 %12 )", R"( OpCapability ImageQuery @@ -242,13 +238,14 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%13 = OpConstant %10 0 +%9 = OpTypeVector %10 2 +%12 = OpTypeVector %10 3 +%14 = OpConstant %10 0 )", R"( -%12 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %9 %12 %13 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%13 = OpLoad %3 %1 +%11 = OpImageQuerySizeLod %12 %13 %14 +%8 = OpVectorShuffle %9 %11 %11 0 1 )", R"( OpCapability SampledCubeArray @@ -265,13 +262,14 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%13 = OpConstant %10 1 +%9 = OpTypeVector %10 2 +%12 = OpTypeVector %10 3 +%14 = OpConstant %10 1 )", R"( -%12 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %9 %12 %13 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%13 = OpLoad %3 %1 +%11 = OpImageQuerySizeLod %12 %13 %14 +%8 = OpVectorShuffle %9 %11 %11 0 1 )", R"( OpCapability SampledCubeArray @@ -396,14 +394,12 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%12 = OpTypeVector %10 2 -%14 = OpConstant %10 0 +%9 = OpTypeVector %10 2 +%12 = OpConstant %10 0 )", R"( -%13 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %12 %13 %14 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%11 = OpLoad %3 %1 +%8 = OpImageQuerySizeLod %9 %11 %12 )", R"( OpCapability ImageQuery @@ -419,14 +415,12 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%12 = OpTypeVector %10 2 -%14 = OpConstant %10 1 +%9 = OpTypeVector %10 2 +%12 = OpConstant %10 1 )", R"( -%13 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %12 %13 %14 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%11 = OpLoad %3 %1 +%8 = OpImageQuerySizeLod %9 %11 %12 )", R"( OpCapability ImageQuery @@ -442,13 +436,14 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%13 = OpConstant %10 0 +%9 = OpTypeVector %10 2 +%12 = OpTypeVector %10 3 +%14 = OpConstant %10 0 )", R"( -%12 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %9 %12 %13 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%13 = OpLoad %3 %1 +%11 = OpImageQuerySizeLod %12 %13 %14 +%8 = OpVectorShuffle %9 %11 %11 0 1 )", R"( OpCapability SampledCubeArray @@ -465,13 +460,14 @@ OpCapability ImageQuery %6 = OpTypePointer UniformConstant %7 %5 = OpVariable %6 UniformConstant %10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 3 -%13 = OpConstant %10 1 +%9 = OpTypeVector %10 2 +%12 = OpTypeVector %10 3 +%14 = OpConstant %10 1 )", R"( -%12 = OpLoad %3 %1 -%11 = OpImageQuerySizeLod %9 %12 %13 -%8 = OpVectorShuffle %9 %11 %11 0 1 1 +%13 = OpLoad %3 %1 +%11 = OpImageQuerySizeLod %12 %13 %14 +%8 = OpVectorShuffle %9 %11 %11 0 1 )", R"( OpCapability SampledCubeArray diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl b/test/intrinsics/gen/textureDimensions/221f22.wgsl similarity index 86% rename from test/intrinsics/gen/textureDimensions/e22247.wgsl rename to test/intrinsics/gen/textureDimensions/221f22.wgsl index 16e1cc673d..9d42d2b2a4 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl +++ b/test/intrinsics/gen/textureDimensions/221f22.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec3 -fn textureDimensions_e22247() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec2 +fn textureDimensions_221f22() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_e22247(); + textureDimensions_221f22(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); } [[stage(compute)]] fn compute_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); } diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.hlsl similarity index 73% rename from test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.hlsl index 77a718665a..02eb32157b 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_e22247() { +void textureDimensions_221f22() { int4 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); return; } diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.msl index 907634aa82..b4e04ef358 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_f70326(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_221f22(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_f70326(tint_symbol_3); + textureDimensions_221f22(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_f70326(tint_symbol_4); + textureDimensions_221f22(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_f70326(tint_symbol_5); + textureDimensions_221f22(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.spvasm index d419675a9b..5703541dfb 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.spvasm @@ -15,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_91f42d "textureDimensions_91f42d" + OpName %textureDimensions_221f22 "textureDimensions_221f22" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,8 +30,8 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %uint = OpTypeInt 32 0 - %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,19 +40,19 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_91f42d = OpFunction %void None %13 +%textureDimensions_221f22 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %20 = OpImageQuerySizeLod %v3int %21 %int_1 - %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %17 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %17 OpReturn OpFunctionEnd @@ -65,17 +65,17 @@ %vertex_main = OpFunction %void None %13 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_91f42d + %33 = OpFunctionCall %void %textureDimensions_221f22 %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_91f42d + %37 = OpFunctionCall %void %textureDimensions_221f22 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_91f42d + %40 = OpFunctionCall %void %textureDimensions_221f22 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.wgsl index 7e079edc50..236cd89739 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/221f22.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_e22247() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_221f22() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_e22247(); + textureDimensions_221f22(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); } [[stage(compute)]] fn compute_main() { - textureDimensions_e22247(); + textureDimensions_221f22(); } diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.spvasm deleted file mode 100644 index 70fa4731fc..0000000000 --- a/test/intrinsics/gen/textureDimensions/3e0403.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 SampledCubeArray - OpCapability ImageQuery - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 - OpEntryPoint Fragment %fragment_main "fragment_main" - OpEntryPoint GLCompute %compute_main "compute_main" - OpExecutionMode %fragment_main OriginUpperLeft - OpExecutionMode %compute_main LocalSize 1 1 1 - OpName %tint_pointsize "tint_pointsize" - OpName %arg_0 "arg_0" - OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_3e0403 "textureDimensions_3e0403" - OpName %res "res" - OpName %tint_symbol_2 "tint_symbol_2" - OpName %tint_symbol "tint_symbol" - OpName %vertex_main "vertex_main" - OpName %fragment_main "fragment_main" - OpName %compute_main "compute_main" - OpDecorate %tint_pointsize BuiltIn PointSize - OpDecorate %arg_0 DescriptorSet 1 - OpDecorate %arg_0 Binding 0 - OpDecorate %tint_symbol_1 BuiltIn Position - %float = OpTypeFloat 32 -%_ptr_Output_float = OpTypePointer Output %float - %4 = OpConstantNull %float -%tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 0 1 0 1 Unknown -%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 - %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %11 = OpConstantNull %v4float -%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 - %void = OpTypeVoid - %12 = 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 %void %v4float - %float_1 = OpConstant %float 1 -%textureDimensions_3e0403 = OpFunction %void None %12 - %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 - %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_0 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 - OpStore %res %16 - OpReturn - OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %25 -%tint_symbol = OpFunctionParameter %v4float - %28 = OpLabel - OpStore %tint_symbol_1 %tint_symbol - OpReturn - OpFunctionEnd -%vertex_main = OpFunction %void None %12 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_3e0403 - %33 = OpFunctionCall %void %tint_symbol_2 %11 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %12 - %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_3e0403 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %12 - %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_3e0403 - OpReturn - OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.spvasm deleted file mode 100644 index b8f6b671bc..0000000000 --- a/test/intrinsics/gen/textureDimensions/3e626d.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 SampledCubeArray - OpCapability ImageQuery - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 - OpEntryPoint Fragment %fragment_main "fragment_main" - OpEntryPoint GLCompute %compute_main "compute_main" - OpExecutionMode %fragment_main OriginUpperLeft - OpExecutionMode %compute_main LocalSize 1 1 1 - OpName %tint_pointsize "tint_pointsize" - OpName %arg_0 "arg_0" - OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_3e626d "textureDimensions_3e626d" - OpName %res "res" - OpName %tint_symbol_2 "tint_symbol_2" - OpName %tint_symbol "tint_symbol" - OpName %vertex_main "vertex_main" - OpName %fragment_main "fragment_main" - OpName %compute_main "compute_main" - OpDecorate %tint_pointsize BuiltIn PointSize - OpDecorate %arg_0 DescriptorSet 1 - OpDecorate %arg_0 Binding 0 - OpDecorate %tint_symbol_1 BuiltIn Position - %float = OpTypeFloat 32 -%_ptr_Output_float = OpTypePointer Output %float - %4 = OpConstantNull %float -%tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 1 1 0 1 Unknown -%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 - %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %11 = OpConstantNull %v4float -%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 - %void = OpTypeVoid - %12 = 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 %void %v4float - %float_1 = OpConstant %float 1 -%textureDimensions_3e626d = OpFunction %void None %12 - %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 - %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_1 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 - OpStore %res %16 - OpReturn - OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %25 -%tint_symbol = OpFunctionParameter %v4float - %28 = OpLabel - OpStore %tint_symbol_1 %tint_symbol - OpReturn - OpFunctionEnd -%vertex_main = OpFunction %void None %12 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_3e626d - %33 = OpFunctionCall %void %tint_symbol_2 %11 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %12 - %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_3e626d - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %12 - %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_3e626d - OpReturn - OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl b/test/intrinsics/gen/textureDimensions/4152a6.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/183b3e.wgsl rename to test/intrinsics/gen/textureDimensions/4152a6.wgsl index 6734ba4012..4beadf2317 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl +++ b/test/intrinsics/gen/textureDimensions/4152a6.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array) -> vec3 -fn textureDimensions_183b3e() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube_array) -> vec2 +fn textureDimensions_4152a6() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_183b3e(); + textureDimensions_4152a6(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); } [[stage(compute)]] fn compute_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); } diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.hlsl index 9c73c8c768..bb071aa1b6 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_183b3e() { +void textureDimensions_4152a6() { int3 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); return; } diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.msl index 29b1d23621..cc33fd3bf9 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_183b3e(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_4152a6(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_183b3e(tint_symbol_3); + textureDimensions_4152a6(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_183b3e(tint_symbol_4); + textureDimensions_4152a6(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_183b3e(tint_symbol_5); + textureDimensions_4152a6(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.spvasm index 78971ba8e2..e001490507 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 42 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_1ebd6a "textureDimensions_1ebd6a" + OpName %textureDimensions_4152a6 "textureDimensions_4152a6" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,7 +31,7 @@ %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 %uint = OpTypeInt 32 0 - %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown + %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,19 +41,19 @@ %void = OpTypeVoid %13 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %26 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %26 = OpConstantNull %v2int %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_1ebd6a = OpFunction %void None %13 +%textureDimensions_4152a6 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %26 + %res = OpVariable %_ptr_Function_v2int Function %26 %22 = OpLoad %7 %arg_0 - %20 = OpImageQuerySizeLod %v2int %22 %int_0 - %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + %20 = OpImageQuerySizeLod %v3int %22 %int_0 + %17 = OpVectorShuffle %v2int %20 %20 0 1 OpStore %res %17 OpReturn OpFunctionEnd @@ -65,17 +66,17 @@ %vertex_main = OpFunction %void None %13 %32 = OpLabel OpStore %tint_pointsize %float_1 - %34 = OpFunctionCall %void %textureDimensions_1ebd6a + %34 = OpFunctionCall %void %textureDimensions_4152a6 %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %37 = OpLabel - %38 = OpFunctionCall %void %textureDimensions_1ebd6a + %38 = OpFunctionCall %void %textureDimensions_4152a6 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %40 = OpLabel - %41 = OpFunctionCall %void %textureDimensions_1ebd6a + %41 = OpFunctionCall %void %textureDimensions_4152a6 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.wgsl similarity index 59% rename from test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.wgsl index e42d888183..b7f7436dde 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/4152a6.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_183b3e() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_4152a6() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_183b3e(); + textureDimensions_4152a6(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); } [[stage(compute)]] fn compute_main() { - textureDimensions_183b3e(); + textureDimensions_4152a6(); } diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl similarity index 86% rename from test/intrinsics/gen/textureDimensions/eda4e3.wgsl rename to test/intrinsics/gen/textureDimensions/50a9ee.wgsl index cd68133982..5c2f5c049d 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl +++ b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec3 -fn textureDimensions_eda4e3() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec2 +fn textureDimensions_50a9ee() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); } [[stage(compute)]] fn compute_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); } diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.hlsl similarity index 73% rename from test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.hlsl index fe2d9a27aa..3e0a37298a 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_eda4e3() { +void textureDimensions_50a9ee() { int4 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); return; } diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.msl index 37315f73a5..8787cf30b1 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_3e0403(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_50a9ee(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_3e0403(tint_symbol_3); + textureDimensions_50a9ee(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_3e0403(tint_symbol_4); + textureDimensions_50a9ee(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_3e0403(tint_symbol_5); + textureDimensions_50a9ee(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.spvasm index b8bad8fa2d..db646ea746 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 41 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_75be9d "textureDimensions_75be9d" + OpName %textureDimensions_50a9ee "textureDimensions_50a9ee" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -29,7 +30,7 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 0 0 0 1 Unknown + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -39,19 +40,19 @@ %void = OpTypeVoid %12 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_75be9d = OpFunction %void None %12 +%textureDimensions_50a9ee = OpFunction %void None %12 %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_1 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %16 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %16 OpReturn OpFunctionEnd @@ -64,17 +65,17 @@ %vertex_main = OpFunction %void None %12 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_75be9d + %33 = OpFunctionCall %void %textureDimensions_50a9ee %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %12 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_75be9d + %37 = OpFunctionCall %void %textureDimensions_50a9ee OpReturn OpFunctionEnd %compute_main = OpFunction %void None %12 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_75be9d + %40 = OpFunctionCall %void %textureDimensions_50a9ee OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.wgsl index 64770e4206..f20e0d3b84 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/50a9ee.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_eda4e3() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_50a9ee() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); } [[stage(compute)]] fn compute_main() { - textureDimensions_eda4e3(); + textureDimensions_50a9ee(); } diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl b/test/intrinsics/gen/textureDimensions/57e28f.wgsl similarity index 83% rename from test/intrinsics/gen/textureDimensions/76e722.wgsl rename to test/intrinsics/gen/textureDimensions/57e28f.wgsl index a7d62bcd6e..402c565560 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl +++ b/test/intrinsics/gen/textureDimensions/57e28f.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_depth_cube; -// fn textureDimensions(texture: texture_depth_cube) -> vec3 -fn textureDimensions_76e722() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_depth_cube) -> vec2 +fn textureDimensions_57e28f() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_76e722(); + textureDimensions_57e28f(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); } [[stage(compute)]] fn compute_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); } diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.hlsl similarity index 71% rename from test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.hlsl index 9f7983bdb6..0e3f59c7dc 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_76e722() { +void textureDimensions_57e28f() { int2 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); return; } diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.msl index acb5195070..15dec6dc2d 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_76e722(depthcube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_57e28f(depthcube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(depthcube tint_symbol_3 [[texture(0)]]) { - textureDimensions_76e722(tint_symbol_3); + textureDimensions_57e28f(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(depthcube tint_symbol_4 [[texture(0)]]) { - textureDimensions_76e722(tint_symbol_4); + textureDimensions_57e28f(tint_symbol_4); return; } kernel void compute_main(depthcube tint_symbol_5 [[texture(0)]]) { - textureDimensions_76e722(tint_symbol_5); + textureDimensions_57e28f(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.spvasm new file mode 100644 index 0000000000..9ba18c9895 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/57e28f.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" %tint_pointsize %tint_symbol_1 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %textureDimensions_57e28f "textureDimensions_57e28f" + OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %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 %void %v4float + %float_1 = OpConstant %float 1 +%textureDimensions_57e28f = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %16 + OpReturn + OpFunctionEnd +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 + %31 = OpFunctionCall %void %textureDimensions_57e28f + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_57e28f + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_57e28f + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.wgsl index 3f69e91fdd..cd14d51473 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/57e28f.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_depth_cube; -fn textureDimensions_76e722() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_57e28f() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_76e722(); + textureDimensions_57e28f(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); } [[stage(compute)]] fn compute_main() { - textureDimensions_76e722(); + textureDimensions_57e28f(); } diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl b/test/intrinsics/gen/textureDimensions/686ef2.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/7bb707.wgsl rename to test/intrinsics/gen/textureDimensions/686ef2.wgsl index 5f931106fe..9319eb3da3 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl +++ b/test/intrinsics/gen/textureDimensions/686ef2.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube, level: i32) -> vec3 -fn textureDimensions_7bb707() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube, level: i32) -> vec2 +fn textureDimensions_686ef2() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_7bb707(); + textureDimensions_686ef2(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); } [[stage(compute)]] fn compute_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); } diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.hlsl index 0010c33936..bae37d512d 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_7bb707() { +void textureDimensions_686ef2() { int3 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); return; } diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.msl index 6870fbbe85..777d0c2441 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_cccc17(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_686ef2(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_cccc17(tint_symbol_3); + textureDimensions_686ef2(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_cccc17(tint_symbol_4); + textureDimensions_686ef2(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_cccc17(tint_symbol_5); + textureDimensions_686ef2(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.spvasm similarity index 74% rename from test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.spvasm index d810420571..c7253e2dcf 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 41 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery @@ -14,7 +14,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_7bb707 "textureDimensions_7bb707" + OpName %textureDimensions_686ef2 "textureDimensions_686ef2" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -39,42 +39,40 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int - %26 = OpTypeFunction %void %v4float +%_ptr_Function_v2int = OpTypePointer Function %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_7bb707 = OpFunction %void None %13 +%textureDimensions_686ef2 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 - %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_1 - %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %19 %int_1 OpStore %res %17 OpReturn OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol_2 = OpFunction %void None %24 %tint_symbol = OpFunctionParameter %v4float - %29 = OpLabel + %27 = OpLabel OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd %vertex_main = OpFunction %void None %13 - %31 = OpLabel + %29 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_7bb707 - %34 = OpFunctionCall %void %tint_symbol_2 %12 + %31 = OpFunctionCall %void %textureDimensions_686ef2 + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 - %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_7bb707 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_686ef2 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 - %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_7bb707 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_686ef2 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.wgsl index ed56d4e8ce..bf5b55a539 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/686ef2.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_7bb707() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_686ef2() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_7bb707(); + textureDimensions_686ef2(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); } [[stage(compute)]] fn compute_main() { - textureDimensions_7bb707(); + textureDimensions_686ef2(); } diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl b/test/intrinsics/gen/textureDimensions/88ad17.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/5ec4e1.wgsl rename to test/intrinsics/gen/textureDimensions/88ad17.wgsl index c6cce0582a..5ac780632e 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl +++ b/test/intrinsics/gen/textureDimensions/88ad17.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube, level: i32) -> vec3 -fn textureDimensions_5ec4e1() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube, level: i32) -> vec2 +fn textureDimensions_88ad17() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); } [[stage(compute)]] fn compute_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); } diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.hlsl index 8220a44657..49805c2013 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_5ec4e1() { +void textureDimensions_88ad17() { int3 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); return; } diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.msl index 8dfb0e41ab..6a875fe2f7 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_1ebd6a(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_88ad17(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_1ebd6a(tint_symbol_3); + textureDimensions_88ad17(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_1ebd6a(tint_symbol_4); + textureDimensions_88ad17(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_1ebd6a(tint_symbol_5); + textureDimensions_88ad17(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.spvasm similarity index 79% rename from test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.spvasm index 26499875fd..1deede95a3 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.spvasm @@ -4,7 +4,6 @@ ; Bound: 40 ; Schema: 0 OpCapability Shader - OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -15,7 +14,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_e22247 "textureDimensions_e22247" + OpName %textureDimensions_88ad17 "textureDimensions_88ad17" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,8 +29,8 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %int = OpTypeInt 32 1 - %7 = OpTypeImage %int Cube 0 1 0 1 Unknown + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,18 +39,18 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %v3int = OpTypeVector %int 3 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %24 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %24 = OpConstantNull %v2int %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_e22247 = OpFunction %void None %13 +%textureDimensions_88ad17 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 + %res = OpVariable %_ptr_Function_v2int Function %24 %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_1 - %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + %17 = OpImageQuerySizeLod %v2int %20 %int_1 OpStore %res %17 OpReturn OpFunctionEnd @@ -64,17 +63,17 @@ %vertex_main = OpFunction %void None %13 %30 = OpLabel OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_e22247 + %32 = OpFunctionCall %void %textureDimensions_88ad17 %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_e22247 + %36 = OpFunctionCall %void %textureDimensions_88ad17 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_e22247 + %39 = OpFunctionCall %void %textureDimensions_88ad17 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.wgsl index e6ed80b13b..d41c88ae8b 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/88ad17.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_5ec4e1() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_88ad17() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); } [[stage(compute)]] fn compute_main() { - textureDimensions_5ec4e1(); + textureDimensions_88ad17(); } diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/3e0403.wgsl rename to test/intrinsics/gen/textureDimensions/8f20bf.wgsl index ddd67874ce..6f05368624 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl +++ b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array) -> vec3 -fn textureDimensions_3e0403() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube_array) -> vec2 +fn textureDimensions_8f20bf() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); } [[stage(compute)]] fn compute_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); } diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.hlsl index 27b35b9af8..6c6fa65a5c 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_3e0403() { +void textureDimensions_8f20bf() { int3 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); return; } diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.msl index 5cc7d40200..5246f3fdd9 100644 --- a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_eda4e3(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_8f20bf(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_eda4e3(tint_symbol_3); + textureDimensions_8f20bf(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_eda4e3(tint_symbol_4); + textureDimensions_8f20bf(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_eda4e3(tint_symbol_5); + textureDimensions_8f20bf(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.spvasm index 4e489d1f8d..baedba3a2a 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 41 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_f507c9 "textureDimensions_f507c9" + OpName %textureDimensions_8f20bf "textureDimensions_8f20bf" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -29,7 +30,7 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 0 0 0 1 Unknown + %7 = OpTypeImage %float Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -39,19 +40,19 @@ %void = OpTypeVoid %12 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f507c9 = OpFunction %void None %12 +%textureDimensions_8f20bf = OpFunction %void None %12 %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_0 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %16 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %16 OpReturn OpFunctionEnd @@ -64,17 +65,17 @@ %vertex_main = OpFunction %void None %12 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_f507c9 + %33 = OpFunctionCall %void %textureDimensions_8f20bf %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %12 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_f507c9 + %37 = OpFunctionCall %void %textureDimensions_8f20bf OpReturn OpFunctionEnd %compute_main = OpFunction %void None %12 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_f507c9 + %40 = OpFunctionCall %void %textureDimensions_8f20bf OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.wgsl similarity index 59% rename from test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.wgsl index a9a3da0cf4..2179c770ee 100644 --- a/test/intrinsics/gen/textureDimensions/3e0403.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/8f20bf.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_3e0403() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_8f20bf() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); } [[stage(compute)]] fn compute_main() { - textureDimensions_3e0403(); + textureDimensions_8f20bf(); } diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl b/test/intrinsics/gen/textureDimensions/90340b.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/bdf2ee.wgsl rename to test/intrinsics/gen/textureDimensions/90340b.wgsl index ee31435e06..17e8d86a23 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl +++ b/test/intrinsics/gen/textureDimensions/90340b.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_depth_cube_array; -// fn textureDimensions(texture: texture_depth_cube_array) -> vec3 -fn textureDimensions_bdf2ee() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_depth_cube_array) -> vec2 +fn textureDimensions_90340b() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); } [[stage(compute)]] fn compute_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); } diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.hlsl index 0d2ed8951d..e6c4a4ecaf 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_bdf2ee() { +void textureDimensions_90340b() { int3 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); return; } diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.msl index 1d2d53e029..27ab85e7c5 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_bdf2ee(depthcube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_90340b(depthcube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(depthcube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_bdf2ee(tint_symbol_3); + textureDimensions_90340b(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(depthcube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_bdf2ee(tint_symbol_4); + textureDimensions_90340b(tint_symbol_4); return; } kernel void compute_main(depthcube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_bdf2ee(tint_symbol_5); + textureDimensions_90340b(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.spvasm index 153c14b8d5..62d5f91b57 100644 --- a/test/intrinsics/gen/textureDimensions/76e722.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 41 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_76e722 "textureDimensions_76e722" + OpName %textureDimensions_90340b "textureDimensions_90340b" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -29,7 +30,7 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 1 0 0 1 Unknown + %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -39,19 +40,19 @@ %void = OpTypeVoid %12 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_76e722 = OpFunction %void None %12 +%textureDimensions_90340b = OpFunction %void None %12 %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_0 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %16 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %16 OpReturn OpFunctionEnd @@ -64,17 +65,17 @@ %vertex_main = OpFunction %void None %12 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_76e722 + %33 = OpFunctionCall %void %textureDimensions_90340b %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %12 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_76e722 + %37 = OpFunctionCall %void %textureDimensions_90340b OpReturn OpFunctionEnd %compute_main = OpFunction %void None %12 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_76e722 + %40 = OpFunctionCall %void %textureDimensions_90340b OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.wgsl similarity index 59% rename from test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.wgsl index f16cd62e38..2d23b1cabd 100644 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/90340b.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; -fn textureDimensions_bdf2ee() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_90340b() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); } [[stage(compute)]] fn compute_main() { - textureDimensions_bdf2ee(); + textureDimensions_90340b(); } diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl b/test/intrinsics/gen/textureDimensions/9393b0.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/a6ca1c.wgsl rename to test/intrinsics/gen/textureDimensions/9393b0.wgsl index 828786a20d..e302e1434d 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl +++ b/test/intrinsics/gen/textureDimensions/9393b0.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_depth_cube; -// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec3 -fn textureDimensions_a6ca1c() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_depth_cube, level: i32) -> vec2 +fn textureDimensions_9393b0() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); } [[stage(compute)]] fn compute_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); } diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.hlsl index 51f6a0bf1e..6adbddbef2 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_a6ca1c() { +void textureDimensions_9393b0() { int3 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); return; } diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.msl index 4613cec7fa..d26fb35b94 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_a6ca1c(depthcube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_9393b0(depthcube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(depthcube tint_symbol_3 [[texture(0)]]) { - textureDimensions_a6ca1c(tint_symbol_3); + textureDimensions_9393b0(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(depthcube tint_symbol_4 [[texture(0)]]) { - textureDimensions_a6ca1c(tint_symbol_4); + textureDimensions_9393b0(tint_symbol_4); return; } kernel void compute_main(depthcube tint_symbol_5 [[texture(0)]]) { - textureDimensions_a6ca1c(tint_symbol_5); + textureDimensions_9393b0(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.spvasm new file mode 100644 index 0000000000..efacb01a94 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/9393b0.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" %tint_pointsize %tint_symbol_1 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %textureDimensions_9393b0 "textureDimensions_9393b0" + OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 1 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %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 %void %v4float + %float_1 = OpConstant %float 1 +%textureDimensions_9393b0 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_1 + OpStore %res %16 + OpReturn + OpFunctionEnd +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 + %31 = OpFunctionCall %void %textureDimensions_9393b0 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_9393b0 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_9393b0 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.wgsl index 1efb31a0a4..562e949993 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/9393b0.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_depth_cube; -fn textureDimensions_a6ca1c() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_9393b0() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); } [[stage(compute)]] fn compute_main() { - textureDimensions_a6ca1c(); + textureDimensions_9393b0(); } diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl b/test/intrinsics/gen/textureDimensions/962dcd.wgsl similarity index 83% rename from test/intrinsics/gen/textureDimensions/cccc17.wgsl rename to test/intrinsics/gen/textureDimensions/962dcd.wgsl index cc3e0db572..b73672d5d7 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl +++ b/test/intrinsics/gen/textureDimensions/962dcd.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube) -> vec3 -fn textureDimensions_cccc17() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube) -> vec2 +fn textureDimensions_962dcd() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_cccc17(); + textureDimensions_962dcd(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); } [[stage(compute)]] fn compute_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); } diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.hlsl similarity index 71% rename from test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.hlsl index 3cebd21312..a227731739 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_cccc17() { +void textureDimensions_962dcd() { int2 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); return; } diff --git a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.msl index 8ec9b7540e..a329b9cd39 100644 --- a/test/intrinsics/gen/textureDimensions/7bb707.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_7bb707(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_962dcd(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_7bb707(tint_symbol_3); + textureDimensions_962dcd(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_7bb707(tint_symbol_4); + textureDimensions_962dcd(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_7bb707(tint_symbol_5); + textureDimensions_962dcd(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.spvasm similarity index 74% rename from test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.spvasm index b72547154a..1c1cf34922 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.spvasm @@ -1,7 +1,7 @@ ; SPIR-V ; Version: 1.3 ; Generator: Google Tint Compiler; 0 -; Bound: 41 +; Bound: 39 ; Schema: 0 OpCapability Shader OpCapability ImageQuery @@ -14,7 +14,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_cccc17 "textureDimensions_cccc17" + OpName %textureDimensions_962dcd "textureDimensions_962dcd" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -39,42 +39,40 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int - %26 = OpTypeFunction %void %v4float +%_ptr_Function_v2int = OpTypePointer Function %v2int + %23 = OpConstantNull %v2int + %24 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_cccc17 = OpFunction %void None %13 +%textureDimensions_962dcd = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 - %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_0 - %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %17 = OpImageQuerySizeLod %v2int %19 %int_0 OpStore %res %17 OpReturn OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %26 +%tint_symbol_2 = OpFunction %void None %24 %tint_symbol = OpFunctionParameter %v4float - %29 = OpLabel + %27 = OpLabel OpStore %tint_symbol_1 %tint_symbol OpReturn OpFunctionEnd %vertex_main = OpFunction %void None %13 - %31 = OpLabel + %29 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_cccc17 - %34 = OpFunctionCall %void %tint_symbol_2 %12 + %31 = OpFunctionCall %void %textureDimensions_962dcd + %32 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 - %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_cccc17 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_962dcd OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 - %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_cccc17 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_962dcd OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.wgsl index 36fc6c1b66..471afa2b87 100644 --- a/test/intrinsics/gen/textureDimensions/cccc17.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/962dcd.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_cccc17() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_962dcd() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_cccc17(); + textureDimensions_962dcd(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); } [[stage(compute)]] fn compute_main() { - textureDimensions_cccc17(); + textureDimensions_962dcd(); } diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl b/test/intrinsics/gen/textureDimensions/a01845.wgsl similarity index 86% rename from test/intrinsics/gen/textureDimensions/3e626d.wgsl rename to test/intrinsics/gen/textureDimensions/a01845.wgsl index de8bbbc811..3232d99a05 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl +++ b/test/intrinsics/gen/textureDimensions/a01845.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_depth_cube_array; -// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec3 -fn textureDimensions_3e626d() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_depth_cube_array, level: i32) -> vec2 +fn textureDimensions_a01845() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_3e626d(); + textureDimensions_a01845(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); } [[stage(compute)]] fn compute_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); } diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.hlsl similarity index 73% rename from test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.hlsl index aef00259a9..d4c8347cb4 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_3e626d() { +void textureDimensions_a01845() { int4 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); return; } diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.msl index 970257ef76..713316baca 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_3e626d(depthcube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_a01845(depthcube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(depthcube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_3e626d(tint_symbol_3); + textureDimensions_a01845(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(depthcube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_3e626d(tint_symbol_4); + textureDimensions_a01845(tint_symbol_4); return; } kernel void compute_main(depthcube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_3e626d(tint_symbol_5); + textureDimensions_a01845(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.spvasm index 93fb8240e4..b7cb545a9a 100644 --- a/test/intrinsics/gen/textureDimensions/a6ca1c.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 41 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_a6ca1c "textureDimensions_a6ca1c" + OpName %textureDimensions_a01845 "textureDimensions_a01845" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -29,7 +30,7 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 1 0 0 1 Unknown + %7 = OpTypeImage %float Cube 1 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -39,19 +40,19 @@ %void = OpTypeVoid %12 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_a6ca1c = OpFunction %void None %12 +%textureDimensions_a01845 = OpFunction %void None %12 %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v2int %21 %int_1 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_1 + %16 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %16 OpReturn OpFunctionEnd @@ -64,17 +65,17 @@ %vertex_main = OpFunction %void None %12 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_a6ca1c + %33 = OpFunctionCall %void %textureDimensions_a01845 %34 = OpFunctionCall %void %tint_symbol_2 %11 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %12 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_a6ca1c + %37 = OpFunctionCall %void %textureDimensions_a01845 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %12 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_a6ca1c + %40 = OpFunctionCall %void %textureDimensions_a01845 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.wgsl index cbe958c160..cf2538c12a 100644 --- a/test/intrinsics/gen/textureDimensions/3e626d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a01845.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_depth_cube_array; -fn textureDimensions_3e626d() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_a01845() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_3e626d(); + textureDimensions_a01845(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); } [[stage(compute)]] fn compute_main() { - textureDimensions_3e626d(); + textureDimensions_a01845(); } diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/75be9d.wgsl rename to test/intrinsics/gen/textureDimensions/a9c9c1.wgsl index 821d98df39..d43211582c 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl +++ b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube, level: i32) -> vec3 -fn textureDimensions_75be9d() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube, level: i32) -> vec2 +fn textureDimensions_a9c9c1() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); } [[stage(compute)]] fn compute_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); } diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.hlsl index 57f519ec80..4e48aa0274 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_75be9d() { +void textureDimensions_a9c9c1() { int3 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); return; } diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.msl index a35a3a0c6d..4e1e500b53 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_f507c9(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(), tint_symbol_2.get_height(), tint_symbol_2.get_height()); +void textureDimensions_a9c9c1(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_f507c9(tint_symbol_3); + textureDimensions_a9c9c1(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_f507c9(tint_symbol_4); + textureDimensions_a9c9c1(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_f507c9(tint_symbol_5); + textureDimensions_a9c9c1(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.spvasm new file mode 100644 index 0000000000..7826957d00 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/a9c9c1.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" %tint_pointsize %tint_symbol_1 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %textureDimensions_a9c9c1 "textureDimensions_a9c9c1" + OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %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 %void %v4float + %float_1 = OpConstant %float 1 +%textureDimensions_a9c9c1 = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_1 + OpStore %res %16 + OpReturn + OpFunctionEnd +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 + %31 = OpFunctionCall %void %textureDimensions_a9c9c1 + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_a9c9c1 + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_a9c9c1 + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.wgsl index fa3ebce952..a704df428e 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/a9c9c1.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_75be9d() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_a9c9c1() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); } [[stage(compute)]] fn compute_main() { - textureDimensions_75be9d(); + textureDimensions_a9c9c1(); } diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl b/test/intrinsics/gen/textureDimensions/b3c954.wgsl similarity index 83% rename from test/intrinsics/gen/textureDimensions/1ebd6a.wgsl rename to test/intrinsics/gen/textureDimensions/b3c954.wgsl index fedc47d2a0..0a181c1521 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl +++ b/test/intrinsics/gen/textureDimensions/b3c954.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube) -> vec3 -fn textureDimensions_1ebd6a() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube) -> vec2 +fn textureDimensions_b3c954() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); } [[stage(compute)]] fn compute_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); } diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.hlsl index ea2613e62f..ef817552f0 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_1ebd6a() { +void textureDimensions_b3c954() { int2 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); return; } diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.msl index 52c9599eae..8fb7df1468 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_5ec4e1(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_b3c954(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_5ec4e1(tint_symbol_3); + textureDimensions_b3c954(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_5ec4e1(tint_symbol_4); + textureDimensions_b3c954(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_5ec4e1(tint_symbol_5); + textureDimensions_b3c954(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.spvasm similarity index 79% rename from test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.spvasm index f1a58b41d3..7c574ca363 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.spvasm @@ -4,7 +4,6 @@ ; Bound: 40 ; Schema: 0 OpCapability Shader - OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -15,7 +14,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_f70326 "textureDimensions_f70326" + OpName %textureDimensions_b3c954 "textureDimensions_b3c954" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,8 +29,8 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %int = OpTypeInt 32 1 - %7 = OpTypeImage %int Cube 0 1 0 1 Unknown + %uint = OpTypeInt 32 0 + %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,18 +39,18 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %v3int = OpTypeVector %int 3 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %24 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %24 = OpConstantNull %v2int %25 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_f70326 = OpFunction %void None %13 +%textureDimensions_b3c954 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 + %res = OpVariable %_ptr_Function_v2int Function %24 %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_0 - %17 = OpVectorShuffle %v3int %19 %19 0 1 1 + %17 = OpImageQuerySizeLod %v2int %20 %int_0 OpStore %res %17 OpReturn OpFunctionEnd @@ -64,17 +63,17 @@ %vertex_main = OpFunction %void None %13 %30 = OpLabel OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_f70326 + %32 = OpFunctionCall %void %textureDimensions_b3c954 %33 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_f70326 + %36 = OpFunctionCall %void %textureDimensions_b3c954 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_f70326 + %39 = OpFunctionCall %void %textureDimensions_b3c954 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.wgsl index 87878e8460..dc99661f61 100644 --- a/test/intrinsics/gen/textureDimensions/1ebd6a.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/b3c954.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_1ebd6a() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_b3c954() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); } [[stage(compute)]] fn compute_main() { - textureDimensions_1ebd6a(); + textureDimensions_b3c954(); } diff --git a/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/bdf2ee.wgsl.expected.spvasm deleted file mode 100644 index 2f13378e67..0000000000 --- a/test/intrinsics/gen/textureDimensions/bdf2ee.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 SampledCubeArray - OpCapability ImageQuery - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 - OpEntryPoint Fragment %fragment_main "fragment_main" - OpEntryPoint GLCompute %compute_main "compute_main" - OpExecutionMode %fragment_main OriginUpperLeft - OpExecutionMode %compute_main LocalSize 1 1 1 - OpName %tint_pointsize "tint_pointsize" - OpName %arg_0 "arg_0" - OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_bdf2ee "textureDimensions_bdf2ee" - OpName %res "res" - OpName %tint_symbol_2 "tint_symbol_2" - OpName %tint_symbol "tint_symbol" - OpName %vertex_main "vertex_main" - OpName %fragment_main "fragment_main" - OpName %compute_main "compute_main" - OpDecorate %tint_pointsize BuiltIn PointSize - OpDecorate %arg_0 DescriptorSet 1 - OpDecorate %arg_0 Binding 0 - OpDecorate %tint_symbol_1 BuiltIn Position - %float = OpTypeFloat 32 -%_ptr_Output_float = OpTypePointer Output %float - %4 = OpConstantNull %float -%tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 1 1 0 1 Unknown -%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 - %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %11 = OpConstantNull %v4float -%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 - %void = OpTypeVoid - %12 = 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 %void %v4float - %float_1 = OpConstant %float 1 -%textureDimensions_bdf2ee = OpFunction %void None %12 - %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 - %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_0 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 - OpStore %res %16 - OpReturn - OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %25 -%tint_symbol = OpFunctionParameter %v4float - %28 = OpLabel - OpStore %tint_symbol_1 %tint_symbol - OpReturn - OpFunctionEnd -%vertex_main = OpFunction %void None %12 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_bdf2ee - %33 = OpFunctionCall %void %tint_symbol_2 %11 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %12 - %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_bdf2ee - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %12 - %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_bdf2ee - OpReturn - OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl b/test/intrinsics/gen/textureDimensions/d125bc.wgsl similarity index 83% rename from test/intrinsics/gen/textureDimensions/f507c9.wgsl rename to test/intrinsics/gen/textureDimensions/d125bc.wgsl index e45899df40..7cae00f08d 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl +++ b/test/intrinsics/gen/textureDimensions/d125bc.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube; -// fn textureDimensions(texture: texture_cube) -> vec3 -fn textureDimensions_f507c9() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube) -> vec2 +fn textureDimensions_d125bc() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_f507c9(); + textureDimensions_d125bc(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); } [[stage(compute)]] fn compute_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); } diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.hlsl index 9df6af6206..66a5b436c8 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCube arg_0 : register(t0, space1); -void textureDimensions_f507c9() { +void textureDimensions_d125bc() { int2 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); return; } diff --git a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.msl similarity index 63% rename from test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.msl index 774810a463..70d522a710 100644 --- a/test/intrinsics/gen/textureDimensions/75be9d.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_75be9d(texturecube tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_d125bc(texturecube tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube tint_symbol_3 [[texture(0)]]) { - textureDimensions_75be9d(tint_symbol_3); + textureDimensions_d125bc(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube tint_symbol_4 [[texture(0)]]) { - textureDimensions_75be9d(tint_symbol_4); + textureDimensions_d125bc(tint_symbol_4); return; } kernel void compute_main(texturecube tint_symbol_5 [[texture(0)]]) { - textureDimensions_75be9d(tint_symbol_5); + textureDimensions_d125bc(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.spvasm new file mode 100644 index 0000000000..b2e7490a70 --- /dev/null +++ b/test/intrinsics/gen/textureDimensions/d125bc.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" %tint_pointsize %tint_symbol_1 + OpEntryPoint Fragment %fragment_main "fragment_main" + OpEntryPoint GLCompute %compute_main "compute_main" + OpExecutionMode %fragment_main OriginUpperLeft + OpExecutionMode %compute_main LocalSize 1 1 1 + OpName %tint_pointsize "tint_pointsize" + OpName %arg_0 "arg_0" + OpName %tint_symbol_1 "tint_symbol_1" + OpName %textureDimensions_d125bc "textureDimensions_d125bc" + OpName %res "res" + OpName %tint_symbol_2 "tint_symbol_2" + OpName %tint_symbol "tint_symbol" + OpName %vertex_main "vertex_main" + OpName %fragment_main "fragment_main" + OpName %compute_main "compute_main" + OpDecorate %tint_pointsize BuiltIn PointSize + OpDecorate %arg_0 DescriptorSet 1 + OpDecorate %arg_0 Binding 0 + OpDecorate %tint_symbol_1 BuiltIn Position + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %4 = OpConstantNull %float +%tint_pointsize = OpVariable %_ptr_Output_float Output %4 + %7 = OpTypeImage %float Cube 0 0 0 1 Unknown +%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 + %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %11 = OpConstantNull %v4float +%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 + %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 %void %v4float + %float_1 = OpConstant %float 1 +%textureDimensions_d125bc = OpFunction %void None %12 + %15 = OpLabel + %res = OpVariable %_ptr_Function_v2int Function %23 + %19 = OpLoad %7 %arg_0 + %16 = OpImageQuerySizeLod %v2int %19 %int_0 + OpStore %res %16 + OpReturn + OpFunctionEnd +%tint_symbol_2 = OpFunction %void None %24 +%tint_symbol = OpFunctionParameter %v4float + %27 = OpLabel + OpStore %tint_symbol_1 %tint_symbol + OpReturn + OpFunctionEnd +%vertex_main = OpFunction %void None %12 + %29 = OpLabel + OpStore %tint_pointsize %float_1 + %31 = OpFunctionCall %void %textureDimensions_d125bc + %32 = OpFunctionCall %void %tint_symbol_2 %11 + OpReturn + OpFunctionEnd +%fragment_main = OpFunction %void None %12 + %34 = OpLabel + %35 = OpFunctionCall %void %textureDimensions_d125bc + OpReturn + OpFunctionEnd +%compute_main = OpFunction %void None %12 + %37 = OpLabel + %38 = OpFunctionCall %void %textureDimensions_d125bc + OpReturn + OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.wgsl index 5f62f50d2b..d2b12ce210 100644 --- a/test/intrinsics/gen/textureDimensions/f507c9.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d125bc.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube; -fn textureDimensions_f507c9() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_d125bc() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_f507c9(); + textureDimensions_d125bc(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); } [[stage(compute)]] fn compute_main() { - textureDimensions_f507c9(); + textureDimensions_d125bc(); } diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl b/test/intrinsics/gen/textureDimensions/d83c45.wgsl similarity index 86% rename from test/intrinsics/gen/textureDimensions/91f42d.wgsl rename to test/intrinsics/gen/textureDimensions/d83c45.wgsl index 8ac0bf998a..0293ca43a1 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl +++ b/test/intrinsics/gen/textureDimensions/d83c45.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec3 -fn textureDimensions_91f42d() { - var res: vec3 = textureDimensions(arg_0, 1); +// fn textureDimensions(texture: texture_cube_array, level: i32) -> vec2 +fn textureDimensions_d83c45() { + var res: vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_91f42d(); + textureDimensions_d83c45(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); } [[stage(compute)]] fn compute_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); } diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.hlsl similarity index 73% rename from test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.hlsl index 1f1cf459a8..11d54827d6 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_91f42d() { +void textureDimensions_d83c45() { int4 tint_tmp; arg_0.GetDimensions(1, tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); return; } diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.msl index 5e6653cfdf..4d681e691e 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_91f42d(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_d83c45(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1)); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_91f42d(tint_symbol_3); + textureDimensions_d83c45(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_91f42d(tint_symbol_4); + textureDimensions_d83c45(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_91f42d(tint_symbol_5); + textureDimensions_d83c45(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.spvasm index 354e77c2fa..77bbf152d2 100644 --- a/test/intrinsics/gen/textureDimensions/5ec4e1.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.spvasm @@ -4,6 +4,7 @@ ; Bound: 42 ; Schema: 0 OpCapability Shader + OpCapability SampledCubeArray OpCapability ImageQuery OpMemoryModel Logical GLSL450 OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 @@ -14,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_5ec4e1 "textureDimensions_5ec4e1" + OpName %textureDimensions_d83c45 "textureDimensions_d83c45" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,7 +31,7 @@ %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 %uint = OpTypeInt 32 0 - %7 = OpTypeImage %uint Cube 0 0 0 1 Unknown + %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,19 +41,19 @@ %void = OpTypeVoid %13 = OpTypeFunction %void %int = OpTypeInt 32 1 - %v3int = OpTypeVector %int 3 %v2int = OpTypeVector %int 2 + %v3int = OpTypeVector %int 3 %int_1 = OpConstant %int 1 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %26 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %26 = OpConstantNull %v2int %27 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_5ec4e1 = OpFunction %void None %13 +%textureDimensions_d83c45 = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %26 + %res = OpVariable %_ptr_Function_v2int Function %26 %22 = OpLoad %7 %arg_0 - %20 = OpImageQuerySizeLod %v2int %22 %int_1 - %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + %20 = OpImageQuerySizeLod %v3int %22 %int_1 + %17 = OpVectorShuffle %v2int %20 %20 0 1 OpStore %res %17 OpReturn OpFunctionEnd @@ -65,17 +66,17 @@ %vertex_main = OpFunction %void None %13 %32 = OpLabel OpStore %tint_pointsize %float_1 - %34 = OpFunctionCall %void %textureDimensions_5ec4e1 + %34 = OpFunctionCall %void %textureDimensions_d83c45 %35 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %37 = OpLabel - %38 = OpFunctionCall %void %textureDimensions_5ec4e1 + %38 = OpFunctionCall %void %textureDimensions_d83c45 OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %40 = OpLabel - %41 = OpFunctionCall %void %textureDimensions_5ec4e1 + %41 = OpFunctionCall %void %textureDimensions_d83c45 OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.wgsl similarity index 58% rename from test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.wgsl index a32641558b..bf3d0dd629 100644 --- a/test/intrinsics/gen/textureDimensions/91f42d.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/d83c45.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_91f42d() { - var res : vec3 = textureDimensions(arg_0, 1); +fn textureDimensions_d83c45() { + var res : vec2 = textureDimensions(arg_0, 1); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_91f42d(); + textureDimensions_d83c45(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); } [[stage(compute)]] fn compute_main() { - textureDimensions_91f42d(); + textureDimensions_d83c45(); } diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl b/test/intrinsics/gen/textureDimensions/e927be.wgsl similarity index 87% rename from test/intrinsics/gen/textureDimensions/f70326.wgsl rename to test/intrinsics/gen/textureDimensions/e927be.wgsl index 2d1ac1c2e5..d0fb42c184 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl +++ b/test/intrinsics/gen/textureDimensions/e927be.wgsl @@ -24,23 +24,23 @@ [[group(1), binding(0)]] var arg_0: texture_cube_array; -// fn textureDimensions(texture: texture_cube_array) -> vec3 -fn textureDimensions_f70326() { - var res: vec3 = textureDimensions(arg_0); +// fn textureDimensions(texture: texture_cube_array) -> vec2 +fn textureDimensions_e927be() { + var res: vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_f70326(); + textureDimensions_e927be(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); } [[stage(compute)]] fn compute_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); } diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.hlsl similarity index 72% rename from test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl rename to test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.hlsl index 3c8fd06ab9..5d1e082d16 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.hlsl +++ b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.hlsl @@ -1,9 +1,9 @@ TextureCubeArray arg_0 : register(t0, space1); -void textureDimensions_f70326() { +void textureDimensions_e927be() { int3 tint_tmp; arg_0.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); - int3 res = tint_tmp.xyy; + int2 res = tint_tmp.xy; } struct tint_symbol { @@ -11,18 +11,18 @@ struct tint_symbol { }; tint_symbol vertex_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); const tint_symbol tint_symbol_1 = {float4(0.0f, 0.0f, 0.0f, 0.0f)}; return tint_symbol_1; } void fragment_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); return; } [numthreads(1, 1, 1)] void compute_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); return; } diff --git a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.msl similarity index 64% rename from test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl rename to test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.msl index 48b64a2913..03c8f7279b 100644 --- a/test/intrinsics/gen/textureDimensions/e22247.wgsl.expected.msl +++ b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.msl @@ -5,23 +5,23 @@ struct tint_symbol { float4 value [[position]]; }; -void textureDimensions_e22247(texturecube_array tint_symbol_2) { - int3 res = int3(tint_symbol_2.get_width(1), tint_symbol_2.get_height(1), tint_symbol_2.get_height(1)); +void textureDimensions_e927be(texturecube_array tint_symbol_2) { + int2 res = int2(tint_symbol_2.get_width(), tint_symbol_2.get_height()); } vertex tint_symbol vertex_main(texturecube_array tint_symbol_3 [[texture(0)]]) { - textureDimensions_e22247(tint_symbol_3); + textureDimensions_e927be(tint_symbol_3); tint_symbol const tint_symbol_1 = {.value=float4()}; return tint_symbol_1; } fragment void fragment_main(texturecube_array tint_symbol_4 [[texture(0)]]) { - textureDimensions_e22247(tint_symbol_4); + textureDimensions_e927be(tint_symbol_4); return; } kernel void compute_main(texturecube_array tint_symbol_5 [[texture(0)]]) { - textureDimensions_e22247(tint_symbol_5); + textureDimensions_e927be(tint_symbol_5); return; } diff --git a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.spvasm similarity index 80% rename from test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm rename to test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.spvasm index cd4d25b8e2..efdc0d7326 100644 --- a/test/intrinsics/gen/textureDimensions/183b3e.wgsl.expected.spvasm +++ b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.spvasm @@ -15,7 +15,7 @@ OpName %tint_pointsize "tint_pointsize" OpName %arg_0 "arg_0" OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_183b3e "textureDimensions_183b3e" + OpName %textureDimensions_e927be "textureDimensions_e927be" OpName %res "res" OpName %tint_symbol_2 "tint_symbol_2" OpName %tint_symbol "tint_symbol" @@ -30,8 +30,8 @@ %_ptr_Output_float = OpTypePointer Output %float %4 = OpConstantNull %float %tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %uint = OpTypeInt 32 0 - %7 = OpTypeImage %uint Cube 0 1 0 1 Unknown + %int = OpTypeInt 32 1 + %7 = OpTypeImage %int Cube 0 1 0 1 Unknown %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant %v4float = OpTypeVector %float 4 @@ -40,19 +40,19 @@ %tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %12 %void = OpTypeVoid %13 = OpTypeFunction %void - %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 %v3int = OpTypeVector %int 3 %int_0 = OpConstant %int 0 -%_ptr_Function_v3int = OpTypePointer Function %v3int - %25 = OpConstantNull %v3int +%_ptr_Function_v2int = OpTypePointer Function %v2int + %25 = OpConstantNull %v2int %26 = OpTypeFunction %void %v4float %float_1 = OpConstant %float 1 -%textureDimensions_183b3e = OpFunction %void None %13 +%textureDimensions_e927be = OpFunction %void None %13 %16 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %25 + %res = OpVariable %_ptr_Function_v2int Function %25 %21 = OpLoad %7 %arg_0 - %20 = OpImageQuerySizeLod %v3int %21 %int_0 - %17 = OpVectorShuffle %v3int %20 %20 0 1 1 + %19 = OpImageQuerySizeLod %v3int %21 %int_0 + %17 = OpVectorShuffle %v2int %19 %19 0 1 OpStore %res %17 OpReturn OpFunctionEnd @@ -65,17 +65,17 @@ %vertex_main = OpFunction %void None %13 %31 = OpLabel OpStore %tint_pointsize %float_1 - %33 = OpFunctionCall %void %textureDimensions_183b3e + %33 = OpFunctionCall %void %textureDimensions_e927be %34 = OpFunctionCall %void %tint_symbol_2 %12 OpReturn OpFunctionEnd %fragment_main = OpFunction %void None %13 %36 = OpLabel - %37 = OpFunctionCall %void %textureDimensions_183b3e + %37 = OpFunctionCall %void %textureDimensions_e927be OpReturn OpFunctionEnd %compute_main = OpFunction %void None %13 %39 = OpLabel - %40 = OpFunctionCall %void %textureDimensions_183b3e + %40 = OpFunctionCall %void %textureDimensions_e927be OpReturn OpFunctionEnd diff --git a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.wgsl similarity index 59% rename from test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl rename to test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.wgsl index 6209bb22c2..f56296a31e 100644 --- a/test/intrinsics/gen/textureDimensions/f70326.wgsl.expected.wgsl +++ b/test/intrinsics/gen/textureDimensions/e927be.wgsl.expected.wgsl @@ -1,21 +1,21 @@ [[group(1), binding(0)]] var arg_0 : texture_cube_array; -fn textureDimensions_f70326() { - var res : vec3 = textureDimensions(arg_0); +fn textureDimensions_e927be() { + var res : vec2 = textureDimensions(arg_0); } [[stage(vertex)]] fn vertex_main() -> [[builtin(position)]] vec4 { - textureDimensions_f70326(); + textureDimensions_e927be(); return vec4(); } [[stage(fragment)]] fn fragment_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); } [[stage(compute)]] fn compute_main() { - textureDimensions_f70326(); + textureDimensions_e927be(); } diff --git a/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm b/test/intrinsics/gen/textureDimensions/eda4e3.wgsl.expected.spvasm deleted file mode 100644 index 694581ba40..0000000000 --- a/test/intrinsics/gen/textureDimensions/eda4e3.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 SampledCubeArray - OpCapability ImageQuery - OpMemoryModel Logical GLSL450 - OpEntryPoint Vertex %vertex_main "vertex_main" %tint_pointsize %tint_symbol_1 - OpEntryPoint Fragment %fragment_main "fragment_main" - OpEntryPoint GLCompute %compute_main "compute_main" - OpExecutionMode %fragment_main OriginUpperLeft - OpExecutionMode %compute_main LocalSize 1 1 1 - OpName %tint_pointsize "tint_pointsize" - OpName %arg_0 "arg_0" - OpName %tint_symbol_1 "tint_symbol_1" - OpName %textureDimensions_eda4e3 "textureDimensions_eda4e3" - OpName %res "res" - OpName %tint_symbol_2 "tint_symbol_2" - OpName %tint_symbol "tint_symbol" - OpName %vertex_main "vertex_main" - OpName %fragment_main "fragment_main" - OpName %compute_main "compute_main" - OpDecorate %tint_pointsize BuiltIn PointSize - OpDecorate %arg_0 DescriptorSet 1 - OpDecorate %arg_0 Binding 0 - OpDecorate %tint_symbol_1 BuiltIn Position - %float = OpTypeFloat 32 -%_ptr_Output_float = OpTypePointer Output %float - %4 = OpConstantNull %float -%tint_pointsize = OpVariable %_ptr_Output_float Output %4 - %7 = OpTypeImage %float Cube 0 1 0 1 Unknown -%_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7 - %arg_0 = OpVariable %_ptr_UniformConstant_7 UniformConstant - %v4float = OpTypeVector %float 4 -%_ptr_Output_v4float = OpTypePointer Output %v4float - %11 = OpConstantNull %v4float -%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %11 - %void = OpTypeVoid - %12 = 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 %void %v4float - %float_1 = OpConstant %float 1 -%textureDimensions_eda4e3 = OpFunction %void None %12 - %15 = OpLabel - %res = OpVariable %_ptr_Function_v3int Function %24 - %20 = OpLoad %7 %arg_0 - %19 = OpImageQuerySizeLod %v3int %20 %int_1 - %16 = OpVectorShuffle %v3int %19 %19 0 1 1 - OpStore %res %16 - OpReturn - OpFunctionEnd -%tint_symbol_2 = OpFunction %void None %25 -%tint_symbol = OpFunctionParameter %v4float - %28 = OpLabel - OpStore %tint_symbol_1 %tint_symbol - OpReturn - OpFunctionEnd -%vertex_main = OpFunction %void None %12 - %30 = OpLabel - OpStore %tint_pointsize %float_1 - %32 = OpFunctionCall %void %textureDimensions_eda4e3 - %33 = OpFunctionCall %void %tint_symbol_2 %11 - OpReturn - OpFunctionEnd -%fragment_main = OpFunction %void None %12 - %35 = OpLabel - %36 = OpFunctionCall %void %textureDimensions_eda4e3 - OpReturn - OpFunctionEnd -%compute_main = OpFunction %void None %12 - %38 = OpLabel - %39 = OpFunctionCall %void %textureDimensions_eda4e3 - OpReturn - OpFunctionEnd