Resolver: Remove texture_storage read access

The intrinsics that did anything useful with this were deprecated
several releases ago.

Change-Id: I79e3c901b6a78583853a067ec46cfa98e346517c
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66262
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-10-14 10:10:45 +00:00
committed by Tint LUCI CQ
parent 14fc622161
commit f3f2d0a218
785 changed files with 3985 additions and 37787 deletions

View File

@@ -5288,12 +5288,8 @@ bool FunctionEmitter::EmitImageAccess(const spvtools::opt::Instruction& inst) {
case SpvOpImageDrefGather:
return Fail() << " image gather is not yet supported";
case SpvOpImageFetch:
// Read a single texel from a sampled image.
builtin_name = "textureLoad";
use_level_of_detail_suffix = false;
break;
case SpvOpImageRead:
// Read a single texel from a storage image.
// Read a single texel from a sampled or storage image.
builtin_name = "textureLoad";
use_level_of_detail_suffix = false;
break;
@@ -5365,11 +5361,11 @@ bool FunctionEmitter::EmitImageAccess(const spvtools::opt::Instruction& inst) {
image_operands_mask ^= SpvImageOperandsLodMask;
arg_index++;
} else if ((opcode == SpvOpImageFetch) &&
(texture_type->Is<SampledTexture>() ||
texture_type->Is<DepthTexture>())) {
// textureLoad on sampled texture and depth texture requires an explicit
// level-of-detail parameter.
} else if ((opcode == SpvOpImageFetch || opcode == SpvOpImageRead) &&
!texture_type
->IsAnyOf<DepthMultisampledTexture, MultisampledTexture>()) {
// textureLoad requires an explicit level-of-detail parameter for
// non-multisampled texture types.
params.push_back(parser_impl_.MakeNullValue(ty_.I32()));
}
if (arg_index + 1 < num_args &&

View File

@@ -2537,7 +2537,7 @@ const Pointer* ParserImpl::GetTypeForHandleVar(
// WGSL textures are always formatted. Unformatted textures are always
// sampled.
if (usage.IsSampledTexture() ||
if (usage.IsSampledTexture() || usage.IsStorageReadTexture() ||
(image_type->format() == SpvImageFormatUnknown)) {
// Make a sampled texture type.
auto* ast_sampled_component_type =
@@ -2566,8 +2566,7 @@ const Pointer* ParserImpl::GetTypeForHandleVar(
ast_store_type = ty_.SampledTexture(dim, ast_sampled_component_type);
}
} else {
const auto access = usage.IsStorageReadTexture() ? ast::Access::kRead
: ast::Access::kWrite;
const auto access = ast::Access::kWrite;
const auto format = enum_converter_.ToImageFormat(image_type->format());
if (format == ast::ImageFormat::kNone) {
return nullptr;

View File

@@ -695,7 +695,7 @@ TEST_F(SpvParserTest, ConvertType_Array_NoDeduplication) {
TEST_F(SpvParserTest, ConvertType_RuntimeArray_NoDeduplication) {
// Prove that distinct SPIR-V runtime arrays map to distinct WGSL types.
// The implementation already deduplciates them because it knows
// The implementation already de-duplicates them because it knows
// runtime-arrays normally have stride decorations.
auto assembly = Preamble() + R"(
%uint = OpTypeInt 32 0

View File

@@ -1309,7 +1309,7 @@ INSTANTIATE_TEST_SUITE_P(Images,
x_10
none
undefined
__storage_texture_1d_rg32float_read
__sampled_texture_1d__f32
})"},
DeclUnderspecifiedHandleCase{R"(
OpDecorate %10 NonReadable
@@ -4615,7 +4615,7 @@ INSTANTIATE_TEST_SUITE_P(ImageRead_OptionalParams,
x_20
none
undefined
__storage_texture_2d_rgba32float_read
__sampled_texture_2d__f32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -4629,6 +4629,7 @@ INSTANTIATE_TEST_SUITE_P(ImageRead_OptionalParams,
(
Identifier[not set]{x_20}
Identifier[not set]{vi12}
ScalarConstructor[not set]{0}
)
}
}
@@ -5079,7 +5080,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_2d_rgba32float_read
__sampled_texture_2d__f32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5093,6 +5094,7 @@ INSTANTIATE_TEST_SUITE_P(
(
Identifier[not set]{x_20}
Identifier[not set]{vi12}
ScalarConstructor[not set]{0}
)
}
}
@@ -5108,7 +5110,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_2d_rgba32uint_read
__sampled_texture_2d__u32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5122,6 +5124,7 @@ INSTANTIATE_TEST_SUITE_P(
(
Identifier[not set]{x_20}
Identifier[not set]{vi12}
ScalarConstructor[not set]{0}
)
}
}
@@ -5143,7 +5146,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_2d_rgba32sint_read
__sampled_texture_2d__i32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5157,6 +5160,7 @@ INSTANTIATE_TEST_SUITE_P(
(
Identifier[not set]{x_20}
Identifier[not set]{vi12}
ScalarConstructor[not set]{0}
)
}
}
@@ -5237,7 +5241,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_1d_rgba32float_read
__sampled_texture_1d__f32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5271,7 +5275,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_2d_rgba32float_read
__sampled_texture_2d__f32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5305,7 +5309,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_3d_rgba32float_read
__sampled_texture_3d__f32
})",
R"(VariableDeclStatement{
VariableConst{
@@ -5380,7 +5384,7 @@ INSTANTIATE_TEST_SUITE_P(
x_20
none
undefined
__storage_texture_2d_array_rgba32float_read
__sampled_texture_2d_array__f32
})",
R"(VariableDeclStatement{
VariableConst{