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 <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison 2021-02-24 05:05:21 +00:00 committed by Commit Bot service account
parent 00eb8dfa8b
commit 13dbbc6797
36 changed files with 8 additions and 808 deletions

View File

@ -114,7 +114,6 @@ decorated with `NonWritable` or each member of the struct can be decorated with
| WGSL | SPIR-V | MSL | HLSL |
|------|--------|-----|------|
| texture_1d&lt;type&gt; | OpTypeImage 1D Sampled=1 | texture1d&lt;type, access::sample&gt; | Texture1D |
| texture_1d_array&lt;type&gt; | OpTypeImage 1D Arrayed=1 Sampled=1 | texture1d_array&lt;type, access::sample&gt; | Texture1DArray |
| texture_2d&lt;type&gt; | OpTypeImage 2D Sampled=1 | texture2d&lt;type, access::sample&gt; | Texture2D |
| texture_2d_array&lt;type&gt; | OpTypeImage 2D Arrayed=1 Sampled=1 | texture2d_array&lt;type, access::sample&gt; | Texture2DArray |
| texture_3d&lt;type&gt; | OpTypeImage 3D Sampled=1 | texture3d&lt;type, access::sample&gt; | 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&lt;float, access::sample&gt; | TextureCubeArray |
| | | |
| texture_storage_1d&lt;image_storage_type&gt; | OpTypeImage 1D Sampled=2| texture1d&lt;type, access::read&gt; | RWTexture1D |
| texture_storage_1d_array&lt;image_storage_type&gt; | OpTypeImage 1D Arrayed=1 Sampled=2 | texture1d_array&lt;type, access::read&gt; | RWTexture1DArray |
| texture_storage_2d&lt;image_storage_type&gt; | OpTypeImage 2D Sampled=2 | texture2d&lt;type, access::read&gt; | RWTexture2D |
| texture_storage_2d_array&lt;image_storage_type&gt; | OpTypeImage 2D Arrayed=1 Sampled=2 | texture2d_array&lt;type, access::read&gt; | RWTexture2DArray |
| texture_storage_3d&lt;image_storage_type&gt; | OpTypeImage 3D Sampled=2 | texture3d&lt;type, access::read&gt; | RWTexture3D |
| | | |
| texture_storage_1d&lt;image_storage_type&gt; | OpTypeImage 1D Sampled=2 | texture1d&lt;type, access::write&gt; | RWTexture1D |
| texture_storage_1d_array&lt;image_storage_type&gt; | OpTypeImage 1D Arrayed=1 Sampled=2 | texture1d_array&lt;type, access::write&gt; | RWTexture1DArray |
| texture_storage_2d&lt;image_storage_type&gt; | OpTypeImage 2D Sampled=1 | texture2d&lt;type, access::write&gt; | RWTexture2D |
| texture_storage_2d_array&lt;image_storage_type&gt; | OpTypeImage 2D Arrayed=1 Sampled=2 | texture2d_array&lt;type, access::write&gt; | RWTexture2DArray |
| texture_storage_3d&lt;image_storage_type&gt; | OpTypeImage 3D Sampled=2 | texture3d&lt;type, access::write&gt; | RWTexture3D|

View File

@ -92,7 +92,6 @@
"texture_storage_2d_array"
"texture_storage_3d"
"texture_1d"
"texture_1d_array"
"texture_2d"
"texture_2d_array"
"texture_3d"

View File

