Revert "Remove deprecated textureLoad overloads with no level param"
This reverts commit cc4c22ebaa72a2365dc196c4a1496e5a36452cdc.
Reason for revert: Broke Dawn e2e tests w/ SwiftShader
Original change's description:
> Remove deprecated textureLoad overloads with no level param
>
> BUG=tint:516
>
> Change-Id: I7004e0dbd44d703c684118136b05b84cf609c6ba
> Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42703
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Bug: tint:516
Change-Id: I6b7857304872fd0048c23999ac223ce9dcaf7fe1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/43540
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc
index 7341228..b9ec2f9 100644
--- a/src/ast/intrinsic_texture_helper_test.cc
+++ b/src/ast/intrinsic_texture_helper_test.cc
@@ -1662,6 +1662,45 @@
},
},
{
+ ValidTextureOverload::kLoad1dF32,
+ "textureLoad(t : texture_1d<f32>,\n"
+ " coords : i32) -> vec4<f32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k1d,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ 1); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad1dU32,
+ "textureLoad(t : texture_1d<u32>,\n"
+ " coords : i32) -> vec4<u32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k1d,
+ TextureDataType::kU32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ 1); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad1dI32,
+ "textureLoad(t : texture_1d<i32>,\n"
+ " coords : i32) -> vec4<i32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k1d,
+ TextureDataType::kI32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ 1); // coords
+ },
+ },
+ {
ValidTextureOverload::kLoad1dLevelF32,
"textureLoad(t : texture_1d<f32>,\n"
" coords : i32,\n"
@@ -1707,6 +1746,45 @@
},
},
{
+ ValidTextureOverload::kLoad2dF32,
+ "textureLoad(t : texture_2d<f32>,\n"
+ " coords : vec2<i32>) -> vec4<f32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2)); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad2dU32,
+ "textureLoad(t : texture_2d<u32>,\n"
+ " coords : vec2<i32>) -> vec4<u32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2d,
+ TextureDataType::kU32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2)); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad2dI32,
+ "textureLoad(t : texture_2d<i32>,\n"
+ " coords : vec2<i32>) -> vec4<i32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2d,
+ TextureDataType::kI32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2)); // coords
+ },
+ },
+ {
ValidTextureOverload::kLoad2dLevelF32,
"textureLoad(t : texture_2d<f32>,\n"
" coords : vec2<i32>,\n"
@@ -1752,6 +1830,51 @@
},
},
{
+ ValidTextureOverload::kLoad2dArrayF32,
+ "textureLoad(t : texture_2d_array<f32>,\n"
+ " coords : vec2<i32>,\n"
+ " array_index : i32) -> vec4<f32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2dArray,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2), // coords
+ 3); // array_index
+ },
+ },
+ {
+ ValidTextureOverload::kLoad2dArrayU32,
+ "textureLoad(t : texture_2d_array<u32>,\n"
+ " coords : vec2<i32>,\n"
+ " array_index : i32) -> vec4<u32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2dArray,
+ TextureDataType::kU32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2), // coords
+ 3); // array_index
+ },
+ },
+ {
+ ValidTextureOverload::kLoad2dArrayI32,
+ "textureLoad(t : texture_2d_array<i32>,\n"
+ " coords : vec2<i32>,\n"
+ " array_index : i32) -> vec4<i32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k2dArray,
+ TextureDataType::kI32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2), // coords
+ 3); // array_index
+ },
+ },
+ {
ValidTextureOverload::kLoad2dArrayLevelF32,
"textureLoad(t : texture_2d_array<f32>,\n"
" coords : vec2<i32>,\n"
@@ -1803,6 +1926,45 @@
},
},
{
+ ValidTextureOverload::kLoad3dF32,
+ "textureLoad(t : texture_3d<f32>,\n"
+ " coords : vec3<i32>) -> vec4<f32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k3d,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec3<i32>(1, 2, 3)); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad3dU32,
+ "textureLoad(t : texture_3d<u32>,\n"
+ " coords : vec3<i32>) -> vec4<u32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k3d,
+ TextureDataType::kU32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec3<i32>(1, 2, 3)); // coords
+ },
+ },
+ {
+ ValidTextureOverload::kLoad3dI32,
+ "textureLoad(t : texture_3d<i32>,\n"
+ " coords : vec3<i32>) -> vec4<i32>",
+ TextureKind::kRegular,
+ type::TextureDimension::k3d,
+ TextureDataType::kI32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec3<i32>(1, 2, 3)); // coords
+ },
+ },
+ {
ValidTextureOverload::kLoad3dLevelF32,
"textureLoad(t : texture_3d<f32>,\n"
" coords : vec3<i32>,\n"
@@ -1944,6 +2106,19 @@
},
},
{
+ ValidTextureOverload::kLoadDepth2dF32,
+ "textureLoad(t : texture_depth_2d,\n"
+ " coords : vec2<i32>) -> f32",
+ TextureKind::kDepth,
+ type::TextureDimension::k2d,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2)); // coords
+ },
+ },
+ {
ValidTextureOverload::kLoadDepth2dLevelF32,
"textureLoad(t : texture_depth_2d,\n"
" coords : vec2<i32>,\n"
@@ -1959,6 +2134,21 @@
},
},
{
+ ValidTextureOverload::kLoadDepth2dArrayF32,
+ "textureLoad(t : texture_depth_2d_array,\n"
+ " coords : vec2<i32>,\n"
+ " array_index : i32) -> f32",
+ TextureKind::kDepth,
+ type::TextureDimension::k2dArray,
+ TextureDataType::kF32,
+ "textureLoad",
+ [](ProgramBuilder* b) {
+ return b->ExprList("texture", // t
+ b->vec2<i32>(1, 2), // coords
+ 3); // array_index
+ },
+ },
+ {
ValidTextureOverload::kLoadDepth2dArrayLevelF32,
"textureLoad(t : texture_depth_2d_array,\n"
" coords : vec2<i32>,\n"
diff --git a/src/ast/intrinsic_texture_helper_test.h b/src/ast/intrinsic_texture_helper_test.h
index 91425af..17fac28 100644
--- a/src/ast/intrinsic_texture_helper_test.h
+++ b/src/ast/intrinsic_texture_helper_test.h
@@ -134,15 +134,27 @@
kSampleCompareDepth2dArrayOffsetF32,
kSampleCompareDepthCubeF32,
kSampleCompareDepthCubeArrayF32,
+ kLoad1dF32,
+ kLoad1dU32,
+ kLoad1dI32,
kLoad1dLevelF32,
kLoad1dLevelU32,
kLoad1dLevelI32,
+ kLoad2dF32,
+ kLoad2dU32,
+ kLoad2dI32,
kLoad2dLevelF32,
kLoad2dLevelU32,
kLoad2dLevelI32,
+ kLoad2dArrayF32,
+ kLoad2dArrayU32,
+ kLoad2dArrayI32,
kLoad2dArrayLevelF32,
kLoad2dArrayLevelU32,
kLoad2dArrayLevelI32,
+ kLoad3dF32,
+ kLoad3dU32,
+ kLoad3dI32,
kLoad3dLevelF32,
kLoad3dLevelU32,
kLoad3dLevelI32,
@@ -152,7 +164,9 @@
kLoadMultisampled2dArrayF32,
kLoadMultisampled2dArrayU32,
kLoadMultisampled2dArrayI32,
+ kLoadDepth2dF32,
kLoadDepth2dLevelF32,
+ kLoadDepth2dArrayF32,
kLoadDepth2dArrayLevelF32,
kLoadStorageRO1dRgba32float, // Not permutated for all texel formats
kLoadStorageRO2dRgba8unorm,
diff --git a/src/intrinsic_table.cc b/src/intrinsic_table.cc
index c9dc2bf..31b1a7e 100644
--- a/src/intrinsic_table.cc
+++ b/src/intrinsic_table.cc
@@ -1241,7 +1241,6 @@
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
- Register(I::kTextureLoad, vec4_T, {{t, tex_1d_T}, {coords, i32}, {level, i32}, }); // NOLINT
Register(I::kTextureLoad, vec4_T, {{t, tex_2d_T}, {coords, vec2_i32}, {level, i32}, }); // NOLINT
Register(I::kTextureLoad, vec4_T, {{t, tex_2d_array_T}, {coords, vec2_i32}, {array_index, i32}, {level, i32}, }); // NOLINT
Register(I::kTextureLoad, vec4_T, {{t, tex_3d_T}, {coords, vec3_i32}, {level, i32}, }); // NOLINT
@@ -1254,6 +1253,20 @@
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
+ // TODO(bclayton): Update the rest of tint to reflect the spec changes made in
+ // https://github.com/gpuweb/gpuweb/pull/1301:
+
+ // Overloads added in https://github.com/gpuweb/gpuweb/pull/1301
+ Register(I::kTextureLoad, vec4_T, {{t, tex_1d_T}, {coords, 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_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
+ Register(I::kTextureLoad, f32, {{t, tex_depth_2d}, {coords, vec2_i32}, }); // NOLINT
+ Register(I::kTextureLoad, f32, {{t, tex_depth_2d_array}, {coords, vec2_i32}, {array_index, i32}, }); // NOLINT
+
// clang-format on
}
diff --git a/src/intrinsic_table_test.cc b/src/intrinsic_table_test.cc
index 7f377b4..2a28246 100644
--- a/src/intrinsic_table_test.cc
+++ b/src/intrinsic_table_test.cc
@@ -73,15 +73,14 @@
auto* tex =
create<type::SampledTexture>(type::TextureDimension::k1d, ty.f32());
auto result = table->Lookup(*this, IntrinsicType::kTextureLoad,
- {tex, ty.i32(), ty.i32()}, Source{});
+ {tex, ty.i32()}, Source{});
ASSERT_NE(result.intrinsic, nullptr);
ASSERT_EQ(result.diagnostics.str(), "");
EXPECT_THAT(result.intrinsic->Type(), IntrinsicType::kTextureLoad);
EXPECT_THAT(result.intrinsic->ReturnType(), ty.vec4<f32>());
EXPECT_THAT(result.intrinsic->Parameters(),
ElementsAre(Parameter{tex, Parameter::Usage::kTexture},
- Parameter{ty.i32(), Parameter::Usage::kCoords},
- Parameter{ty.i32(), Parameter::Usage::kLevel}));
+ Parameter{ty.i32(), Parameter::Usage::kCoords}));
}
TEST_F(IntrinsicTableTest, MismatchI32) {
@@ -251,15 +250,15 @@
auto* tex =
create<type::SampledTexture>(type::TextureDimension::k2d, ty.f32());
auto result = table->Lookup(*this, IntrinsicType::kTextureLoad,
- {tex, ty.vec2<i32>(), ty.i32()}, Source{});
+ {tex, ty.vec2<i32>()}, Source{});
ASSERT_NE(result.intrinsic, nullptr);
ASSERT_EQ(result.diagnostics.str(), "");
EXPECT_THAT(result.intrinsic->Type(), IntrinsicType::kTextureLoad);
EXPECT_THAT(result.intrinsic->ReturnType(), ty.vec4<f32>());
- EXPECT_THAT(result.intrinsic->Parameters(),
- ElementsAre(Parameter{tex, Parameter::Usage::kTexture},
- Parameter{ty.vec2<i32>(), Parameter::Usage::kCoords},
- Parameter{ty.i32(), Parameter::Usage::kLevel}));
+ EXPECT_THAT(
+ result.intrinsic->Parameters(),
+ ElementsAre(Parameter{tex, Parameter::Usage::kTexture},
+ Parameter{ty.vec2<i32>(), Parameter::Usage::kCoords}));
}
TEST_F(IntrinsicTableTest, MatchMultisampledTexture) {
@@ -280,15 +279,15 @@
TEST_F(IntrinsicTableTest, MatchDepthTexture) {
auto* tex = create<type::DepthTexture>(type::TextureDimension::k2d);
auto result = table->Lookup(*this, IntrinsicType::kTextureLoad,
- {tex, ty.vec2<i32>(), ty.i32()}, Source{});
+ {tex, ty.vec2<i32>()}, Source{});
ASSERT_NE(result.intrinsic, nullptr);
ASSERT_EQ(result.diagnostics.str(), "");
EXPECT_THAT(result.intrinsic->Type(), IntrinsicType::kTextureLoad);
EXPECT_THAT(result.intrinsic->ReturnType(), ty.f32());
- EXPECT_THAT(result.intrinsic->Parameters(),
- ElementsAre(Parameter{tex, Parameter::Usage::kTexture},
- Parameter{ty.vec2<i32>(), Parameter::Usage::kCoords},
- Parameter{ty.i32(), Parameter::Usage::kLevel}));
+ EXPECT_THAT(
+ result.intrinsic->Parameters(),
+ ElementsAre(Parameter{tex, Parameter::Usage::kTexture},
+ Parameter{ty.vec2<i32>(), Parameter::Usage::kCoords}));
}
TEST_F(IntrinsicTableTest, MatchROStorageTexture) {
diff --git a/src/type_determiner_test.cc b/src/type_determiner_test.cc
index edb95cf..212da35 100644
--- a/src/type_determiner_test.cc
+++ b/src/type_determiner_test.cc
@@ -1746,10 +1746,7 @@
add_call_param("texture", texture_type, &call_params);
add_call_param("coords", coords_type, &call_params);
- if (dim == type::TextureDimension::k2dArray) {
- add_call_param("array_index", ty.i32(), &call_params);
- }
- add_call_param("level", ty.i32(), &call_params);
+ add_call_param("lod", ty.i32(), &call_params);
auto* expr = Call("textureLoad", call_params);
WrapInFunction(expr);
@@ -3450,24 +3447,48 @@
return R"(textureSampleCompare(texture, sampler, coords, depth_ref))";
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
+ case ValidTextureOverload::kLoad1dF32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad1dU32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad1dI32:
+ return R"(textureLoad(texture, coords))";
case ValidTextureOverload::kLoad1dLevelF32:
return R"(textureLoad(texture, coords, level))";
case ValidTextureOverload::kLoad1dLevelU32:
return R"(textureLoad(texture, coords, level))";
case ValidTextureOverload::kLoad1dLevelI32:
return R"(textureLoad(texture, coords, level))";
+ case ValidTextureOverload::kLoad2dF32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad2dU32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad2dI32:
+ return R"(textureLoad(texture, coords))";
case ValidTextureOverload::kLoad2dLevelF32:
return R"(textureLoad(texture, coords, level))";
case ValidTextureOverload::kLoad2dLevelU32:
return R"(textureLoad(texture, coords, level))";
case ValidTextureOverload::kLoad2dLevelI32:
return R"(textureLoad(texture, coords, level))";
+ case ValidTextureOverload::kLoad2dArrayF32:
+ return R"(textureLoad(texture, coords, array_index))";
+ case ValidTextureOverload::kLoad2dArrayU32:
+ return R"(textureLoad(texture, coords, array_index))";
+ case ValidTextureOverload::kLoad2dArrayI32:
+ return R"(textureLoad(texture, coords, array_index))";
case ValidTextureOverload::kLoad2dArrayLevelF32:
return R"(textureLoad(texture, coords, array_index, level))";
case ValidTextureOverload::kLoad2dArrayLevelU32:
return R"(textureLoad(texture, coords, array_index, level))";
case ValidTextureOverload::kLoad2dArrayLevelI32:
return R"(textureLoad(texture, coords, array_index, level))";
+ case ValidTextureOverload::kLoad3dF32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad3dU32:
+ return R"(textureLoad(texture, coords))";
+ case ValidTextureOverload::kLoad3dI32:
+ return R"(textureLoad(texture, coords))";
case ValidTextureOverload::kLoad3dLevelF32:
return R"(textureLoad(texture, coords, level))";
case ValidTextureOverload::kLoad3dLevelU32:
@@ -3486,8 +3507,12 @@
return R"(textureLoad(texture, coords, array_index, sample_index))";
case ValidTextureOverload::kLoadMultisampled2dArrayI32:
return R"(textureLoad(texture, coords, array_index, sample_index))";
+ case ValidTextureOverload::kLoadDepth2dF32:
+ return R"(textureLoad(texture, coords))";
case ValidTextureOverload::kLoadDepth2dLevelF32:
return R"(textureLoad(texture, coords, level))";
+ case ValidTextureOverload::kLoadDepth2dArrayF32:
+ return R"(textureLoad(texture, coords, array_index))";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(textureLoad(texture, coords, array_index, level))";
case ValidTextureOverload::kLoadStorageRO1dRgba32float:
diff --git a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc
index 99a7950..c63dd7d 100644
--- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc
+++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc
@@ -305,24 +305,48 @@
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))";
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float4(1.0f, 2.0f, 3.0f, float(4)), 5.0f))";
+ case ValidTextureOverload::kLoad1dF32:
+ return R"(texture_tint_0.Load(int2(1, 0)))";
+ case ValidTextureOverload::kLoad1dU32:
+ return R"(texture_tint_0.Load(int2(1, 0)))";
+ case ValidTextureOverload::kLoad1dI32:
+ return R"(texture_tint_0.Load(int2(1, 0)))";
case ValidTextureOverload::kLoad1dLevelF32:
return R"(texture_tint_0.Load(int2(1, 0), 3))";
case ValidTextureOverload::kLoad1dLevelU32:
return R"(texture_tint_0.Load(int2(1, 0), 3))";
case ValidTextureOverload::kLoad1dLevelI32:
return R"(texture_tint_0.Load(int2(1, 0), 3))";
+ case ValidTextureOverload::kLoad2dF32:
+ return R"(texture_tint_0.Load(int3(1, 2, 0)))";
+ case ValidTextureOverload::kLoad2dU32:
+ return R"(texture_tint_0.Load(int3(1, 2, 0)))";
+ case ValidTextureOverload::kLoad2dI32:
+ return R"(texture_tint_0.Load(int3(1, 2, 0)))";
case ValidTextureOverload::kLoad2dLevelF32:
return R"(texture_tint_0.Load(int3(1, 2, 0), 3))";
case ValidTextureOverload::kLoad2dLevelU32:
return R"(texture_tint_0.Load(int3(1, 2, 0), 3))";
case ValidTextureOverload::kLoad2dLevelI32:
return R"(texture_tint_0.Load(int3(1, 2, 0), 3))";
+ case ValidTextureOverload::kLoad2dArrayF32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
+ case ValidTextureOverload::kLoad2dArrayU32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
+ case ValidTextureOverload::kLoad2dArrayI32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
case ValidTextureOverload::kLoad2dArrayLevelF32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
case ValidTextureOverload::kLoad2dArrayLevelU32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
case ValidTextureOverload::kLoad2dArrayLevelI32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
+ case ValidTextureOverload::kLoad3dF32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
+ case ValidTextureOverload::kLoad3dU32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
+ case ValidTextureOverload::kLoad3dI32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
case ValidTextureOverload::kLoad3dLevelF32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
case ValidTextureOverload::kLoad3dLevelU32:
@@ -341,8 +365,12 @@
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
case ValidTextureOverload::kLoadMultisampled2dArrayI32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
+ case ValidTextureOverload::kLoadDepth2dF32:
+ return R"(texture_tint_0.Load(int3(1, 2, 0)))";
case ValidTextureOverload::kLoadDepth2dLevelF32:
return R"(texture_tint_0.Load(int3(1, 2, 0), 3))";
+ case ValidTextureOverload::kLoadDepth2dArrayF32:
+ return R"(texture_tint_0.Load(int4(1, 2, 3, 0)))";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(texture_tint_0.Load(int4(1, 2, 3, 0), 4))";
case ValidTextureOverload::kLoadStorageRO1dRgba32float:
diff --git a/src/writer/msl/generator_impl_intrinsic_texture_test.cc b/src/writer/msl/generator_impl_intrinsic_texture_test.cc
index 55378f8..f4f8412 100644
--- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc
+++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc
@@ -190,24 +190,48 @@
return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))";
case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4, 5.0f))";
+ case ValidTextureOverload::kLoad1dF32:
+ return R"(texture_tint_0.read(1))";
+ case ValidTextureOverload::kLoad1dU32:
+ return R"(texture_tint_0.read(1))";
+ case ValidTextureOverload::kLoad1dI32:
+ return R"(texture_tint_0.read(1))";
case ValidTextureOverload::kLoad1dLevelF32:
return R"(texture_tint_0.read(1, 3))";
case ValidTextureOverload::kLoad1dLevelU32:
return R"(texture_tint_0.read(1, 3))";
case ValidTextureOverload::kLoad1dLevelI32:
return R"(texture_tint_0.read(1, 3))";
+ case ValidTextureOverload::kLoad2dF32:
+ return R"(texture_tint_0.read(int2(1, 2)))";
+ case ValidTextureOverload::kLoad2dU32:
+ return R"(texture_tint_0.read(int2(1, 2)))";
+ case ValidTextureOverload::kLoad2dI32:
+ return R"(texture_tint_0.read(int2(1, 2)))";
case ValidTextureOverload::kLoad2dLevelF32:
return R"(texture_tint_0.read(int2(1, 2), 3))";
case ValidTextureOverload::kLoad2dLevelU32:
return R"(texture_tint_0.read(int2(1, 2), 3))";
case ValidTextureOverload::kLoad2dLevelI32:
return R"(texture_tint_0.read(int2(1, 2), 3))";
+ case ValidTextureOverload::kLoad2dArrayF32:
+ return R"(texture_tint_0.read(int2(1, 2), 3))";
+ case ValidTextureOverload::kLoad2dArrayU32:
+ return R"(texture_tint_0.read(int2(1, 2), 3))";
+ case ValidTextureOverload::kLoad2dArrayI32:
+ return R"(texture_tint_0.read(int2(1, 2), 3))";
case ValidTextureOverload::kLoad2dArrayLevelF32:
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
case ValidTextureOverload::kLoad2dArrayLevelU32:
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
case ValidTextureOverload::kLoad2dArrayLevelI32:
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
+ case ValidTextureOverload::kLoad3dF32:
+ return R"(texture_tint_0.read(int3(1, 2, 3)))";
+ case ValidTextureOverload::kLoad3dU32:
+ return R"(texture_tint_0.read(int3(1, 2, 3)))";
+ case ValidTextureOverload::kLoad3dI32:
+ return R"(texture_tint_0.read(int3(1, 2, 3)))";
case ValidTextureOverload::kLoad3dLevelF32:
return R"(texture_tint_0.read(int3(1, 2, 3), 4))";
case ValidTextureOverload::kLoad3dLevelU32:
@@ -226,8 +250,12 @@
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
case ValidTextureOverload::kLoadMultisampled2dArrayI32:
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
+ case ValidTextureOverload::kLoadDepth2dF32:
+ return R"(texture_tint_0.read(int2(1, 2)))";
case ValidTextureOverload::kLoadDepth2dLevelF32:
return R"(texture_tint_0.read(int2(1, 2), 3))";
+ case ValidTextureOverload::kLoadDepth2dArrayF32:
+ return R"(texture_tint_0.read(int2(1, 2), 3))";
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return R"(texture_tint_0.read(int2(1, 2), 3, 4))";
case ValidTextureOverload::kLoadStorageRO1dRgba32float:
diff --git a/src/writer/spirv/builder_intrinsic_texture_test.cc b/src/writer/spirv/builder_intrinsic_texture_test.cc
index b7deeb0..b1ca0dc 100644
--- a/src/writer/spirv/builder_intrinsic_texture_test.cc
+++ b/src/writer/spirv/builder_intrinsic_texture_test.cc
@@ -2550,6 +2550,68 @@
R"(
OpCapability SampledCubeArray
)"};
+ case ValidTextureOverload::kLoad1dF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 1D 0 0 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 = OpTypeInt 32 1
+%12 = OpConstant %11 1
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %12
+)",
+ R"(
+OpCapability Sampled1D
+)"};
+ case ValidTextureOverload::kLoad1dU32:
+ return {
+ R"(
+%4 = OpTypeInt 32 0
+%3 = OpTypeImage %4 1D 0 0 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 = OpTypeInt 32 1
+%12 = OpConstant %11 1
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %12
+)",
+ R"(
+OpCapability Sampled1D
+)"};
+ case ValidTextureOverload::kLoad1dI32:
+ return {
+ R"(
+%4 = OpTypeInt 32 1
+%3 = OpTypeImage %4 1D 0 0 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 = OpConstant %4 1
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %11
+)",
+ R"(
+OpCapability Sampled1D
+)"};
case ValidTextureOverload::kLoad1dLevelF32:
return {
R"(
@@ -2615,6 +2677,74 @@
R"(
OpCapability Sampled1D
)"};
+ case ValidTextureOverload::kLoad2dF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 2D 0 0 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"(
+)"};
+ case ValidTextureOverload::kLoad2dU32:
+ return {
+ R"(
+%4 = OpTypeInt 32 0
+%3 = OpTypeImage %4 2D 0 0 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"(
+)"};
+ case ValidTextureOverload::kLoad2dI32:
+ return {
+ R"(
+%4 = OpTypeInt 32 1
+%3 = OpTypeImage %4 2D 0 0 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"(
+)"};
case ValidTextureOverload::kLoad2dLevelF32:
return {
R"(
@@ -2686,6 +2816,77 @@
)",
R"(
)"};
+ case ValidTextureOverload::kLoad2dArrayF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 2D 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 3
+%13 = OpConstant %12 1
+%14 = OpConstant %12 2
+%15 = OpConstant %12 3
+%16 = OpConstantComposite %11 %13 %14 %15
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %16
+)",
+ R"(
+)"};
+ case ValidTextureOverload::kLoad2dArrayU32:
+ return {
+ R"(
+%4 = OpTypeInt 32 0
+%3 = OpTypeImage %4 2D 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 3
+%13 = OpConstant %12 1
+%14 = OpConstant %12 2
+%15 = OpConstant %12 3
+%16 = OpConstantComposite %11 %13 %14 %15
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %16
+)",
+ R"(
+)"};
+ case ValidTextureOverload::kLoad2dArrayI32:
+ return {
+ R"(
+%4 = OpTypeInt 32 1
+%3 = OpTypeImage %4 2D 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 3
+%12 = OpConstant %4 1
+%13 = OpConstant %4 2
+%14 = OpConstant %4 3
+%15 = OpConstantComposite %11 %12 %13 %14
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %15
+)",
+ R"(
+)"};
case ValidTextureOverload::kLoad2dArrayLevelF32:
return {
R"(
@@ -2760,6 +2961,77 @@
)",
R"(
)"};
+ case ValidTextureOverload::kLoad3dF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 3D 0 0 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 3
+%13 = OpConstant %12 1
+%14 = OpConstant %12 2
+%15 = OpConstant %12 3
+%16 = OpConstantComposite %11 %13 %14 %15
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %16
+)",
+ R"(
+)"};
+ case ValidTextureOverload::kLoad3dU32:
+ return {
+ R"(
+%4 = OpTypeInt 32 0
+%3 = OpTypeImage %4 3D 0 0 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 3
+%13 = OpConstant %12 1
+%14 = OpConstant %12 2
+%15 = OpConstant %12 3
+%16 = OpConstantComposite %11 %13 %14 %15
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %16
+)",
+ R"(
+)"};
+ case ValidTextureOverload::kLoad3dI32:
+ return {
+ R"(
+%4 = OpTypeInt 32 1
+%3 = OpTypeImage %4 3D 0 0 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 3
+%12 = OpConstant %4 1
+%13 = OpConstant %4 2
+%14 = OpConstant %4 3
+%15 = OpConstantComposite %11 %12 %13 %14
+)",
+ R"(
+%10 = OpLoad %3 %1
+%8 = OpImageFetch %9 %10 %15
+)",
+ R"(
+)"};
case ValidTextureOverload::kLoad3dLevelF32:
return {
R"(
@@ -2979,6 +3251,30 @@
)",
R"(
)"};
+ case ValidTextureOverload::kLoadDepth2dF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 2D 1 0 0 1 Unknown
+%2 = OpTypePointer UniformConstant %3
+%1 = OpVariable %2 UniformConstant
+%7 = OpTypeSampler
+%6 = OpTypePointer UniformConstant %7
+%5 = OpVariable %6 UniformConstant
+%10 = OpTypeVector %4 4
+%13 = OpTypeInt 32 1
+%12 = OpTypeVector %13 2
+%14 = OpConstant %13 1
+%15 = OpConstant %13 2
+%16 = OpConstantComposite %12 %14 %15
+)",
+ R"(
+%11 = OpLoad %3 %1
+%9 = OpImageFetch %10 %11 %16
+%8 = OpCompositeExtract %4 %9 0
+)",
+ R"(
+)"};
case ValidTextureOverload::kLoadDepth2dLevelF32:
return {
R"(
@@ -3004,6 +3300,31 @@
)",
R"(
)"};
+ case ValidTextureOverload::kLoadDepth2dArrayF32:
+ return {
+ R"(
+%4 = OpTypeFloat 32
+%3 = OpTypeImage %4 2D 1 1 0 1 Unknown
+%2 = OpTypePointer UniformConstant %3
+%1 = OpVariable %2 UniformConstant
+%7 = OpTypeSampler
+%6 = OpTypePointer UniformConstant %7
+%5 = OpVariable %6 UniformConstant
+%10 = OpTypeVector %4 4
+%13 = OpTypeInt 32 1
+%12 = OpTypeVector %13 3
+%14 = OpConstant %13 1
+%15 = OpConstant %13 2
+%16 = OpConstant %13 3
+%17 = OpConstantComposite %12 %14 %15 %16
+)",
+ R"(
+%11 = OpLoad %3 %1
+%9 = OpImageFetch %10 %11 %17
+%8 = OpCompositeExtract %4 %9 0
+)",
+ R"(
+)"};
case ValidTextureOverload::kLoadDepth2dArrayLevelF32:
return {
R"(