From a32e4f66e53f8253d251d0fa885fdbbab074d67e Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Tue, 20 Apr 2021 16:00:21 +0000 Subject: [PATCH] Remove 2d Array Multisampled Textures These do not exist in the WGSL spec, so removing them. BUG=tint:717 Change-Id: I5eb2280fa2f0c923b67070a9ce4a7d2fc10d365d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48460 Auto-Submit: Ryan Harrison Reviewed-by: Antonio Maiorano Reviewed-by: Ben Clayton Kokoro: Kokoro Commit-Queue: Ben Clayton --- src/ast/intrinsic_texture_helper_test.cc | 82 ----------- src/ast/intrinsic_texture_helper_test.h | 6 - src/resolver/intrinsic_test.cc | 9 -- .../generator_impl_intrinsic_texture_test.cc | 28 ---- .../generator_impl_intrinsic_texture_test.cc | 9 -- .../spirv/builder_intrinsic_texture_test.cc | 134 ------------------ 6 files changed, 268 deletions(-) diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index 1669270df8..aca8e1d48a 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -324,17 +324,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureDimensions", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kDimensionsMultisampled2dArray, - "textureDimensions(t : texture_multisampled_2d_array)-> " - "vec2", - TextureKind::kMultisampled, - sem::SamplerKind::kSampler, - sem::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureDimensions", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kDimensionsDepth2d, "textureDimensions(t : texture_depth_2d) -> vec2", @@ -525,16 +514,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureNumLayers", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kNumLayersMultisampled2dArray, - "textureNumLayers(t : texture_multisampled_2d_array) -> i32", - TextureKind::kMultisampled, - sem::SamplerKind::kSampler, - sem::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureNumLayers", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kNumLayersDepth2dArray, "textureNumLayers(t : texture_depth_2d_array) -> i32", @@ -665,16 +644,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureNumSamples", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kNumSamplesMultisampled2dArray, - "textureNumSamples(t : texture_multisampled_2d_array) -> i32", - TextureKind::kMultisampled, - sem::SamplerKind::kSampler, - sem::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureNumSamples", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kSample1dF32, "textureSample(t : texture_1d,\n" @@ -1888,57 +1857,6 @@ std::vector TextureOverloadCase::ValidCases() { 3); // sample_index }, }, - { - ValidTextureOverload::kLoadMultisampled2dArrayF32, - "textureLoad(t : texture_multisampled_2d_array,\n" - " coords : vec2,\n" - " array_index : i32,\n" - " sample_index : i32) -> vec4", - TextureKind::kMultisampled, - sem::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3, // array_index - 4); // sample_index - }, - }, - { - ValidTextureOverload::kLoadMultisampled2dArrayU32, - "textureLoad(t : texture_multisampled_2d_array,\n" - " coords : vec2,\n" - " array_index : i32,\n" - " sample_index : i32) -> vec4", - TextureKind::kMultisampled, - sem::TextureDimension::k2dArray, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3, // array_index - 4); // sample_index - }, - }, - { - ValidTextureOverload::kLoadMultisampled2dArrayI32, - "textureLoad(t : texture_multisampled_2d_array,\n" - " coords : vec2,\n" - " array_index : i32,\n" - " sample_index : i32) -> vec4", - TextureKind::kMultisampled, - sem::TextureDimension::k2dArray, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3, // array_index - 4); // sample_index - }, - }, { ValidTextureOverload::kLoadDepth2dLevelF32, "textureLoad(t : texture_depth_2d,\n" diff --git a/src/ast/intrinsic_texture_helper_test.h b/src/ast/intrinsic_texture_helper_test.h index b7a9a80e02..dc42295719 100644 --- a/src/ast/intrinsic_texture_helper_test.h +++ b/src/ast/intrinsic_texture_helper_test.h @@ -46,7 +46,6 @@ enum class ValidTextureOverload { kDimensionsCubeArray, kDimensionsCubeArrayLevel, kDimensionsMultisampled2d, - kDimensionsMultisampled2dArray, kDimensionsDepth2d, kDimensionsDepth2dLevel, kDimensionsDepth2dArray, @@ -65,7 +64,6 @@ enum class ValidTextureOverload { kDimensionsStorageWO3d, kNumLayers2dArray, kNumLayersCubeArray, - kNumLayersMultisampled2dArray, kNumLayersDepth2dArray, kNumLayersDepthCubeArray, kNumLayersStorageWO2dArray, @@ -79,7 +77,6 @@ enum class ValidTextureOverload { kNumLevelsDepthCube, kNumLevelsDepthCubeArray, kNumSamplesMultisampled2d, - kNumSamplesMultisampled2dArray, kSample1dF32, kSample2dF32, kSample2dOffsetF32, @@ -146,9 +143,6 @@ enum class ValidTextureOverload { kLoadMultisampled2dF32, kLoadMultisampled2dU32, kLoadMultisampled2dI32, - kLoadMultisampled2dArrayF32, - kLoadMultisampled2dArrayU32, - kLoadMultisampled2dArrayI32, kLoadDepth2dLevelF32, kLoadDepth2dArrayLevelF32, kLoadStorageRO1dRgba32float, // Not permutated for all texel formats diff --git a/src/resolver/intrinsic_test.cc b/src/resolver/intrinsic_test.cc index be4d80db49..5adf046ddb 100644 --- a/src/resolver/intrinsic_test.cc +++ b/src/resolver/intrinsic_test.cc @@ -1697,7 +1697,6 @@ const char* expected_texture_overload( case ValidTextureOverload::kDimensionsCube: case ValidTextureOverload::kDimensionsCubeArray: case ValidTextureOverload::kDimensionsMultisampled2d: - case ValidTextureOverload::kDimensionsMultisampled2dArray: case ValidTextureOverload::kDimensionsDepth2d: case ValidTextureOverload::kDimensionsDepth2dArray: case ValidTextureOverload::kDimensionsDepthCube: @@ -1713,7 +1712,6 @@ const char* expected_texture_overload( return R"(textureDimensions(texture))"; case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersCubeArray: - case ValidTextureOverload::kNumLayersMultisampled2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: case ValidTextureOverload::kNumLayersDepthCubeArray: case ValidTextureOverload::kNumLayersStorageWO2dArray: @@ -1729,7 +1727,6 @@ const char* expected_texture_overload( case ValidTextureOverload::kNumLevelsDepthCubeArray: return R"(textureNumLevels(texture))"; case ValidTextureOverload::kNumSamplesMultisampled2d: - case ValidTextureOverload::kNumSamplesMultisampled2dArray: return R"(textureNumSamples(texture))"; case ValidTextureOverload::kDimensions2dLevel: case ValidTextureOverload::kDimensions2dArrayLevel: @@ -1873,12 +1870,6 @@ const char* expected_texture_overload( return R"(textureLoad(texture, coords, sample_index))"; case ValidTextureOverload::kLoadMultisampled2dI32: return R"(textureLoad(texture, coords, sample_index))"; - case ValidTextureOverload::kLoadMultisampled2dArrayF32: - return R"(textureLoad(texture, coords, array_index, sample_index))"; - case ValidTextureOverload::kLoadMultisampled2dArrayU32: - return R"(textureLoad(texture, coords, array_index, sample_index))"; - case ValidTextureOverload::kLoadMultisampled2dArrayI32: - return R"(textureLoad(texture, coords, array_index, sample_index))"; case ValidTextureOverload::kLoadDepth2dLevelF32: return R"(textureLoad(texture, coords, level))"; case ValidTextureOverload::kLoadDepth2dArrayLevelF32: diff --git a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc index 88d9eedd11..9988a7c8cf 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc @@ -71,13 +71,6 @@ ExpectedResult expected_texture_overload( return { R"(int3 tint_tmp; tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z); -)", - "tint_tmp.xy", - }; - case ValidTextureOverload::kDimensionsMultisampled2dArray: - return { - R"(int4 tint_tmp; - tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); )", "tint_tmp.xy", }; @@ -156,14 +149,6 @@ ExpectedResult expected_texture_overload( )", "tint_tmp.z", }; - case ValidTextureOverload::kNumLayersMultisampled2dArray: - return { - R"(int4 tint_tmp; - tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); -)", - "tint_tmp.z", - }; - case ValidTextureOverload::kNumLevels2d: case ValidTextureOverload::kNumLevelsCube: case ValidTextureOverload::kNumLevelsDepth2d: @@ -192,13 +177,6 @@ ExpectedResult expected_texture_overload( )", "tint_tmp.z", }; - case ValidTextureOverload::kNumSamplesMultisampled2dArray: - return { - R"(int4 tint_tmp; - tint_symbol.GetDimensions(tint_tmp.x, tint_tmp.y, tint_tmp.z, tint_tmp.w); -)", - "tint_tmp.w", - }; case ValidTextureOverload::kSample1dF32: return R"(tint_symbol.Sample(tint_symbol_1, 1.0f))"; case ValidTextureOverload::kSample2dF32: @@ -331,12 +309,6 @@ ExpectedResult expected_texture_overload( return R"(tint_symbol.Load(int3(1, 2, 0), 3))"; case ValidTextureOverload::kLoadMultisampled2dI32: return R"(tint_symbol.Load(int3(1, 2, 0), 3))"; - case ValidTextureOverload::kLoadMultisampled2dArrayF32: - return R"(tint_symbol.Load(int4(1, 2, 3, 0), 4))"; - case ValidTextureOverload::kLoadMultisampled2dArrayU32: - return R"(tint_symbol.Load(int4(1, 2, 3, 0), 4))"; - case ValidTextureOverload::kLoadMultisampled2dArrayI32: - return R"(tint_symbol.Load(int4(1, 2, 3, 0), 4))"; case ValidTextureOverload::kLoadDepth2dLevelF32: return R"(tint_symbol.Load(int3(1, 2, 0), 3))"; case ValidTextureOverload::kLoadDepth2dArrayLevelF32: diff --git a/src/writer/msl/generator_impl_intrinsic_texture_test.cc b/src/writer/msl/generator_impl_intrinsic_texture_test.cc index a2f92011fe..02d058db39 100644 --- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc @@ -31,7 +31,6 @@ std::string expected_texture_overload( case ValidTextureOverload::kDimensions2d: case ValidTextureOverload::kDimensions2dArray: case ValidTextureOverload::kDimensionsMultisampled2d: - case ValidTextureOverload::kDimensionsMultisampled2dArray: case ValidTextureOverload::kDimensionsDepth2d: case ValidTextureOverload::kDimensionsDepth2dArray: case ValidTextureOverload::kDimensionsStorageRO2d: @@ -62,7 +61,6 @@ std::string expected_texture_overload( return R"(int3(texture.get_width(1), texture.get_height(1), texture.get_height(1)))"; case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersCubeArray: - case ValidTextureOverload::kNumLayersMultisampled2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: case ValidTextureOverload::kNumLayersDepthCubeArray: case ValidTextureOverload::kNumLayersStorageWO2dArray: @@ -78,7 +76,6 @@ std::string expected_texture_overload( case ValidTextureOverload::kNumLevelsDepthCubeArray: return R"(int(texture.get_num_mip_levels()))"; case ValidTextureOverload::kNumSamplesMultisampled2d: - case ValidTextureOverload::kNumSamplesMultisampled2dArray: return R"(int(texture.get_num_samples()))"; case ValidTextureOverload::kSample1dF32: return R"(texture.sample(sampler, 1.0f))"; @@ -212,12 +209,6 @@ std::string expected_texture_overload( return R"(texture.read(int2(1, 2), 3))"; case ValidTextureOverload::kLoadMultisampled2dI32: return R"(texture.read(int2(1, 2), 3))"; - case ValidTextureOverload::kLoadMultisampled2dArrayF32: - return R"(texture.read(int2(1, 2), 3, 4))"; - case ValidTextureOverload::kLoadMultisampled2dArrayU32: - return R"(texture.read(int2(1, 2), 3, 4))"; - case ValidTextureOverload::kLoadMultisampled2dArrayI32: - return R"(texture.read(int2(1, 2), 3, 4))"; case ValidTextureOverload::kLoadDepth2dLevelF32: return R"(texture.read(int2(1, 2), 3))"; case ValidTextureOverload::kLoadDepth2dArrayLevelF32: diff --git a/src/writer/spirv/builder_intrinsic_texture_test.cc b/src/writer/spirv/builder_intrinsic_texture_test.cc index ea77938771..74d4ffdc2c 100644 --- a/src/writer/spirv/builder_intrinsic_texture_test.cc +++ b/src/writer/spirv/builder_intrinsic_texture_test.cc @@ -296,28 +296,6 @@ OpCapability ImageQuery )", R"( OpCapability ImageQuery -)"}; - case ValidTextureOverload::kDimensionsMultisampled2dArray: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%10 = OpTypeInt 32 1 -%9 = OpTypeVector %10 2 -%12 = OpTypeVector %10 3 -)", - R"( -%13 = OpLoad %3 %1 -%11 = OpImageQuerySize %12 %13 -%8 = OpVectorShuffle %9 %11 %11 0 1 -)", - R"( -OpCapability ImageQuery )"}; case ValidTextureOverload::kDimensionsDepth2d: return { @@ -705,26 +683,6 @@ OpCapability ImageQuery R"( OpCapability SampledCubeArray OpCapability ImageQuery -)"}; - case ValidTextureOverload::kNumLayersMultisampled2dArray: - return {R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeInt 32 1 -%11 = OpTypeVector %9 3 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySize %11 %12 -%8 = OpCompositeExtract %9 %10 2 -)", - R"( -OpCapability ImageQuery )"}; case ValidTextureOverload::kNumLayersDepth2dArray: return {R"( @@ -970,24 +928,6 @@ OpCapability ImageQuery )", R"( OpCapability ImageQuery -)"}; - case ValidTextureOverload::kNumSamplesMultisampled2dArray: - return {R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeInt 32 1 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageQuerySamples %9 %10 -)", - R"( -OpCapability ImageQuery )"}; case ValidTextureOverload::kSample1dF32: return { @@ -2894,80 +2834,6 @@ OpCapability Sampled1D R"( %10 = OpLoad %3 %1 %8 = OpImageFetch %9 %10 %14 Sample %15 -)", - R"( -)"}; - case ValidTextureOverload::kLoadMultisampled2dArrayF32: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeVector %4 4 -%12 = OpTypeInt 32 1 -%11 = OpTypeVector %12 3 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstant %12 3 -%16 = OpConstantComposite %11 %13 %14 %15 -%17 = OpConstant %12 4 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %16 Sample %17 -)", - R"( -)"}; - case ValidTextureOverload::kLoadMultisampled2dArrayU32: - return { - R"( -%4 = OpTypeInt 32 0 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeVector %4 4 -%12 = OpTypeInt 32 1 -%11 = OpTypeVector %12 3 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstant %12 3 -%16 = OpConstantComposite %11 %13 %14 %15 -%17 = OpConstant %12 4 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %16 Sample %17 -)", - R"( -)"}; - case ValidTextureOverload::kLoadMultisampled2dArrayI32: - return { - R"( -%4 = OpTypeInt 32 1 -%3 = OpTypeImage %4 2D 0 1 1 1 Unknown -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeVector %4 4 -%11 = OpTypeVector %4 3 -%12 = OpConstant %4 1 -%13 = OpConstant %4 2 -%14 = OpConstant %4 3 -%15 = OpConstantComposite %11 %12 %13 %14 -%16 = OpConstant %4 4 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %15 Sample %16 )", R"( )"};