@ -213,16 +213,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureDimensions",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kDimensions1dArray,
"textureDimensions(t : texture_1d_array<f32>) -> i32",
TextureKind::kRegular,
type::SamplerKind::kSampler,
type::TextureDimension::k1dArray,
TextureDataType::kF32,
"textureDimensions",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kDimensions2d,
"textureDimensions(t : texture_2d<f32>) -> vec2<i32>",
@ -443,17 +433,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureDimensions",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kDimensionsStorageRO1dArray,
"textureDimensions(t : texture_storage_1d_array<rgba32float>) -> "
"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<rgba32float>) -> "
@ -497,17 +476,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureDimensions",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kDimensionsStorageWO1dArray,
"textureDimensions(t : texture_storage_1d_array<rgba32float>) -> "
"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<rgba32float>) -> "
@ -541,16 +509,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureDimensions",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kNumLayers1dArray,
"textureNumLayers(t : texture_1d_array<f32>) -> 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<f32>) -> i32",
@ -601,16 +559,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
"textureNumLayers",
[](ProgramBuilder* b) { return b->ExprList("texture"); },
},
{
ValidTextureOverload::kNumLayersStorageWO1dArray,
"textureNumLayers(t : texture_storage_1d_array<rgba32float>) -> 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<rgba32float>) -> i32",
@ -747,24 +695,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
1.0f); // coords
},
},
{
ValidTextureOverload::kSample1dArrayF32,
"textureSample(t : texture_1d_array<f32>,\n"
" s : sampler,\n"
" coords : f32,\n"
" array_index : i32) -> vec4<f32>",
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<f32>,\n"
@ -1770,51 +1700,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
1); // coords
},
},
{
ValidTextureOverload::kLoad1dArrayF32,
"textureLoad(t : texture_1d_array<f32>,\n"
" coords : i32,\n"
" array_index : i32) -> vec4<f32>",
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<u32>,\n"
" coords : i32,\n"
" array_index : i32) -> vec4<u32>",
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<i32>,\n"
" coords : i32,\n"
" array_index : i32) -> vec4<i32>",
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<f32>,\n"
@ -2249,23 +2134,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
1); // coords
},
},
{
ValidTextureOverload::kLoadStorageRO1dArrayRgba32float,
"textureLoad(t : "
"texture_storage_1d_array<rgba32float>,\n"
" coords : i32,\n"
" array_index : i32) -> vec4<f32>",
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<rgba8unorm>,\n"
@ -2537,24 +2405,6 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
b->vec4<f32>(2.f, 3.f, 4.f, 5.f)); // value
},
},
{
ValidTextureOverload::kStoreWO1dArrayRgba32float,
"textureStore(t : texture_storage_1d_array<rgba32float>,\n"
" coords : i32,\n"
" array_index : i32,\n"
" value : vec4<T>) -> 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<f32>(3.f, 4.f, 5.f, 6.f)); // value
},
},
{
ValidTextureOverload::kStoreWO2dRgba32float,
"textureStore(t : texture_storage_2d<rgba32float>,\n"

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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<T>, level : i32) -> vec2<i32>
textureDimensions(texture : texture_2d_array<T>, level : i32) -> vec2<i32>
textureDimensions(texture : texture_3d<T>, level : i32) -> vec3<i32>
@ -434,7 +434,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) {
textureDimensions(texture : texture_depth_cube, level : i32) -> vec3<i32>
textureDimensions(texture : texture_depth_cube_array, level : i32) -> vec3<i32>
textureDimensions(texture : texture_1d<T>) -> i32
textureDimensions(texture : texture_1d_array<T>) -> i32
textureDimensions(texture : texture_2d<T>) -> vec2<i32>
textureDimensions(texture : texture_2d_array<T>) -> vec2<i32>
textureDimensions(texture : texture_3d<T>) -> vec3<i32>
@ -447,7 +446,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByNumberOfParameters) {
textureDimensions(texture : texture_depth_cube) -> vec3<i32>
textureDimensions(texture : texture_depth_cube_array) -> vec3<i32>
textureDimensions(texture : texture_storage_1d<F>) -> i32
textureDimensions(texture : texture_storage_1d_array<F>) -> i32
textureDimensions(texture : texture_storage_2d<F>) -> vec2<i32>
textureDimensions(texture : texture_storage_2d_array<F>) -> vec2<i32>
textureDimensions(texture : texture_storage_3d<F>) -> vec3<i32>
@ -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<i32>
textureDimensions(texture : texture_depth_2d) -> vec2<i32>
textureDimensions(texture : texture_2d<T>, level : i32) -> vec2<i32>
@ -474,7 +472,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) {
textureDimensions(texture : texture_depth_cube, level : i32) -> vec3<i32>
textureDimensions(texture : texture_depth_cube_array, level : i32) -> vec3<i32>
textureDimensions(texture : texture_1d<T>) -> i32
textureDimensions(texture : texture_1d_array<T>) -> i32
textureDimensions(texture : texture_2d<T>) -> vec2<i32>
textureDimensions(texture : texture_2d_array<T>) -> vec2<i32>
textureDimensions(texture : texture_3d<T>) -> vec3<i32>
@ -486,7 +483,6 @@ TEST_F(IntrinsicTableTest, OverloadOrderByMatchingParameter) {
textureDimensions(texture : texture_depth_cube) -> vec3<i32>
textureDimensions(texture : texture_depth_cube_array) -> vec3<i32>
textureDimensions(texture : texture_storage_1d<F>) -> i32
textureDimensions(texture : texture_storage_1d_array<F>) -> i32
textureDimensions(texture : texture_storage_2d<F>) -> vec2<i32>
textureDimensions(texture : texture_storage_2d_array<F>) -> vec2<i32>
textureDimensions(texture : texture_storage_3d<F>) -> vec3<i32>

View File

@ -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:

View File

@ -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}));

View File

