From 13dbbc6797a300043474202834ac401388d13bb0 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 24 Feb 2021 05:05:21 +0000 Subject: [PATCH] Remove references 1D Array texture dimension WGSL recently removed this concept, since it didn't exist in WebGPU, so excising it from the code. BUG=tint:515 Change-Id: Ibbca6bd643fd96c2fb10bd33f471c9e9e58de535 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42320 Auto-Submit: Ryan Harrison Reviewed-by: Ben Clayton Commit-Queue: Ryan Harrison --- docs/translations.md | 3 - fuzzers/dictionary.txt | 1 - src/ast/intrinsic_texture_helper_test.cc | 150 ---------- src/ast/intrinsic_texture_helper_test.h | 11 - src/inspector/inspector.cc | 2 - src/inspector/inspector.h | 2 - src/inspector/inspector_test.cc | 20 -- src/intrinsic_table.cc | 17 -- src/intrinsic_table_test.cc | 8 +- src/reader/spirv/enum_converter.cc | 2 - src/reader/spirv/enum_converter_test.cc | 1 - src/reader/spirv/parser_impl_handle_test.cc | 102 +------ src/reader/wgsl/lexer.cc | 6 - src/reader/wgsl/lexer_test.cc | 3 - src/reader/wgsl/parser_impl.cc | 7 - .../parser_impl_sampled_texture_type_test.cc | 9 - .../parser_impl_storage_texture_type_test.cc | 9 - src/reader/wgsl/token.cc | 4 - src/reader/wgsl/token.h | 12 - src/type/texture_type.cc | 5 - src/type/texture_type.h | 4 +- src/type/texture_type_test.cc | 2 - src/type_determiner_test.cc | 26 -- src/writer/hlsl/generator_impl.cc | 11 - .../generator_impl_intrinsic_texture_test.cc | 29 -- src/writer/hlsl/generator_impl_type_test.cc | 10 - src/writer/hlsl/namer.cc | 2 - src/writer/hlsl/namer_test.cc | 2 - src/writer/msl/generator_impl.cc | 4 - .../generator_impl_intrinsic_texture_test.cc | 17 -- src/writer/msl/generator_impl_type_test.cc | 6 - src/writer/spirv/builder.cc | 13 +- .../spirv/builder_intrinsic_texture_test.cc | 264 ------------------ src/writer/spirv/builder_type_test.cc | 40 --- src/writer/wgsl/generator_impl.cc | 3 - src/writer/wgsl/generator_impl_type_test.cc | 9 - 36 files changed, 8 insertions(+), 808 deletions(-) diff --git a/docs/translations.md b/docs/translations.md index bf6a8eb4f0..911dda1df8 100644 --- a/docs/translations.md +++ b/docs/translations.md @@ -114,7 +114,6 @@ decorated with `NonWritable` or each member of the struct can be decorated with | WGSL | SPIR-V | MSL | HLSL | |------|--------|-----|------| | texture_1d<type> | OpTypeImage 1D Sampled=1 | texture1d<type, access::sample> | Texture1D | -| texture_1d_array<type> | OpTypeImage 1D Arrayed=1 Sampled=1 | texture1d_array<type, access::sample> | Texture1DArray | | texture_2d<type> | OpTypeImage 2D Sampled=1 | texture2d<type, access::sample> | Texture2D | | texture_2d_array<type> | OpTypeImage 2D Arrayed=1 Sampled=1 | texture2d_array<type, access::sample> | Texture2DArray | | texture_3d<type> | OpTypeImage 3D Sampled=1 | texture3d<type, access::sample> | Texture3D | @@ -129,13 +128,11 @@ decorated with `NonWritable` or each member of the struct can be decorated with | texture_depth_cube_array | OpTypeImage Cube Depth=1 Arrayed=1 Sampled=1 | depthcube_array<float, access::sample> | TextureCubeArray | | | | | | texture_storage_1d<image_storage_type> | OpTypeImage 1D Sampled=2| texture1d<type, access::read> | RWTexture1D | -| texture_storage_1d_array<image_storage_type> | OpTypeImage 1D Arrayed=1 Sampled=2 | texture1d_array<type, access::read> | RWTexture1DArray | | texture_storage_2d<image_storage_type> | OpTypeImage 2D Sampled=2 | texture2d<type, access::read> | RWTexture2D | | texture_storage_2d_array<image_storage_type> | OpTypeImage 2D Arrayed=1 Sampled=2 | texture2d_array<type, access::read> | RWTexture2DArray | | texture_storage_3d<image_storage_type> | OpTypeImage 3D Sampled=2 | texture3d<type, access::read> | RWTexture3D | | | | | | texture_storage_1d<image_storage_type> | OpTypeImage 1D Sampled=2 | texture1d<type, access::write> | RWTexture1D | -| texture_storage_1d_array<image_storage_type> | OpTypeImage 1D Arrayed=1 Sampled=2 | texture1d_array<type, access::write> | RWTexture1DArray | | texture_storage_2d<image_storage_type> | OpTypeImage 2D Sampled=1 | texture2d<type, access::write> | RWTexture2D | | texture_storage_2d_array<image_storage_type> | OpTypeImage 2D Arrayed=1 Sampled=2 | texture2d_array<type, access::write> | RWTexture2DArray | | texture_storage_3d<image_storage_type> | OpTypeImage 3D Sampled=2 | texture3d<type, access::write> | RWTexture3D| diff --git a/fuzzers/dictionary.txt b/fuzzers/dictionary.txt index 08a5059f23..baccbb819d 100644 --- a/fuzzers/dictionary.txt +++ b/fuzzers/dictionary.txt @@ -92,7 +92,6 @@ "texture_storage_2d_array" "texture_storage_3d" "texture_1d" -"texture_1d_array" "texture_2d" "texture_2d_array" "texture_3d" diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index 69c9c6757e..958ba7c159 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -213,16 +213,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureDimensions", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kDimensions1dArray, - "textureDimensions(t : texture_1d_array) -> i32", - TextureKind::kRegular, - type::SamplerKind::kSampler, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureDimensions", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kDimensions2d, "textureDimensions(t : texture_2d) -> vec2", @@ -443,17 +433,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureDimensions", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kDimensionsStorageRO1dArray, - "textureDimensions(t : texture_storage_1d_array) -> " - "i32", - ast::AccessControl::kReadOnly, - type::ImageFormat::kRgba32Float, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureDimensions", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kDimensionsStorageRO2d, "textureDimensions(t : texture_storage_2d) -> " @@ -497,17 +476,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureDimensions", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kDimensionsStorageWO1dArray, - "textureDimensions(t : texture_storage_1d_array) -> " - "i32", - ast::AccessControl::kWriteOnly, - type::ImageFormat::kRgba32Float, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureDimensions", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kDimensionsStorageWO2d, "textureDimensions(t : texture_storage_2d) -> " @@ -541,16 +509,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureDimensions", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kNumLayers1dArray, - "textureNumLayers(t : texture_1d_array) -> i32", - TextureKind::kRegular, - type::SamplerKind::kSampler, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureNumLayers", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kNumLayers2dArray, "textureNumLayers(t : texture_2d_array) -> i32", @@ -601,16 +559,6 @@ std::vector TextureOverloadCase::ValidCases() { "textureNumLayers", [](ProgramBuilder* b) { return b->ExprList("texture"); }, }, - { - ValidTextureOverload::kNumLayersStorageWO1dArray, - "textureNumLayers(t : texture_storage_1d_array) -> i32", - ast::AccessControl::kWriteOnly, - type::ImageFormat::kRgba32Float, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureNumLayers", - [](ProgramBuilder* b) { return b->ExprList("texture"); }, - }, { ValidTextureOverload::kNumLayersStorageWO2dArray, "textureNumLayers(t : texture_storage_2d_array) -> i32", @@ -747,24 +695,6 @@ std::vector TextureOverloadCase::ValidCases() { 1.0f); // coords }, }, - { - ValidTextureOverload::kSample1dArrayF32, - "textureSample(t : texture_1d_array,\n" - " s : sampler,\n" - " coords : f32,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::SamplerKind::kSampler, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureSample", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - "sampler", // s - 1.0f, // coords - 2); // array_index - }, - }, { ValidTextureOverload::kSample2dF32, "textureSample(t : texture_2d,\n" @@ -1770,51 +1700,6 @@ std::vector TextureOverloadCase::ValidCases() { 1); // coords }, }, - { - ValidTextureOverload::kLoad1dArrayF32, - "textureLoad(t : texture_1d_array,\n" - " coords : i32,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1, // coords - 2); // array_index - }, - }, - { - ValidTextureOverload::kLoad1dArrayU32, - "textureLoad(t : texture_1d_array,\n" - " coords : i32,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1dArray, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1, // coords - 2); // array_index - }, - }, - { - ValidTextureOverload::kLoad1dArrayI32, - "textureLoad(t : texture_1d_array,\n" - " coords : i32,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1dArray, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1, // coords - 2); // array_index - }, - }, { ValidTextureOverload::kLoad2dF32, "textureLoad(t : texture_2d,\n" @@ -2249,23 +2134,6 @@ std::vector TextureOverloadCase::ValidCases() { 1); // coords }, }, - { - ValidTextureOverload::kLoadStorageRO1dArrayRgba32float, - "textureLoad(t : " - "texture_storage_1d_array,\n" - " coords : i32,\n" - " array_index : i32) -> vec4", - ast::AccessControl::kReadOnly, - type::ImageFormat::kRgba32Float, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1, // coords - 2); // array_index - }, - }, { ValidTextureOverload::kLoadStorageRO2dRgba8unorm, "textureLoad(t : texture_storage_2d,\n" @@ -2537,24 +2405,6 @@ std::vector TextureOverloadCase::ValidCases() { b->vec4(2.f, 3.f, 4.f, 5.f)); // value }, }, - { - ValidTextureOverload::kStoreWO1dArrayRgba32float, - "textureStore(t : texture_storage_1d_array,\n" - " coords : i32,\n" - " array_index : i32,\n" - " value : vec4) -> void", - ast::AccessControl::kWriteOnly, - type::ImageFormat::kRgba32Float, - type::TextureDimension::k1dArray, - TextureDataType::kF32, - "textureStore", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1, // coords - 2, // array_index - b->vec4(3.f, 4.f, 5.f, 6.f)); // value - }, - }, { ValidTextureOverload::kStoreWO2dRgba32float, "textureStore(t : texture_storage_2d,\n" diff --git a/src/ast/intrinsic_texture_helper_test.h b/src/ast/intrinsic_texture_helper_test.h index 695ac376f0..626e7ea860 100644 --- a/src/ast/intrinsic_texture_helper_test.h +++ b/src/ast/intrinsic_texture_helper_test.h @@ -38,7 +38,6 @@ std::ostream& operator<<(std::ostream& out, const TextureDataType& ty); /// Non-exhaustive list of valid texture overloads enum class ValidTextureOverload { kDimensions1d, - kDimensions1dArray, kDimensions2d, kDimensions2dLevel, kDimensions2dArray, @@ -60,22 +59,18 @@ enum class ValidTextureOverload { kDimensionsDepthCubeArray, kDimensionsDepthCubeArrayLevel, kDimensionsStorageRO1d, - kDimensionsStorageRO1dArray, kDimensionsStorageRO2d, kDimensionsStorageRO2dArray, kDimensionsStorageRO3d, kDimensionsStorageWO1d, - kDimensionsStorageWO1dArray, kDimensionsStorageWO2d, kDimensionsStorageWO2dArray, kDimensionsStorageWO3d, - kNumLayers1dArray, kNumLayers2dArray, kNumLayersCubeArray, kNumLayersMultisampled2dArray, kNumLayersDepth2dArray, kNumLayersDepthCubeArray, - kNumLayersStorageWO1dArray, kNumLayersStorageWO2dArray, kNumLevels2d, kNumLevels2dArray, @@ -89,7 +84,6 @@ enum class ValidTextureOverload { kNumSamplesMultisampled2d, kNumSamplesMultisampled2dArray, kSample1dF32, - kSample1dArrayF32, kSample2dF32, kSample2dOffsetF32, kSample2dArrayF32, @@ -143,9 +137,6 @@ enum class ValidTextureOverload { kLoad1dF32, kLoad1dU32, kLoad1dI32, - kLoad1dArrayF32, - kLoad1dArrayU32, - kLoad1dArrayI32, kLoad2dF32, kLoad2dU32, kLoad2dI32, @@ -175,7 +166,6 @@ enum class ValidTextureOverload { kLoadDepth2dArrayF32, kLoadDepth2dArrayLevelF32, kLoadStorageRO1dRgba32float, // Not permutated for all texel formats - kLoadStorageRO1dArrayRgba32float, // Not permutated for all texel formats kLoadStorageRO2dRgba8unorm, kLoadStorageRO2dRgba8snorm, kLoadStorageRO2dRgba8uint, @@ -195,7 +185,6 @@ enum class ValidTextureOverload { kLoadStorageRO2dArrayRgba32float, // Not permutated for all texel formats kLoadStorageRO3dRgba32float, // Not permutated for all texel formats kStoreWO1dRgba32float, // Not permutated for all texel formats - kStoreWO1dArrayRgba32float, // Not permutated for all texel formats kStoreWO2dRgba32float, // Not permutated for all texel formats kStoreWO2dArrayRgba32float, // Not permutated for all texel formats kStoreWO3dRgba32float, // Not permutated for all texel formats diff --git a/src/inspector/inspector.cc b/src/inspector/inspector.cc index e5f7beab6d..088f5b1037 100644 --- a/src/inspector/inspector.cc +++ b/src/inspector/inspector.cc @@ -67,8 +67,6 @@ TypeTextureDimensionToResourceBindingTextureDimension( switch (type_dim) { case type::TextureDimension::k1d: return ResourceBinding::TextureDimension::k1d; - case type::TextureDimension::k1dArray: - return ResourceBinding::TextureDimension::k1dArray; case type::TextureDimension::k2d: return ResourceBinding::TextureDimension::k2d; case type::TextureDimension::k2dArray: diff --git a/src/inspector/inspector.h b/src/inspector/inspector.h index db9c3c0a8d..f706ae3a75 100644 --- a/src/inspector/inspector.h +++ b/src/inspector/inspector.h @@ -37,8 +37,6 @@ struct ResourceBinding { kNone = -1, /// 1 dimensional texture k1d, - /// 1 dimenstional array texture - k1dArray, /// 2 dimensional texture k2d, /// 2 dimensional array texture diff --git a/src/inspector/inspector_test.cc b/src/inspector/inspector_test.cc index 001ebe67fb..f50a83f164 100644 --- a/src/inspector/inspector_test.cc +++ b/src/inspector/inspector_test.cc @@ -586,7 +586,6 @@ class InspectorHelper : public ProgramBuilder { type::Type* GetCoordsType(type::TextureDimension dim, type::Type* scalar) { switch (dim) { case type::TextureDimension::k1d: - case type::TextureDimension::k1dArray: return scalar; case type::TextureDimension::k2d: case type::TextureDimension::k2dArray: @@ -2352,10 +2351,6 @@ INSTANTIATE_TEST_SUITE_P( InspectorGetSampledArrayTextureResourceBindingsTest, InspectorGetSampledArrayTextureResourceBindingsTestWithParam, testing::Values( - GetSampledTextureTestParams{ - type::TextureDimension::k1dArray, - inspector::ResourceBinding::TextureDimension::k1dArray, - inspector::ResourceBinding::SampledKind::kFloat}, GetSampledTextureTestParams{ type::TextureDimension::k2dArray, inspector::ResourceBinding::TextureDimension::k2dArray, @@ -2470,18 +2465,6 @@ INSTANTIATE_TEST_SUITE_P( InspectorGetMultisampledArrayTextureResourceBindingsTest, InspectorGetMultisampledArrayTextureResourceBindingsTestWithParam, testing::Values( - GetMultisampledTextureTestParams{ - type::TextureDimension::k1dArray, - inspector::ResourceBinding::TextureDimension::k1dArray, - inspector::ResourceBinding::SampledKind::kFloat}, - GetMultisampledTextureTestParams{ - type::TextureDimension::k1dArray, - inspector::ResourceBinding::TextureDimension::k1dArray, - inspector::ResourceBinding::SampledKind::kSInt}, - GetMultisampledTextureTestParams{ - type::TextureDimension::k1dArray, - inspector::ResourceBinding::TextureDimension::k1dArray, - inspector::ResourceBinding::SampledKind::kUInt}, GetMultisampledTextureTestParams{ type::TextureDimension::k2dArray, inspector::ResourceBinding::TextureDimension::k2dArray, @@ -2537,7 +2520,6 @@ TEST_P(InspectorGetStorageTextureResourceBindingsTestWithParam, Simple) { type::Type* dim_type = nullptr; switch (dim) { case type::TextureDimension::k1d: - case type::TextureDimension::k1dArray: dim_type = ty.i32(); break; case type::TextureDimension::k2d: @@ -2590,8 +2572,6 @@ INSTANTIATE_TEST_SUITE_P( testing::Values( std::make_tuple(type::TextureDimension::k1d, ResourceBinding::TextureDimension::k1d), - std::make_tuple(type::TextureDimension::k1dArray, - ResourceBinding::TextureDimension::k1dArray), std::make_tuple(type::TextureDimension::k2d, ResourceBinding::TextureDimension::k2d), std::make_tuple(type::TextureDimension::k2dArray, diff --git a/src/intrinsic_table.cc b/src/intrinsic_table.cc index 34550b1e86..31b1a7ef5d 100644 --- a/src/intrinsic_table.cc +++ b/src/intrinsic_table.cc @@ -1075,8 +1075,6 @@ Impl::Impl() { auto* tex_1d_f32 = sampled_texture(Dim::k1d, f32); auto* tex_1d_T = sampled_texture(Dim::k1d, T); - auto* tex_1d_array_f32 = sampled_texture(Dim::k1dArray, f32); - auto* tex_1d_array_T = sampled_texture(Dim::k1dArray, T); auto* tex_2d_f32 = sampled_texture(Dim::k2d, f32); auto* tex_2d_T = sampled_texture(Dim::k2d, T); auto* tex_2d_array_f32 = sampled_texture(Dim::k2dArray, f32); @@ -1095,8 +1093,6 @@ Impl::Impl() { auto* tex_depth_cube_array = depth_texture(Dim::kCubeArray); auto* tex_storage_1d_FT = storage_texture(Dim::k1d, OpenNumber::F, OpenType::T); - auto* tex_storage_1d_array_FT = - storage_texture(Dim::k1dArray, OpenNumber::F, OpenType::T); auto* tex_storage_2d_FT = storage_texture(Dim::k2d, OpenNumber::F, OpenType::T); auto* tex_storage_2d_array_FT = @@ -1105,8 +1101,6 @@ Impl::Impl() { storage_texture(Dim::k3d, OpenNumber::F, OpenType::T); auto* tex_storage_ro_1d_FT = access_control(ast::AccessControl::kReadOnly, tex_storage_1d_FT); - auto* tex_storage_ro_1d_array_FT = - access_control(ast::AccessControl::kReadOnly, tex_storage_1d_array_FT); auto* tex_storage_ro_2d_FT = access_control(ast::AccessControl::kReadOnly, tex_storage_2d_FT); auto* tex_storage_ro_2d_array_FT = @@ -1115,8 +1109,6 @@ Impl::Impl() { access_control(ast::AccessControl::kReadOnly, tex_storage_3d_FT); auto* tex_storage_wo_1d_FT = access_control(ast::AccessControl::kWriteOnly, tex_storage_1d_FT); - auto* tex_storage_wo_1d_array_FT = - access_control(ast::AccessControl::kWriteOnly, tex_storage_1d_array_FT); auto* tex_storage_wo_2d_FT = access_control(ast::AccessControl::kWriteOnly, tex_storage_2d_FT); auto* tex_storage_wo_2d_array_FT = @@ -1143,7 +1135,6 @@ Impl::Impl() { // name return type parameter types Register(I::kTextureDimensions, i32, {{t, tex_1d_T}, }); // NOLINT - Register(I::kTextureDimensions, i32, {{t, tex_1d_array_T}, }); // NOLINT Register(I::kTextureDimensions, vec2_i32, {{t, tex_2d_T}, }); // NOLINT Register(I::kTextureDimensions, vec2_i32, {{t, tex_2d_T}, {level, i32}, }); // NOLINT Register(I::kTextureDimensions, vec2_i32, {{t, tex_2d_array_T}, }); // NOLINT @@ -1165,18 +1156,15 @@ Impl::Impl() { Register(I::kTextureDimensions, vec3_i32, {{t, tex_depth_cube_array}, }); // NOLINT Register(I::kTextureDimensions, vec3_i32, {{t, tex_depth_cube_array}, {level, i32}, }); // NOLINT Register(I::kTextureDimensions, i32, {{t, tex_storage_1d_FT}, }); // NOLINT - Register(I::kTextureDimensions, i32, {{t, tex_storage_1d_array_FT}, }); // NOLINT Register(I::kTextureDimensions, vec2_i32, {{t, tex_storage_2d_FT}, }); // NOLINT Register(I::kTextureDimensions, vec2_i32, {{t, tex_storage_2d_array_FT}, }); // NOLINT Register(I::kTextureDimensions, vec3_i32, {{t, tex_storage_3d_FT}, }); // NOLINT - Register(I::kTextureNumLayers, i32, {{t, tex_1d_array_T}, }); Register(I::kTextureNumLayers, i32, {{t, tex_2d_array_T}, }); Register(I::kTextureNumLayers, i32, {{t, tex_cube_array_T}, }); Register(I::kTextureNumLayers, i32, {{t, tex_ms_2d_array_T}, }); Register(I::kTextureNumLayers, i32, {{t, tex_depth_2d_array}, }); Register(I::kTextureNumLayers, i32, {{t, tex_depth_cube_array}, }); - Register(I::kTextureNumLayers, i32, {{t, tex_storage_1d_array_FT}, }); Register(I::kTextureNumLayers, i32, {{t, tex_storage_2d_array_FT}, }); Register(I::kTextureNumLevels, i32, {{t, tex_2d_T}, }); @@ -1193,7 +1181,6 @@ Impl::Impl() { Register(I::kTextureNumSamples, i32, {{t, tex_ms_2d_array_T}, }); Register(I::kTextureSample, vec4_f32, {{t, tex_1d_f32}, {s, sampler}, {coords, f32}, }); // NOLINT - Register(I::kTextureSample, vec4_f32, {{t, tex_1d_array_f32}, {s, sampler}, {coords, f32}, {array_index, i32}, }); // NOLINT Register(I::kTextureSample, vec4_f32, {{t, tex_2d_f32}, {s, sampler}, {coords, vec2_f32}, }); // NOLINT Register(I::kTextureSample, vec4_f32, {{t, tex_2d_f32}, {s, sampler}, {coords, vec2_f32}, {offset, vec2_i32}, }); // NOLINT Register(I::kTextureSample, vec4_f32, {{t, tex_2d_array_f32}, {s, sampler}, {coords, vec2_f32}, {array_index, i32}, }); // NOLINT @@ -1250,7 +1237,6 @@ Impl::Impl() { Register(I::kTextureSampleLevel, f32, {{t, tex_depth_cube_array},{s, sampler}, {coords, vec3_f32}, {array_index, i32}, {level, i32}, }); // NOLINT Register(I::kTextureStore, void_, {{t, tex_storage_wo_1d_FT}, {coords, i32}, {value, vec4_T}, }); // NOLINT - Register(I::kTextureStore, void_, {{t, tex_storage_wo_1d_array_FT},{coords, i32}, {array_index, i32}, {value, vec4_T}, }); // NOLINT Register(I::kTextureStore, void_, {{t, tex_storage_wo_2d_FT}, {coords, vec2_i32}, {value, vec4_T}, }); // NOLINT Register(I::kTextureStore, void_, {{t, tex_storage_wo_2d_array_FT},{coords, vec2_i32}, {array_index, i32}, {value, vec4_T}, }); // NOLINT Register(I::kTextureStore, void_, {{t, tex_storage_wo_3d_FT}, {coords, vec3_i32}, {value, vec4_T}, }); // NOLINT @@ -1263,7 +1249,6 @@ Impl::Impl() { Register(I::kTextureLoad, f32, {{t, tex_depth_2d}, {coords, vec2_i32}, {level, i32}, }); // NOLINT Register(I::kTextureLoad, f32, {{t, tex_depth_2d_array}, {coords, vec2_i32}, {array_index, i32}, {level, i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_storage_ro_1d_FT}, {coords, i32}, }); // NOLINT - Register(I::kTextureLoad, vec4_T, {{t, tex_storage_ro_1d_array_FT},{coords, i32}, {array_index, i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_storage_ro_2d_FT}, {coords, vec2_i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_storage_ro_2d_array_FT},{coords, vec2_i32}, {array_index, i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_storage_ro_3d_FT}, {coords, vec3_i32}, }); // NOLINT @@ -1273,11 +1258,9 @@ Impl::Impl() { // Overloads added in https://github.com/gpuweb/gpuweb/pull/1301 Register(I::kTextureLoad, vec4_T, {{t, tex_1d_T}, {coords, i32}, {level, i32}, }); // NOLINT - Register(I::kTextureLoad, vec4_T, {{t, tex_1d_array_T}, {coords, i32}, {array_index, i32}, {level, i32}, }); // NOLINT // Overloads removed in https://github.com/gpuweb/gpuweb/pull/1301 Register(I::kTextureLoad, vec4_T, {{t, tex_1d_T}, {coords, i32}, }); // NOLINT - Register(I::kTextureLoad, vec4_T, {{t, tex_1d_array_T}, {coords, i32}, {array_index, i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_2d_T}, {coords, vec2_i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_2d_array_T}, {coords, vec2_i32}, {array_index, i32}, }); // NOLINT Register(I::kTextureLoad, vec4_T, {{t, tex_3d_T}, {coords, vec3_i32}, }); // NOLINT diff --git a/src/intrinsic_table_test.cc b/src/intrinsic_table_test.cc index 0b7c1d5a40..2a282467c0 100644 --- a/src/intrinsic_table_test.cc +++ b/src/intrinsic_table_test.cc @@ -423,7 +423,7 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) { ASSERT_EQ(result.diagnostics.str(), R"(error: no matching call to textureDimensions(bool, bool) -27 candidate functions: +25 candidate functions: textureDimensions(texture : texture_2d, level : i32) -> vec2 textureDimensions(texture : texture_2d_array, level : i32) -> vec2 textureDimensions(texture : texture_3d, level : i32) -> vec3 @@ -434,7 +434,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) { textureDimensions(texture : texture_depth_cube, level : i32) -> vec3 textureDimensions(texture : texture_depth_cube_array, level : i32) -> vec3 textureDimensions(texture : texture_1d) -> i32 - textureDimensions(texture : texture_1d_array) -> i32 textureDimensions(texture : texture_2d) -> vec2 textureDimensions(texture : texture_2d_array) -> vec2 textureDimensions(texture : texture_3d) -> vec3 @@ -447,7 +446,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) { textureDimensions(texture : texture_depth_cube) -> vec3 textureDimensions(texture : texture_depth_cube_array) -> vec3 textureDimensions(texture : texture_storage_1d) -> i32 - textureDimensions(texture : texture_storage_1d_array) -> i32 textureDimensions(texture : texture_storage_2d) -> vec2 textureDimensions(texture : texture_storage_2d_array) -> vec2 textureDimensions(texture : texture_storage_3d) -> vec3 @@ -462,7 +460,7 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) { result.diagnostics.str(), R"(error: no matching call to textureDimensions(texture_depth_2d, bool) -27 candidate functions: +25 candidate functions: textureDimensions(texture : texture_depth_2d, level : i32) -> vec2 textureDimensions(texture : texture_depth_2d) -> vec2 textureDimensions(texture : texture_2d, level : i32) -> vec2 @@ -474,7 +472,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) { textureDimensions(texture : texture_depth_cube, level : i32) -> vec3 textureDimensions(texture : texture_depth_cube_array, level : i32) -> vec3 textureDimensions(texture : texture_1d) -> i32 - textureDimensions(texture : texture_1d_array) -> i32 textureDimensions(texture : texture_2d) -> vec2 textureDimensions(texture : texture_2d_array) -> vec2 textureDimensions(texture : texture_3d) -> vec3 @@ -486,7 +483,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) { textureDimensions(texture : texture_depth_cube) -> vec3 textureDimensions(texture : texture_depth_cube_array) -> vec3 textureDimensions(texture : texture_storage_1d) -> i32 - textureDimensions(texture : texture_storage_1d_array) -> i32 textureDimensions(texture : texture_storage_2d) -> vec2 textureDimensions(texture : texture_storage_2d_array) -> vec2 textureDimensions(texture : texture_storage_3d) -> vec3 diff --git a/src/reader/spirv/enum_converter.cc b/src/reader/spirv/enum_converter.cc index 5694d92bcc..bfdb4fb8a5 100644 --- a/src/reader/spirv/enum_converter.cc +++ b/src/reader/spirv/enum_converter.cc @@ -102,8 +102,6 @@ ast::Builtin EnumConverter::ToBuiltin(SpvBuiltIn b, ast::StorageClass sc) { type::TextureDimension EnumConverter::ToDim(SpvDim dim, bool arrayed) { if (arrayed) { switch (dim) { - case SpvDim1D: - return type::TextureDimension::k1dArray; case SpvDim2D: return type::TextureDimension::k2dArray; case SpvDimCube: diff --git a/src/reader/spirv/enum_converter_test.cc b/src/reader/spirv/enum_converter_test.cc index 2bcad74922..588c5e057c 100644 --- a/src/reader/spirv/enum_converter_test.cc +++ b/src/reader/spirv/enum_converter_test.cc @@ -306,7 +306,6 @@ INSTANTIATE_TEST_SUITE_P( DimCase{SpvDim3D, false, true, type::TextureDimension::k3d}, DimCase{SpvDimCube, false, true, type::TextureDimension::kCube}, // Arrayed - DimCase{SpvDim1D, true, true, type::TextureDimension::k1dArray}, DimCase{SpvDim2D, true, true, type::TextureDimension::k2dArray}, DimCase{SpvDimCube, true, true, type::TextureDimension::kCubeArray})); diff --git a/src/reader/spirv/parser_impl_handle_test.cc b/src/reader/spirv/parser_impl_handle_test.cc index 0bb902420e..279514db63 100644 --- a/src/reader/spirv/parser_impl_handle_test.cc +++ b/src/reader/spirv/parser_impl_handle_test.cc @@ -114,7 +114,6 @@ std::string CommonImageTypes() { ; sampled images %f_texture_1d = OpTypeImage %float 1D 0 0 0 1 Unknown - %f_texture_1d_array = OpTypeImage %float 1D 0 1 0 1 Unknown %f_texture_2d = OpTypeImage %float 2D 0 0 0 1 Unknown %f_texture_2d_ms = OpTypeImage %float 2D 0 0 1 1 Unknown %f_texture_2d_array = OpTypeImage %float 2D 0 1 0 1 Unknown @@ -125,7 +124,6 @@ std::string CommonImageTypes() { ; storage images %f_storage_1d = OpTypeImage %float 1D 0 0 0 1 Rg32f - %f_storage_1d_array = OpTypeImage %float 1D 0 1 0 1 Rg32f %f_storage_2d = OpTypeImage %float 2D 0 0 0 1 Rg32f %f_storage_2d_array = OpTypeImage %float 2D 0 1 0 1 Rg32f %f_storage_3d = OpTypeImage %float 3D 0 0 0 1 Rg32f @@ -133,7 +131,6 @@ std::string CommonImageTypes() { ; Now all the same, but for unsigned integer sampled type. %u_texture_1d = OpTypeImage %uint 1D 0 0 0 1 Unknown - %u_texture_1d_array = OpTypeImage %uint 1D 0 1 0 1 Unknown %u_texture_2d = OpTypeImage %uint 2D 0 0 0 1 Unknown %u_texture_2d_ms = OpTypeImage %uint 2D 0 0 1 1 Unknown %u_texture_2d_array = OpTypeImage %uint 2D 0 1 0 1 Unknown @@ -143,7 +140,6 @@ std::string CommonImageTypes() { %u_texture_cube_array = OpTypeImage %uint Cube 0 1 0 1 Unknown %u_storage_1d = OpTypeImage %uint 1D 0 0 0 1 Rg32ui - %u_storage_1d_array = OpTypeImage %uint 1D 0 1 0 1 Rg32ui %u_storage_2d = OpTypeImage %uint 2D 0 0 0 1 Rg32ui %u_storage_2d_array = OpTypeImage %uint 2D 0 1 0 1 Rg32ui %u_storage_3d = OpTypeImage %uint 3D 0 0 0 1 Rg32ui @@ -151,7 +147,6 @@ std::string CommonImageTypes() { ; Now all the same, but for signed integer sampled type. %i_texture_1d = OpTypeImage %int 1D 0 0 0 1 Unknown - %i_texture_1d_array = OpTypeImage %int 1D 0 1 0 1 Unknown %i_texture_2d = OpTypeImage %int 2D 0 0 0 1 Unknown %i_texture_2d_ms = OpTypeImage %int 2D 0 0 1 1 Unknown %i_texture_2d_array = OpTypeImage %int 2D 0 1 0 1 Unknown @@ -161,7 +156,6 @@ std::string CommonImageTypes() { %i_texture_cube_array = OpTypeImage %int Cube 0 1 0 1 Unknown %i_storage_1d = OpTypeImage %int 1D 0 0 0 1 Rg32i - %i_storage_1d_array = OpTypeImage %int 1D 0 1 0 1 Rg32i %i_storage_2d = OpTypeImage %int 2D 0 0 0 1 Rg32i %i_storage_2d_array = OpTypeImage %int 2D 0 1 0 1 Rg32i %i_storage_3d = OpTypeImage %int 3D 0 0 0 1 Rg32i @@ -171,7 +165,6 @@ std::string CommonImageTypes() { %ptr_sampler = OpTypePointer UniformConstant %sampler %ptr_f_texture_1d = OpTypePointer UniformConstant %f_texture_1d - %ptr_f_texture_1d_array = OpTypePointer UniformConstant %f_texture_1d_array %ptr_f_texture_2d = OpTypePointer UniformConstant %f_texture_2d %ptr_f_texture_2d_ms = OpTypePointer UniformConstant %f_texture_2d_ms %ptr_f_texture_2d_array = OpTypePointer UniformConstant %f_texture_2d_array @@ -182,7 +175,6 @@ std::string CommonImageTypes() { ; storage images %ptr_f_storage_1d = OpTypePointer UniformConstant %f_storage_1d - %ptr_f_storage_1d_array = OpTypePointer UniformConstant %f_storage_1d_array %ptr_f_storage_2d = OpTypePointer UniformConstant %f_storage_2d %ptr_f_storage_2d_array = OpTypePointer UniformConstant %f_storage_2d_array %ptr_f_storage_3d = OpTypePointer UniformConstant %f_storage_3d @@ -190,7 +182,6 @@ std::string CommonImageTypes() { ; Now all the same, but for unsigned integer sampled type. %ptr_u_texture_1d = OpTypePointer UniformConstant %u_texture_1d - %ptr_u_texture_1d_array = OpTypePointer UniformConstant %u_texture_1d_array %ptr_u_texture_2d = OpTypePointer UniformConstant %u_texture_2d %ptr_u_texture_2d_ms = OpTypePointer UniformConstant %u_texture_2d_ms %ptr_u_texture_2d_array = OpTypePointer UniformConstant %u_texture_2d_array @@ -200,7 +191,6 @@ std::string CommonImageTypes() { %ptr_u_texture_cube_array = OpTypePointer UniformConstant %u_texture_cube_array %ptr_u_storage_1d = OpTypePointer UniformConstant %u_storage_1d - %ptr_u_storage_1d_array = OpTypePointer UniformConstant %u_storage_1d_array %ptr_u_storage_2d = OpTypePointer UniformConstant %u_storage_2d %ptr_u_storage_2d_array = OpTypePointer UniformConstant %u_storage_2d_array %ptr_u_storage_3d = OpTypePointer UniformConstant %u_storage_3d @@ -208,7 +198,6 @@ std::string CommonImageTypes() { ; Now all the same, but for signed integer sampled type. %ptr_i_texture_1d = OpTypePointer UniformConstant %i_texture_1d - %ptr_i_texture_1d_array = OpTypePointer UniformConstant %i_texture_1d_array %ptr_i_texture_2d = OpTypePointer UniformConstant %i_texture_2d %ptr_i_texture_2d_ms = OpTypePointer UniformConstant %i_texture_2d_ms %ptr_i_texture_2d_array = OpTypePointer UniformConstant %i_texture_2d_array @@ -218,7 +207,6 @@ std::string CommonImageTypes() { %ptr_i_texture_cube_array = OpTypePointer UniformConstant %i_texture_cube_array %ptr_i_storage_1d = OpTypePointer UniformConstant %i_storage_1d - %ptr_i_storage_1d_array = OpTypePointer UniformConstant %i_storage_1d_array %ptr_i_storage_2d = OpTypePointer UniformConstant %i_storage_2d %ptr_i_storage_2d_array = OpTypePointer UniformConstant %i_storage_2d_array %ptr_i_storage_3d = OpTypePointer UniformConstant %i_storage_3d @@ -3810,43 +3798,8 @@ INSTANTIATE_TEST_SUITE_P( // is readonly or writeonly. SpvParserTest_SampledImageAccessTest, ::testing::ValuesIn(std::vector{ - // 1D array storage image - {"%float 1D 0 1 0 2 Rgba32f", - "%99 = OpImageQuerySize %v2int %im \n" - "%98 = OpImageRead %v4float %im %vi12\n", - R"(Variable{ - Decorations{ - GroupDecoration{2} - BindingDecoration{1} - } - x_20 - uniform_constant - __access_control_read_only__storage_texture_1d_array_rgba32float - })", - R"(VariableDeclStatement{ - VariableConst{ - x_99 - none - __vec_2__i32 - { - TypeConstructor[not set]{ - __vec_2__i32 - Call[not set]{ - Identifier[not set]{textureDimensions} - ( - Identifier[not set]{x_20} - ) - } - Call[not set]{ - Identifier[not set]{textureNumLayers} - ( - Identifier[not set]{x_20} - ) - } - } - } - } - })"}, + // 1D array storage image doesn't exist. + // 2D array storage image {"%float 2D 0 1 0 2 Rgba32f", "%99 = OpImageQuerySize %v3int %im \n" @@ -4132,43 +4085,7 @@ INSTANTIATE_TEST_SUITE_P( SpvParserTest_SampledImageAccessTest, ::testing::ValuesIn(std::vector{ - // 1D arrayed - {"%float 1D 0 1 0 1 Unknown", - "%99 = OpImageQuerySizeLod %v2int %im %i1\n", - R"(Variable{ - Decorations{ - GroupDecoration{2} - BindingDecoration{1} - } - x_20 - uniform_constant - __sampled_texture_1d_array__f32 - })", - R"(VariableDeclStatement{ - VariableConst{ - x_99 - none - __vec_2__i32 - { - TypeConstructor[not set]{ - __vec_2__i32 - Call[not set]{ - Identifier[not set]{textureDimensions} - ( - Identifier[not set]{x_20} - Identifier[not set]{i1} - ) - } - Call[not set]{ - Identifier[not set]{textureNumLayers} - ( - Identifier[not set]{x_20} - ) - } - } - } - } - })"}, + // There is no 1D array // 2D array {"%float 2D 0 1 0 1 Unknown", @@ -5530,13 +5447,6 @@ INSTANTIATE_TEST_SUITE_P( "bad or unsupported coordinate type for image access: %71 = " "OpImageSampleImplicitLod %42 %70 %1", {}}, - {"%float 1D 0 1 0 1 Unknown", // 1DArray - "%result = OpImageSampleImplicitLod " - // 1 component, but need 2 - "%v4float %sampled_image %f1", - "image access required 2 coordinate components, but only 1 provided, " - "in: %71 = OpImageSampleImplicitLod %42 %70 %12", - {}}, {"%float 2D 0 0 0 1 Unknown", // 2D "%result = OpImageSampleImplicitLod " // 1 component, but need 2 @@ -5641,12 +5551,6 @@ INSTANTIATE_TEST_SUITE_P( "ConstOffset %the_vu12", "ConstOffset is only permitted for 2D, 2D Arrayed, and 3D textures: ", {}}, - // 1D Array - {"%uint 1D 0 1 0 1 Unknown", - "%result = OpImageSampleImplicitLod %v4float %sampled_image %vf1234 " - "ConstOffset %the_vu12", - "ConstOffset is only permitted for 2D, 2D Arrayed, and 3D textures: ", - {}}, // Cube {"%uint Cube 0 0 0 1 Unknown", "%result = OpImageSampleImplicitLod %v4float %sampled_image %vf1234 " diff --git a/src/reader/wgsl/lexer.cc b/src/reader/wgsl/lexer.cc index 2939e66f5f..e919279448 100644 --- a/src/reader/wgsl/lexer.cc +++ b/src/reader/wgsl/lexer.cc @@ -657,8 +657,6 @@ Token Lexer::check_keyword(const Source& source, const std::string& str) { return {Token::Type::kSwitch, source, "switch"}; if (str == "texture_1d") return {Token::Type::kTextureSampled1d, source, "texture_1d"}; - if (str == "texture_1d_array") - return {Token::Type::kTextureSampled1dArray, source, "texture_1d_array"}; if (str == "texture_2d") return {Token::Type::kTextureSampled2d, source, "texture_2d"}; if (str == "texture_2d_array") @@ -690,10 +688,6 @@ Token Lexer::check_keyword(const Source& source, const std::string& str) { if (str == "texture_storage_1d") { return {Token::Type::kTextureStorage1d, source, "texture_storage_1d"}; } - if (str == "texture_storage_1d_array") { - return {Token::Type::kTextureStorage1dArray, source, - "texture_storage_1d_array"}; - } if (str == "texture_storage_2d") { return {Token::Type::kTextureStorage2d, source, "texture_storage_2d"}; } diff --git a/src/reader/wgsl/lexer_test.cc b/src/reader/wgsl/lexer_test.cc index fe6d9eb392..8652c02448 100644 --- a/src/reader/wgsl/lexer_test.cc +++ b/src/reader/wgsl/lexer_test.cc @@ -550,7 +550,6 @@ INSTANTIATE_TEST_SUITE_P( TokenData{"struct", Token::Type::kStruct}, TokenData{"switch", Token::Type::kSwitch}, TokenData{"texture_1d", Token::Type::kTextureSampled1d}, - TokenData{"texture_1d_array", Token::Type::kTextureSampled1dArray}, TokenData{"texture_2d", Token::Type::kTextureSampled2d}, TokenData{"texture_2d_array", Token::Type::kTextureSampled2dArray}, TokenData{"texture_3d", Token::Type::kTextureSampled3d}, @@ -564,8 +563,6 @@ INSTANTIATE_TEST_SUITE_P( TokenData{"texture_multisampled_2d", Token::Type::kTextureMultisampled2d}, TokenData{"texture_storage_1d", Token::Type::kTextureStorage1d}, - TokenData{"texture_storage_1d_array", - Token::Type::kTextureStorage1dArray}, TokenData{"texture_storage_2d", Token::Type::kTextureStorage2d}, TokenData{"texture_storage_2d_array", Token::Type::kTextureStorage2dArray}, diff --git a/src/reader/wgsl/parser_impl.cc b/src/reader/wgsl/parser_impl.cc index 94ffb5a21a..fb9535be8f 100644 --- a/src/reader/wgsl/parser_impl.cc +++ b/src/reader/wgsl/parser_impl.cc @@ -584,7 +584,6 @@ Maybe ParserImpl::sampler_type() { // sampled_texture_type // : TEXTURE_SAMPLED_1D -// | TEXTURE_SAMPLED_1D_ARRAY // | TEXTURE_SAMPLED_2D // | TEXTURE_SAMPLED_2D_ARRAY // | TEXTURE_SAMPLED_3D @@ -594,9 +593,6 @@ Maybe ParserImpl::sampled_texture_type() { if (match(Token::Type::kTextureSampled1d)) return type::TextureDimension::k1d; - if (match(Token::Type::kTextureSampled1dArray)) - return type::TextureDimension::k1dArray; - if (match(Token::Type::kTextureSampled2d)) return type::TextureDimension::k2d; @@ -626,15 +622,12 @@ Maybe ParserImpl::multisampled_texture_type() { // storage_texture_type // : TEXTURE_STORAGE_1D -// | TEXTURE_STORAGE_1D_ARRAY // | TEXTURE_STORAGE_2D // | TEXTURE_STORAGE_2D_ARRAY // | TEXTURE_STORAGE_3D Maybe ParserImpl::storage_texture_type() { if (match(Token::Type::kTextureStorage1d)) return type::TextureDimension::k1d; - if (match(Token::Type::kTextureStorage1dArray)) - return type::TextureDimension::k1dArray; if (match(Token::Type::kTextureStorage2d)) return type::TextureDimension::k2d; if (match(Token::Type::kTextureStorage2dArray)) diff --git a/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc b/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc index 6df54081d9..4c1e956cba 100644 --- a/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc +++ b/src/reader/wgsl/parser_impl_sampled_texture_type_test.cc @@ -39,15 +39,6 @@ TEST_F(ParserImplTest, SampledTextureType_1d) { EXPECT_FALSE(p->has_error()); } -TEST_F(ParserImplTest, SampledTextureType_1dArray) { - auto p = parser("texture_1d_array"); - auto t = p->sampled_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k1dArray); - EXPECT_FALSE(p->has_error()); -} - TEST_F(ParserImplTest, SampledTextureType_2d) { auto p = parser("texture_2d"); auto t = p->sampled_texture_type(); diff --git a/src/reader/wgsl/parser_impl_storage_texture_type_test.cc b/src/reader/wgsl/parser_impl_storage_texture_type_test.cc index 999f6a143f..448162fcfd 100644 --- a/src/reader/wgsl/parser_impl_storage_texture_type_test.cc +++ b/src/reader/wgsl/parser_impl_storage_texture_type_test.cc @@ -39,15 +39,6 @@ TEST_F(ParserImplTest, StorageTextureType_1d) { EXPECT_FALSE(p->has_error()); } -TEST_F(ParserImplTest, StorageTextureType_1dArray) { - auto p = parser("texture_storage_1d_array"); - auto t = p->storage_texture_type(); - EXPECT_TRUE(t.matched); - EXPECT_FALSE(t.errored); - EXPECT_EQ(t.value, type::TextureDimension::k1dArray); - EXPECT_FALSE(p->has_error()); -} - TEST_F(ParserImplTest, StorageTextureType_2d) { auto p = parser("texture_storage_2d"); auto t = p->storage_texture_type(); diff --git a/src/reader/wgsl/token.cc b/src/reader/wgsl/token.cc index 5485484f94..69274a03cf 100644 --- a/src/reader/wgsl/token.cc +++ b/src/reader/wgsl/token.cc @@ -273,8 +273,6 @@ std::string Token::TypeToName(Type type) { return "texture_multisampled_2d"; case Token::Type::kTextureSampled1d: return "texture_1d"; - case Token::Type::kTextureSampled1dArray: - return "texture_1d_array"; case Token::Type::kTextureSampled2d: return "texture_2d"; case Token::Type::kTextureSampled2dArray: @@ -287,8 +285,6 @@ std::string Token::TypeToName(Type type) { return "texture_cube_array"; case Token::Type::kTextureStorage1d: return "texture_storage_1d"; - case Token::Type::kTextureStorage1dArray: - return "texture_storage_1d_array"; case Token::Type::kTextureStorage2d: return "texture_storage_2d"; case Token::Type::kTextureStorage2dArray: diff --git a/src/reader/wgsl/token.h b/src/reader/wgsl/token.h index f90de40d95..0ce8aab2ef 100644 --- a/src/reader/wgsl/token.h +++ b/src/reader/wgsl/token.h @@ -284,8 +284,6 @@ class Token { kTextureMultisampled2d, /// A 'texture_1d' kTextureSampled1d, - /// A 'texture_1d_array' - kTextureSampled1dArray, /// A 'texture_2d' kTextureSampled2d, /// A 'texture_2d_array' @@ -298,8 +296,6 @@ class Token { kTextureSampledCubeArray, /// A 'texture_storage_1d' kTextureStorage1d, - /// A 'texture_storage_1d_array' - kTextureStorage1dArray, /// A 'texture_storage_2d' kTextureStorage2d, /// A 'texture_storage_2d_array' @@ -641,10 +637,6 @@ class Token { } /// @returns true if token is a 'texture_storage_1d' bool IsTextureStorage1d() const { return type_ == Type::kTextureStorage1d; } - /// @returns true if token is a 'texture_storage_1d_array' - bool IsTextureStorage1dArray() const { - return type_ == Type::kTextureStorage1dArray; - } /// @returns true if token is a 'texture_storage_2d' bool IsTextureStorage2d() const { return type_ == Type::kTextureStorage2d; } /// @returns true if token is a 'texture_storage_2d_array' @@ -655,10 +647,6 @@ class Token { bool IsTextureStorage3d() const { return type_ == Type::kTextureStorage3d; } /// @returns true if token is a 'texture_1d' bool IsTextureSampled1d() const { return type_ == Type::kTextureSampled1d; } - /// @returns true if token is a 'texture_1d_array' - bool IsTextureSampled1dArray() const { - return type_ == Type::kTextureSampled1dArray; - } /// @returns true if token is a 'texture_2d' bool IsTextureSampled2d() const { return type_ == Type::kTextureSampled2d; } /// @returns true if token is a 'texture_2d_array' diff --git a/src/type/texture_type.cc b/src/type/texture_type.cc index c55c599fec..6fdc99c6d2 100644 --- a/src/type/texture_type.cc +++ b/src/type/texture_type.cc @@ -33,9 +33,6 @@ std::ostream& operator<<(std::ostream& out, TextureDimension dim) { case TextureDimension::k1d: out << "1d"; break; - case TextureDimension::k1dArray: - out << "1d_array"; - break; case TextureDimension::k2d: out << "2d"; break; @@ -57,7 +54,6 @@ std::ostream& operator<<(std::ostream& out, TextureDimension dim) { bool IsTextureArray(TextureDimension dim) { switch (dim) { - case TextureDimension::k1dArray: case TextureDimension::k2dArray: case TextureDimension::kCubeArray: return true; @@ -76,7 +72,6 @@ int NumCoordinateAxes(TextureDimension dim) { case TextureDimension::kNone: return 0; case TextureDimension::k1d: - case TextureDimension::k1dArray: return 1; case TextureDimension::k2d: case TextureDimension::k2dArray: diff --git a/src/type/texture_type.h b/src/type/texture_type.h index 32ea8a01f6..c36ba882f2 100644 --- a/src/type/texture_type.h +++ b/src/type/texture_type.h @@ -26,8 +26,6 @@ enum class TextureDimension { kNone = -1, /// 1 dimensional texture k1d, - /// 1 dimenstional array texture - k1dArray, /// 2 dimensional texture k2d, /// 2 dimensional array texture @@ -47,7 +45,7 @@ bool IsTextureArray(TextureDimension dim); /// Returns the number of axes in the coordinate for a dimensionality. /// None -> 0 -/// 1D, 1DArray -> 1 +/// 1D -> 1 /// 2D, 2DArray -> 2 /// 3D, Cube, CubeArray -> 3 /// @param dim the TextureDimension to query diff --git a/src/type/texture_type_test.cc b/src/type/texture_type_test.cc index 33a2c433db..57c52a4d5d 100644 --- a/src/type/texture_type_test.cc +++ b/src/type/texture_type_test.cc @@ -25,7 +25,6 @@ using TextureTypeTest = TestHelper; TEST_F(TextureTypeTest, IsTextureArray) { EXPECT_EQ(false, IsTextureArray(TextureDimension::kNone)); EXPECT_EQ(false, IsTextureArray(TextureDimension::k1d)); - EXPECT_EQ(true, IsTextureArray(TextureDimension::k1dArray)); EXPECT_EQ(false, IsTextureArray(TextureDimension::k2d)); EXPECT_EQ(true, IsTextureArray(TextureDimension::k2dArray)); EXPECT_EQ(false, IsTextureArray(TextureDimension::k3d)); @@ -36,7 +35,6 @@ TEST_F(TextureTypeTest, IsTextureArray) { TEST_F(TextureTypeTest, NumCoordinateAxes) { EXPECT_EQ(0, NumCoordinateAxes(TextureDimension::kNone)); EXPECT_EQ(1, NumCoordinateAxes(TextureDimension::k1d)); - EXPECT_EQ(1, NumCoordinateAxes(TextureDimension::k1dArray)); EXPECT_EQ(2, NumCoordinateAxes(TextureDimension::k2d)); EXPECT_EQ(2, NumCoordinateAxes(TextureDimension::k2dArray)); EXPECT_EQ(3, NumCoordinateAxes(TextureDimension::k3d)); diff --git a/src/type_determiner_test.cc b/src/type_determiner_test.cc index 1d29466c69..3fd39515c9 100644 --- a/src/type_determiner_test.cc +++ b/src/type_determiner_test.cc @@ -1499,7 +1499,6 @@ class Intrinsic_TextureOperation type::Type* GetCoordsType(type::TextureDimension dim, type::Type* scalar) { switch (dim) { case type::TextureDimension::k1d: - case type::TextureDimension::k1dArray: return scalar; case type::TextureDimension::k2d: case type::TextureDimension::k2dArray: @@ -1580,12 +1579,6 @@ INSTANTIATE_TEST_SUITE_P( type::ImageFormat::kR16Sint}, TextureTestParams{type::TextureDimension::k1d, Texture::kF32, type::ImageFormat::kR8Unorm}, - TextureTestParams{type::TextureDimension::k1dArray, Texture::kF32, - type::ImageFormat::kR16Float}, - TextureTestParams{type::TextureDimension::k1dArray, Texture::kI32, - type::ImageFormat::kR16Sint}, - TextureTestParams{type::TextureDimension::k1dArray, Texture::kF32, - type::ImageFormat::kR8Unorm}, TextureTestParams{type::TextureDimension::k2d, Texture::kF32, type::ImageFormat::kR16Float}, TextureTestParams{type::TextureDimension::k2d, Texture::kI32, @@ -1641,7 +1634,6 @@ INSTANTIATE_TEST_SUITE_P( TypeDeterminerTest, Intrinsic_SampledTextureOperation, testing::Values(TextureTestParams{type::TextureDimension::k1d}, - TextureTestParams{type::TextureDimension::k1dArray}, TextureTestParams{type::TextureDimension::k2d}, TextureTestParams{type::TextureDimension::k2dArray}, TextureTestParams{type::TextureDimension::k3d})); @@ -3168,7 +3160,6 @@ const char* expected_texture_overload( using ValidTextureOverload = ast::intrinsic::test::ValidTextureOverload; switch (overload) { case ValidTextureOverload::kDimensions1d: - case ValidTextureOverload::kDimensions1dArray: case ValidTextureOverload::kDimensions2d: case ValidTextureOverload::kDimensions2dArray: case ValidTextureOverload::kDimensions3d: @@ -3181,23 +3172,19 @@ const char* expected_texture_overload( case ValidTextureOverload::kDimensionsDepthCube: case ValidTextureOverload::kDimensionsDepthCubeArray: case ValidTextureOverload::kDimensionsStorageRO1d: - case ValidTextureOverload::kDimensionsStorageRO1dArray: case ValidTextureOverload::kDimensionsStorageRO2d: case ValidTextureOverload::kDimensionsStorageRO2dArray: case ValidTextureOverload::kDimensionsStorageRO3d: case ValidTextureOverload::kDimensionsStorageWO1d: - case ValidTextureOverload::kDimensionsStorageWO1dArray: case ValidTextureOverload::kDimensionsStorageWO2d: case ValidTextureOverload::kDimensionsStorageWO2dArray: case ValidTextureOverload::kDimensionsStorageWO3d: return R"(textureDimensions(texture))"; - case ValidTextureOverload::kNumLayers1dArray: case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersCubeArray: case ValidTextureOverload::kNumLayersMultisampled2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: case ValidTextureOverload::kNumLayersDepthCubeArray: - case ValidTextureOverload::kNumLayersStorageWO1dArray: case ValidTextureOverload::kNumLayersStorageWO2dArray: return R"(textureNumLayers(texture))"; case ValidTextureOverload::kNumLevels2d: @@ -3225,8 +3212,6 @@ const char* expected_texture_overload( return R"(textureDimensions(texture, level))"; case ValidTextureOverload::kSample1dF32: return R"(textureSample(texture, sampler, coords))"; - case ValidTextureOverload::kSample1dArrayF32: - return R"(textureSample(texture, sampler, coords, array_index))"; case ValidTextureOverload::kSample2dF32: return R"(textureSample(texture, sampler, coords))"; case ValidTextureOverload::kSample2dOffsetF32: @@ -3333,12 +3318,6 @@ const char* expected_texture_overload( return R"(textureLoad(texture, coords))"; case ValidTextureOverload::kLoad1dI32: return R"(textureLoad(texture, coords))"; - case ValidTextureOverload::kLoad1dArrayF32: - return R"(textureLoad(texture, coords, array_index))"; - case ValidTextureOverload::kLoad1dArrayU32: - return R"(textureLoad(texture, coords, array_index))"; - case ValidTextureOverload::kLoad1dArrayI32: - return R"(textureLoad(texture, coords, array_index))"; case ValidTextureOverload::kLoad2dF32: return R"(textureLoad(texture, coords))"; case ValidTextureOverload::kLoad2dU32: @@ -3397,8 +3376,6 @@ const char* expected_texture_overload( return R"(textureLoad(texture, coords, array_index, level))"; case ValidTextureOverload::kLoadStorageRO1dRgba32float: return R"(textureLoad(texture, coords))"; - case ValidTextureOverload::kLoadStorageRO1dArrayRgba32float: - return R"(textureLoad(texture, coords, array_index))"; case ValidTextureOverload::kLoadStorageRO2dRgba8unorm: case ValidTextureOverload::kLoadStorageRO2dRgba8snorm: case ValidTextureOverload::kLoadStorageRO2dRgba8uint: @@ -3422,8 +3399,6 @@ const char* expected_texture_overload( return R"(textureLoad(texture, coords))"; case ValidTextureOverload::kStoreWO1dRgba32float: return R"(textureStore(texture, coords, value))"; - case ValidTextureOverload::kStoreWO1dArrayRgba32float: - return R"(textureStore(texture, coords, array_index, value))"; case ValidTextureOverload::kStoreWO2dRgba32float: return R"(textureStore(texture, coords, value))"; case ValidTextureOverload::kStoreWO2dArrayRgba32float: @@ -3450,7 +3425,6 @@ TEST_P(TypeDeterminerTextureIntrinsicTest, Call) { default: FAIL() << "invalid texture dimensions: " << param.texture_dimension; case type::TextureDimension::k1d: - case type::TextureDimension::k1dArray: EXPECT_EQ(TypeOf(call)->type_name(), ty.i32()->type_name()); break; case type::TextureDimension::k2d: diff --git a/src/writer/hlsl/generator_impl.cc b/src/writer/hlsl/generator_impl.cc index 4a7d5f459e..0a732f3a01 100644 --- a/src/writer/hlsl/generator_impl.cc +++ b/src/writer/hlsl/generator_impl.cc @@ -809,10 +809,6 @@ bool GeneratorImpl::EmitTextureCall(std::ostream& pre, case type::TextureDimension::k1d: num_dimensions = 1; break; - case type::TextureDimension::k1dArray: - num_dimensions = 2; - swizzle = ".x"; - break; case type::TextureDimension::k2d: num_dimensions = is_ms ? 3 : 2; swizzle = is_ms ? ".xy" : ""; @@ -843,10 +839,6 @@ bool GeneratorImpl::EmitTextureCall(std::ostream& pre, default: TINT_ICE(diagnostics_) << "texture dimension is not arrayed"; return false; - case type::TextureDimension::k1dArray: - num_dimensions = is_ms ? 3 : 2; - swizzle = ".y"; - break; case type::TextureDimension::k2dArray: num_dimensions = is_ms ? 4 : 3; swizzle = ".z"; @@ -2510,9 +2502,6 @@ bool GeneratorImpl::EmitType(std::ostream& out, case type::TextureDimension::k1d: out << "1D"; break; - case type::TextureDimension::k1dArray: - out << "1DArray"; - break; case type::TextureDimension::k2d: out << (ms ? "2DMS" : "2D"); break; diff --git a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc index 35aed1f9c4..283b38ea40 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc @@ -51,15 +51,6 @@ texture_tint_0.GetDimensions(_tint_tmp); )", "_tint_tmp", }; - case ValidTextureOverload::kDimensions1dArray: - case ValidTextureOverload::kDimensionsStorageRO1dArray: - case ValidTextureOverload::kDimensionsStorageWO1dArray: - return { - R"(int2 _tint_tmp; -texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y); -)", - "_tint_tmp.x", - }; case ValidTextureOverload::kDimensions2d: case ValidTextureOverload::kDimensionsDepth2d: case ValidTextureOverload::kDimensionsStorageRO2d: @@ -158,14 +149,6 @@ texture_tint_0.GetDimensions(1, _tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp )", "_tint_tmp.xyy", }; - case ValidTextureOverload::kNumLayers1dArray: - case ValidTextureOverload::kNumLayersStorageWO1dArray: - return { - R"(int2 _tint_tmp; -texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y); -)", - "_tint_tmp.y", - }; case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: case ValidTextureOverload::kNumLayersCubeArray: @@ -222,8 +205,6 @@ texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp.w) }; case ValidTextureOverload::kSample1dF32: return R"(texture_tint_0.Sample(sampler_tint_0, 1.0f))"; - case ValidTextureOverload::kSample1dArrayF32: - return R"(texture_tint_0.Sample(sampler_tint_0, float2(1.0f, float(2))))"; case ValidTextureOverload::kSample2dF32: return R"(texture_tint_0.Sample(sampler_tint_0, float2(1.0f, 2.0f)))"; case ValidTextureOverload::kSample2dOffsetF32: @@ -330,12 +311,6 @@ texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp.w) return R"(texture_tint_0.Load(int2(1, 0)))"; case ValidTextureOverload::kLoad1dI32: return R"(texture_tint_0.Load(int2(1, 0)))"; - case ValidTextureOverload::kLoad1dArrayF32: - return R"(texture_tint_0.Load(int3(1, 2, 0)))"; - case ValidTextureOverload::kLoad1dArrayU32: - return R"(texture_tint_0.Load(int3(1, 2, 0)))"; - case ValidTextureOverload::kLoad1dArrayI32: - return R"(texture_tint_0.Load(int3(1, 2, 0)))"; case ValidTextureOverload::kLoad2dF32: return R"(texture_tint_0.Load(int3(1, 2, 0)))"; case ValidTextureOverload::kLoad2dU32: @@ -394,8 +369,6 @@ texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp.w) return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))"; case ValidTextureOverload::kLoadStorageRO1dRgba32float: return R"(texture_tint_0.Load(1))"; - case ValidTextureOverload::kLoadStorageRO1dArrayRgba32float: - return R"(texture_tint_0.Load(int2(1, 2)))"; case ValidTextureOverload::kLoadStorageRO2dRgba8unorm: case ValidTextureOverload::kLoadStorageRO2dRgba8snorm: case ValidTextureOverload::kLoadStorageRO2dRgba8uint: @@ -419,8 +392,6 @@ texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp.w) return R"(texture_tint_0.Load(int3(1, 2, 3)))"; case ValidTextureOverload::kStoreWO1dRgba32float: return R"(texture_tint_0[1] = float4(2.0f, 3.0f, 4.0f, 5.0f))"; - case ValidTextureOverload::kStoreWO1dArrayRgba32float: - return R"(texture_tint_0[int2(1, 2)] = float4(3.0f, 4.0f, 5.0f, 6.0f))"; case ValidTextureOverload::kStoreWO2dRgba32float: return R"(texture_tint_0[int2(1, 2)] = float4(3.0f, 4.0f, 5.0f, 6.0f))"; case ValidTextureOverload::kStoreWO2dArrayRgba32float: diff --git a/src/writer/hlsl/generator_impl_type_test.cc b/src/writer/hlsl/generator_impl_type_test.cc index c75a5e222c..aa016366d6 100644 --- a/src/writer/hlsl/generator_impl_type_test.cc +++ b/src/writer/hlsl/generator_impl_type_test.cc @@ -375,7 +375,6 @@ INSTANTIATE_TEST_SUITE_P( HlslSampledtexturesTest, testing::Values( HlslTextureData{type::TextureDimension::k1d, "Texture1D"}, - HlslTextureData{type::TextureDimension::k1dArray, "Texture1DArray"}, HlslTextureData{type::TextureDimension::k2d, "Texture2D"}, HlslTextureData{type::TextureDimension::k2dArray, "Texture2DArray"}, HlslTextureData{type::TextureDimension::k3d, "Texture3D"}, @@ -425,9 +424,6 @@ INSTANTIATE_TEST_SUITE_P( testing::Values(HlslStorageTextureData{type::TextureDimension::k1d, type::ImageFormat::kRgba8Unorm, true, "RWTexture1D"}, - HlslStorageTextureData{type::TextureDimension::k1dArray, - type::ImageFormat::kRgba8Snorm, true, - "RWTexture1DArray"}, HlslStorageTextureData{type::TextureDimension::k2d, type::ImageFormat::kRgba16Float, true, "RWTexture2D"}, @@ -440,9 +436,6 @@ INSTANTIATE_TEST_SUITE_P( HlslStorageTextureData{type::TextureDimension::k1d, type::ImageFormat::kRgba32Float, false, "RWTexture1D"}, - HlslStorageTextureData{type::TextureDimension::k1dArray, - type::ImageFormat::kRgba8Uint, false, - "RWTexture1DArray"}, HlslStorageTextureData{type::TextureDimension::k2d, type::ImageFormat::kRgba16Uint, false, "RWTexture2D"}, @@ -455,9 +448,6 @@ INSTANTIATE_TEST_SUITE_P( HlslStorageTextureData{type::TextureDimension::k1d, type::ImageFormat::kRgba32Uint, true, "RWTexture1D"}, - HlslStorageTextureData{type::TextureDimension::k1dArray, - type::ImageFormat::kRgba8Sint, true, - "RWTexture1DArray"}, HlslStorageTextureData{type::TextureDimension::k2d, type::ImageFormat::kRgba16Sint, true, "RWTexture2D"}, diff --git a/src/writer/hlsl/namer.cc b/src/writer/hlsl/namer.cc index a577d639e2..79e4975222 100644 --- a/src/writer/hlsl/namer.cc +++ b/src/writer/hlsl/namer.cc @@ -97,7 +97,6 @@ const char* kNames[] = {"AddressU", "RWByteAddressBuffer", "RWStructuredBuffer", "RWTexture1D", - "RWTexture1DArray", "RWTexture2D", "RWTexture2DArray", "RWTexture3D", @@ -141,7 +140,6 @@ const char* kNames[] = {"AddressU", "Texcoord", "Texture", "Texture1D", - "Texture1DArray", "Texture2D", "Texture2DArray", "Texture2DMS", diff --git a/src/writer/hlsl/namer_test.cc b/src/writer/hlsl/namer_test.cc index adb2ee5a91..a714cb9217 100644 --- a/src/writer/hlsl/namer_test.cc +++ b/src/writer/hlsl/namer_test.cc @@ -128,7 +128,6 @@ INSTANTIATE_TEST_SUITE_P(HlslNamerTest, "RWByteAddressBuffer", "RWStructuredBuffer", "RWTexture1D", - "RWTexture1DArray", "RWTexture2D", "RWTexture2DArray", "RWTexture3D", @@ -172,7 +171,6 @@ INSTANTIATE_TEST_SUITE_P(HlslNamerTest, "Texcoord", "Texture", "Texture1D", - "Texture1DArray", "Texture2D", "Texture2DArray", "Texture2DMS", diff --git a/src/writer/msl/generator_impl.cc b/src/writer/msl/generator_impl.cc index f21598f1b1..1d2c024993 100644 --- a/src/writer/msl/generator_impl.cc +++ b/src/writer/msl/generator_impl.cc @@ -599,7 +599,6 @@ bool GeneratorImpl::EmitTextureCall(ast::CallExpression* expr, diagnostics_.add_error("texture dimension is kNone"); return false; case type::TextureDimension::k1d: - case type::TextureDimension::k1dArray: dims = {"width"}; break; case type::TextureDimension::k2d: @@ -2004,9 +2003,6 @@ bool GeneratorImpl::EmitType(type::Type* type, const std::string& name) { case type::TextureDimension::k1d: out_ << "1d"; break; - case type::TextureDimension::k1dArray: - out_ << "1d_array"; - break; case type::TextureDimension::k2d: out_ << "2d"; break; diff --git a/src/writer/msl/generator_impl_intrinsic_texture_test.cc b/src/writer/msl/generator_impl_intrinsic_texture_test.cc index 3485962c4a..48664aee89 100644 --- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc @@ -33,11 +33,8 @@ std::string expected_texture_overload( using ValidTextureOverload = ast::intrinsic::test::ValidTextureOverload; switch (overload) { case ValidTextureOverload::kDimensions1d: - case ValidTextureOverload::kDimensions1dArray: case ValidTextureOverload::kDimensionsStorageRO1d: - case ValidTextureOverload::kDimensionsStorageRO1dArray: case ValidTextureOverload::kDimensionsStorageWO1d: - case ValidTextureOverload::kDimensionsStorageWO1dArray: return R"(int(texture_tint_0.get_width()))"; case ValidTextureOverload::kDimensions2d: case ValidTextureOverload::kDimensions2dArray: @@ -71,13 +68,11 @@ std::string expected_texture_overload( case ValidTextureOverload::kDimensionsDepthCubeLevel: case ValidTextureOverload::kDimensionsDepthCubeArrayLevel: return R"(int3(texture_tint_0.get_width(1), texture_tint_0.get_height(1), texture_tint_0.get_height(1)))"; - case ValidTextureOverload::kNumLayers1dArray: case ValidTextureOverload::kNumLayers2dArray: case ValidTextureOverload::kNumLayersCubeArray: case ValidTextureOverload::kNumLayersMultisampled2dArray: case ValidTextureOverload::kNumLayersDepth2dArray: case ValidTextureOverload::kNumLayersDepthCubeArray: - case ValidTextureOverload::kNumLayersStorageWO1dArray: case ValidTextureOverload::kNumLayersStorageWO2dArray: return R"(int(texture_tint_0.get_array_size()))"; case ValidTextureOverload::kNumLevels2d: @@ -95,8 +90,6 @@ std::string expected_texture_overload( return R"(int(texture_tint_0.get_num_samples()))"; case ValidTextureOverload::kSample1dF32: return R"(texture_tint_0.sample(sampler_tint_0, 1.0f))"; - case ValidTextureOverload::kSample1dArrayF32: - return R"(texture_tint_0.sample(sampler_tint_0, 1.0f, 2))"; case ValidTextureOverload::kSample2dF32: return R"(texture_tint_0.sample(sampler_tint_0, float2(1.0f, 2.0f)))"; case ValidTextureOverload::kSample2dOffsetF32: @@ -203,12 +196,6 @@ std::string expected_texture_overload( return R"(texture_tint_0.read(1))"; case ValidTextureOverload::kLoad1dI32: return R"(texture_tint_0.read(1))"; - case ValidTextureOverload::kLoad1dArrayF32: - return R"(texture_tint_0.read(1, 2))"; - case ValidTextureOverload::kLoad1dArrayU32: - return R"(texture_tint_0.read(1, 2))"; - case ValidTextureOverload::kLoad1dArrayI32: - return R"(texture_tint_0.read(1, 2))"; case ValidTextureOverload::kLoad2dF32: return R"(texture_tint_0.read(int2(1, 2)))"; case ValidTextureOverload::kLoad2dU32: @@ -267,8 +254,6 @@ std::string expected_texture_overload( return R"(texture_tint_0.read(int2(1, 2), 3, 4))"; case ValidTextureOverload::kLoadStorageRO1dRgba32float: return R"(texture_tint_0.read(1))"; - case ValidTextureOverload::kLoadStorageRO1dArrayRgba32float: - return R"(texture_tint_0.read(1, 2))"; case ValidTextureOverload::kLoadStorageRO2dRgba8unorm: case ValidTextureOverload::kLoadStorageRO2dRgba8snorm: case ValidTextureOverload::kLoadStorageRO2dRgba8uint: @@ -292,8 +277,6 @@ std::string expected_texture_overload( return R"(texture_tint_0.read(int3(1, 2, 3)))"; case ValidTextureOverload::kStoreWO1dRgba32float: return R"(texture_tint_0.write(float4(2.0f, 3.0f, 4.0f, 5.0f), 1))"; - case ValidTextureOverload::kStoreWO1dArrayRgba32float: - return R"(texture_tint_0.write(float4(3.0f, 4.0f, 5.0f, 6.0f), 1, 2))"; case ValidTextureOverload::kStoreWO2dRgba32float: return R"(texture_tint_0.write(float4(3.0f, 4.0f, 5.0f, 6.0f), int2(1, 2)))"; case ValidTextureOverload::kStoreWO2dArrayRgba32float: diff --git a/src/writer/msl/generator_impl_type_test.cc b/src/writer/msl/generator_impl_type_test.cc index 9321bbacf9..493932abbc 100644 --- a/src/writer/msl/generator_impl_type_test.cc +++ b/src/writer/msl/generator_impl_type_test.cc @@ -385,8 +385,6 @@ INSTANTIATE_TEST_SUITE_P( MslSampledtexturesTest, testing::Values(MslTextureData{type::TextureDimension::k1d, "texture1d"}, - MslTextureData{type::TextureDimension::k1dArray, - "texture1d_array"}, MslTextureData{type::TextureDimension::k2d, "texture2d"}, MslTextureData{type::TextureDimension::k2dArray, @@ -442,8 +440,6 @@ INSTANTIATE_TEST_SUITE_P( testing::Values( MslStorageTextureData{type::TextureDimension::k1d, true, "texture1d"}, - MslStorageTextureData{type::TextureDimension::k1dArray, true, - "texture1d_array"}, MslStorageTextureData{type::TextureDimension::k2d, true, "texture2d"}, MslStorageTextureData{type::TextureDimension::k2dArray, true, @@ -452,8 +448,6 @@ INSTANTIATE_TEST_SUITE_P( "texture3d"}, MslStorageTextureData{type::TextureDimension::k1d, false, "texture1d"}, - MslStorageTextureData{type::TextureDimension::k1dArray, false, - "texture1d_array"}, MslStorageTextureData{type::TextureDimension::k2d, false, "texture2d"}, MslStorageTextureData{type::TextureDimension::k2dArray, false, diff --git a/src/writer/spirv/builder.cc b/src/writer/spirv/builder.cc index 0526ff99f9..d0401da14d 100644 --- a/src/writer/spirv/builder.cc +++ b/src/writer/spirv/builder.cc @@ -2225,10 +2225,6 @@ bool Builder::GenerateTextureIntrinsic(ast::CallExpression* call, case type::TextureDimension::k2d: case type::TextureDimension::k3d: break; // No swizzle needed - case type::TextureDimension::k1dArray: - swizzle = {0}; // Strip array index - spirv_dims = 2; // [width, array count] - break; case type::TextureDimension::kCube: swizzle = {0, 1, 1}; // Duplicate height for depth spirv_dims = 2; // [width, height] @@ -2269,9 +2265,6 @@ bool Builder::GenerateTextureIntrinsic(ast::CallExpression* call, default: error_ = "texture is not arrayed"; return false; - case type::TextureDimension::k1dArray: - spirv_dims = 2; - break; case type::TextureDimension::k2dArray: case type::TextureDimension::kCubeArray: spirv_dims = 3; @@ -2910,15 +2903,13 @@ bool Builder::GenerateTextureType(type::Texture* texture, const Operand& result) { uint32_t array_literal = 0u; const auto dim = texture->dim(); - if (dim == type::TextureDimension::k1dArray || - dim == type::TextureDimension::k2dArray || + if (dim == type::TextureDimension::k2dArray || dim == type::TextureDimension::kCubeArray) { array_literal = 1u; } uint32_t dim_literal = SpvDim2D; - if (dim == type::TextureDimension::k1dArray || - dim == type::TextureDimension::k1d) { + if (dim == type::TextureDimension::k1d) { dim_literal = SpvDim1D; if (texture->Is()) { push_capability(SpvCapabilitySampled1D); diff --git a/src/writer/spirv/builder_intrinsic_texture_test.cc b/src/writer/spirv/builder_intrinsic_texture_test.cc index d3c7a9e327..7abc5376da 100644 --- a/src/writer/spirv/builder_intrinsic_texture_test.cc +++ b/src/writer/spirv/builder_intrinsic_texture_test.cc @@ -62,29 +62,6 @@ expected_texture_overload_spirv expected_texture_overload( R"( OpCapability Sampled1D OpCapability ImageQuery -)"}; - case ValidTextureOverload::kDimensions1dArray: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 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 2 -%13 = OpConstant %9 0 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySizeLod %11 %12 %13 -%8 = OpCompositeExtract %9 %10 0 -)", - R"( -OpCapability Sampled1D -OpCapability ImageQuery )"}; case ValidTextureOverload::kDimensions2d: return { @@ -549,28 +526,6 @@ OpCapability ImageQuery R"( OpCapability Image1D OpCapability ImageQuery -)"}; - case ValidTextureOverload::kDimensionsStorageRO1dArray: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 2 Rgba32f -%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 2 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySize %11 %12 -%8 = OpCompositeExtract %9 %10 0 -)", - R"( -OpCapability Image1D -OpCapability ImageQuery )"}; case ValidTextureOverload::kDimensionsStorageRO2d: return { @@ -653,28 +608,6 @@ OpCapability ImageQuery R"( OpCapability Image1D OpCapability ImageQuery -)"}; - case ValidTextureOverload::kDimensionsStorageWO1dArray: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 2 Rgba32f -%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 2 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySize %11 %12 -%8 = OpCompositeExtract %9 %10 0 -)", - R"( -OpCapability Image1D -OpCapability ImageQuery )"}; case ValidTextureOverload::kDimensionsStorageWO2d: return { @@ -737,29 +670,6 @@ OpCapability ImageQuery )", R"( OpCapability ImageQuery -)"}; - - case ValidTextureOverload::kNumLayers1dArray: - return {R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 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 2 -%13 = OpConstant %9 0 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySizeLod %11 %12 %13 -%8 = OpCompositeExtract %9 %10 1 -)", - R"( -OpCapability Sampled1D -OpCapability ImageQuery )"}; case ValidTextureOverload::kNumLayers2dArray: return {R"( @@ -866,27 +776,6 @@ OpCapability ImageQuery R"( OpCapability SampledCubeArray OpCapability ImageQuery -)"}; - case ValidTextureOverload::kNumLayersStorageWO1dArray: - return {R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 2 Rgba32f -%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 2 -)", - R"( -%12 = OpLoad %3 %1 -%10 = OpImageQuerySize %11 %12 -%8 = OpCompositeExtract %9 %10 1 -)", - R"( -OpCapability Image1D -OpCapability ImageQuery )"}; case ValidTextureOverload::kNumLayersStorageWO2dArray: return {R"( @@ -1130,34 +1019,6 @@ OpCapability ImageQuery )", R"( OpCapability Sampled1D -)"}; - case ValidTextureOverload::kSample1dArrayF32: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 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 = OpTypeSampledImage %3 -%14 = OpTypeVector %4 2 -%15 = OpConstant %4 1 -%17 = OpTypeInt 32 1 -%18 = OpConstant %17 2 -)", - R"( -%10 = OpLoad %7 %5 -%11 = OpLoad %3 %1 -%13 = OpSampledImage %12 %11 %10 -%16 = OpConvertSToF %4 %18 -%19 = OpCompositeConstruct %14 %15 %16 -%8 = OpImageSampleImplicitLod %9 %13 %19 -)", - R"( -OpCapability Sampled1D )"}; case ValidTextureOverload::kSample2dF32: return { @@ -2750,77 +2611,6 @@ OpCapability Sampled1D )", R"( OpCapability Sampled1D -)"}; - case ValidTextureOverload::kLoad1dArrayF32: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 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 2 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstantComposite %11 %13 %14 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %15 -)", - R"( -OpCapability Sampled1D -)"}; - case ValidTextureOverload::kLoad1dArrayU32: - return { - R"( -%4 = OpTypeInt 32 0 -%3 = OpTypeImage %4 1D 0 1 0 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 2 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstantComposite %11 %13 %14 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %15 -)", - R"( -OpCapability Sampled1D -)"}; - case ValidTextureOverload::kLoad1dArrayI32: - return { - R"( -%4 = OpTypeInt 32 1 -%3 = OpTypeImage %4 1D 0 1 0 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 2 -%12 = OpConstant %4 1 -%13 = OpConstant %4 2 -%14 = OpConstantComposite %11 %12 %13 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageFetch %9 %10 %14 -)", - R"( -OpCapability Sampled1D )"}; case ValidTextureOverload::kLoad2dF32: return { @@ -3516,30 +3306,6 @@ OpCapability Sampled1D )", R"( OpCapability Image1D -)"}; - case ValidTextureOverload::kLoadStorageRO1dArrayRgba32float: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 2 Rgba32f -%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 2 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstantComposite %11 %13 %14 -)", - R"( -%10 = OpLoad %3 %1 -%8 = OpImageRead %9 %10 %15 -)", - R"( -OpCapability Image1D )"}; case ValidTextureOverload::kLoadStorageRO2dRgba8unorm: return { @@ -3982,36 +3748,6 @@ OpImageWrite %10 %12 %18 )", R"( OpCapability Image1D -)"}; - case ValidTextureOverload::kStoreWO1dArrayRgba32float: - return { - R"( -%4 = OpTypeFloat 32 -%3 = OpTypeImage %4 1D 0 1 0 2 Rgba32f -%2 = OpTypePointer UniformConstant %3 -%1 = OpVariable %2 UniformConstant -%7 = OpTypeSampler -%6 = OpTypePointer UniformConstant %7 -%5 = OpVariable %6 UniformConstant -%9 = OpTypeVoid -%12 = OpTypeInt 32 1 -%11 = OpTypeVector %12 2 -%13 = OpConstant %12 1 -%14 = OpConstant %12 2 -%15 = OpConstantComposite %11 %13 %14 -%16 = OpTypeVector %4 4 -%17 = OpConstant %4 3 -%18 = OpConstant %4 4 -%19 = OpConstant %4 5 -%20 = OpConstant %4 6 -%21 = OpConstantComposite %16 %17 %18 %19 %20 -)", - R"( -%10 = OpLoad %3 %1 -OpImageWrite %10 %15 %21 -)", - R"( -OpCapability Image1D )"}; case ValidTextureOverload::kStoreWO2dRgba32float: return { diff --git a/src/writer/spirv/builder_type_test.cc b/src/writer/spirv/builder_type_test.cc index d9d3f3ea92..e66f1c144c 100644 --- a/src/writer/spirv/builder_type_test.cc +++ b/src/writer/spirv/builder_type_test.cc @@ -783,24 +783,6 @@ TEST_F(BuilderTest_Type, SampledTexture_Generate_1d_f32) { )"); } -TEST_F(BuilderTest_Type, SampledTexture_Generate_1dArray) { - auto* s = - create(type::TextureDimension::k1dArray, ty.f32()); - - spirv::Builder& b = Build(); - - EXPECT_EQ(b.GenerateTypeIfNeeded(s), 1u); - ASSERT_FALSE(b.has_error()) << b.error(); - EXPECT_EQ(DumpInstructions(b.types()), - R"(%2 = OpTypeFloat 32 -%1 = OpTypeImage %2 1D 0 1 0 1 Unknown -)"); - - EXPECT_EQ(DumpInstructions(b.capabilities()), - R"(OpCapability Sampled1D -)"); -} - TEST_F(BuilderTest_Type, SampledTexture_Generate_2d) { auto* s = create(type::TextureDimension::k2d, ty.f32()); @@ -973,28 +955,6 @@ TEST_F(BuilderTest_Type, StorageTexture_Generate_1d_R8Sint) { )"); } -TEST_F(BuilderTest_Type, StorageTexture_Generate_1d_array) { - auto* subtype = - type::StorageTexture::SubtypeFor(type::ImageFormat::kR16Float, Types()); - auto* s = create(type::TextureDimension::k1dArray, - type::ImageFormat::kR16Float, subtype); - - Global("test_var", s, ast::StorageClass::kNone); - - spirv::Builder& b = Build(); - - EXPECT_EQ(b.GenerateTypeIfNeeded(s), 1u); - ASSERT_FALSE(b.has_error()) << b.error(); - EXPECT_EQ(DumpInstructions(b.types()), R"(%2 = OpTypeFloat 32 -%1 = OpTypeImage %2 1D 0 1 0 2 R16f -)"); - - EXPECT_EQ(DumpInstructions(b.capabilities()), - R"(OpCapability Image1D -OpCapability StorageImageExtendedFormats -)"); -} - TEST_F(BuilderTest_Type, StorageTexture_Generate_2d) { auto* subtype = type::StorageTexture::SubtypeFor(type::ImageFormat::kR16Float, Types()); diff --git a/src/writer/wgsl/generator_impl.cc b/src/writer/wgsl/generator_impl.cc index 754327a8f0..bde480b796 100644 --- a/src/writer/wgsl/generator_impl.cc +++ b/src/writer/wgsl/generator_impl.cc @@ -454,9 +454,6 @@ bool GeneratorImpl::EmitType(type::Type* type) { case type::TextureDimension::k1d: out_ << "1d"; break; - case type::TextureDimension::k1dArray: - out_ << "1d_array"; - break; case type::TextureDimension::k2d: out_ << "2d"; break; diff --git a/src/writer/wgsl/generator_impl_type_test.cc b/src/writer/wgsl/generator_impl_type_test.cc index 2c2744f978..1b6d59107d 100644 --- a/src/writer/wgsl/generator_impl_type_test.cc +++ b/src/writer/wgsl/generator_impl_type_test.cc @@ -326,7 +326,6 @@ INSTANTIATE_TEST_SUITE_P( WgslGenerator_SampledTextureTest, testing::Values( TextureData{type::TextureDimension::k1d, "texture_1d"}, - TextureData{type::TextureDimension::k1dArray, "texture_1d_array"}, TextureData{type::TextureDimension::k2d, "texture_2d"}, TextureData{type::TextureDimension::k2dArray, "texture_2d_array"}, TextureData{type::TextureDimension::k3d, "texture_3d"}, @@ -403,10 +402,6 @@ INSTANTIATE_TEST_SUITE_P( type::TextureDimension::k1d, ast::AccessControl::kReadOnly, "[[access(read)]]\ntexture_storage_1d"}, - StorageTextureData{ - type::ImageFormat::kR8Unorm, type::TextureDimension::k1dArray, - ast::AccessControl::kReadOnly, - "[[access(read)]]\ntexture_storage_1d_array"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k2d, ast::AccessControl::kReadOnly, @@ -423,10 +418,6 @@ INSTANTIATE_TEST_SUITE_P( type::TextureDimension::k1d, ast::AccessControl::kWriteOnly, "[[access(write)]]\ntexture_storage_1d"}, - StorageTextureData{ - type::ImageFormat::kR8Unorm, type::TextureDimension::k1dArray, - ast::AccessControl::kWriteOnly, - "[[access(write)]]\ntexture_storage_1d_array"}, StorageTextureData{type::ImageFormat::kR8Unorm, type::TextureDimension::k2d, ast::AccessControl::kWriteOnly,