@ -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<ImageAccessCase>{
// 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<ImageAccessCase>{
// 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 "

View File

@ -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"};
}

View File

@ -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},

View File

@ -584,7 +584,6 @@ Maybe<type::Type*> 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<type::TextureDimension> 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<type::TextureDimension> 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<type::TextureDimension> 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))

View File

@ -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();

View File

@ -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();

View File

@ -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:

View File

@ -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'

View File

@ -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:

View File

@ -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

View File

@ -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));

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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<float4>"},
HlslStorageTextureData{type::TextureDimension::k1dArray,
type::ImageFormat::kRgba8Snorm, true,
"RWTexture1DArray<float4>"},
HlslStorageTextureData{type::TextureDimension::k2d,
type::ImageFormat::kRgba16Float,
true, "RWTexture2D<float4>"},
@ -440,9 +436,6 @@ INSTANTIATE_TEST_SUITE_P(
HlslStorageTextureData{type::TextureDimension::k1d,
type::ImageFormat::kRgba32Float,
false, "RWTexture1D<float4>"},
HlslStorageTextureData{type::TextureDimension::k1dArray,
type::ImageFormat::kRgba8Uint, false,
"RWTexture1DArray<uint4>"},
HlslStorageTextureData{type::TextureDimension::k2d,
type::ImageFormat::kRgba16Uint,
false, "RWTexture2D<uint4>"},
@ -455,9 +448,6 @@ INSTANTIATE_TEST_SUITE_P(
HlslStorageTextureData{type::TextureDimension::k1d,
type::ImageFormat::kRgba32Uint, true,
"RWTexture1D<uint4>"},
HlslStorageTextureData{type::TextureDimension::k1dArray,
type::ImageFormat::kRgba8Sint, true,
"RWTexture1DArray<int4>"},
HlslStorageTextureData{type::TextureDimension::k2d,
type::ImageFormat::kRgba16Sint, true,
"RWTexture2D<int4>"},

View File

@ -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",

View File

@ -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",

View File

@ -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;

View File

@ -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:

View File

@ -385,8 +385,6 @@ INSTANTIATE_TEST_SUITE_P(
MslSampledtexturesTest,
testing::Values(MslTextureData{type::TextureDimension::k1d,
"texture1d<float, access::sample>"},
MslTextureData{type::TextureDimension::k1dArray,
"texture1d_array<float, access::sample>"},
MslTextureData{type::TextureDimension::k2d,
"texture2d<float, access::sample>"},
MslTextureData{type::TextureDimension::k2dArray,
@ -442,8 +440,6 @@ INSTANTIATE_TEST_SUITE_P(
testing::Values(
MslStorageTextureData{type::TextureDimension::k1d, true,
"texture1d<float, access::read>"},
MslStorageTextureData{type::TextureDimension::k1dArray, true,
"texture1d_array<float, access::read>"},
MslStorageTextureData{type::TextureDimension::k2d, true,
"texture2d<float, access::read>"},
MslStorageTextureData{type::TextureDimension::k2dArray, true,
@ -452,8 +448,6 @@ INSTANTIATE_TEST_SUITE_P(
"texture3d<float, access::read>"},
MslStorageTextureData{type::TextureDimension::k1d, false,
"texture1d<float, access::write>"},
MslStorageTextureData{type::TextureDimension::k1dArray, false,
"texture1d_array<float, access::write>"},
MslStorageTextureData{type::TextureDimension::k2d, false,
"texture2d<float, access::write>"},
MslStorageTextureData{type::TextureDimension::k2dArray, false,

View File

@ -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<type::SampledTexture>()) {
push_capability(SpvCapabilitySampled1D);

View File

@ -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 {

View File

@ -783,24 +783,6 @@ TEST_F(BuilderTest_Type, SampledTexture_Generate_1d_f32) {
)");
}
TEST_F(BuilderTest_Type, SampledTexture_Generate_1dArray) {
auto* s =
create<type::SampledTexture>(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::SampledTexture>(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::StorageTexture>(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());

View File

@ -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;

View File

@ -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<r8unorm>"},
StorageTextureData{
type::ImageFormat::kR8Unorm, type::TextureDimension::k1dArray,
ast::AccessControl::kReadOnly,
"[[access(read)]]\ntexture_storage_1d_array<r8unorm>"},
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<r8unorm>"},
StorageTextureData{
type::ImageFormat::kR8Unorm, type::TextureDimension::k1dArray,
ast::AccessControl::kWriteOnly,
"[[access(write)]]\ntexture_storage_1d_array<r8unorm>"},
StorageTextureData{type::ImageFormat::kR8Unorm,
type::TextureDimension::k2d,
ast::AccessControl::kWriteOnly,