diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index b9ec2f9832..7341228537 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -1661,45 +1661,6 @@ std::vector TextureOverloadCase::ValidCases() { 5.f); // depth_ref }, }, - { - ValidTextureOverload::kLoad1dF32, - "textureLoad(t : texture_1d,\n" - " coords : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1d, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1); // coords - }, - }, - { - ValidTextureOverload::kLoad1dU32, - "textureLoad(t : texture_1d,\n" - " coords : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1d, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1); // coords - }, - }, - { - ValidTextureOverload::kLoad1dI32, - "textureLoad(t : texture_1d,\n" - " coords : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k1d, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - 1); // coords - }, - }, { ValidTextureOverload::kLoad1dLevelF32, "textureLoad(t : texture_1d,\n" @@ -1745,45 +1706,6 @@ std::vector TextureOverloadCase::ValidCases() { 3); // level }, }, - { - ValidTextureOverload::kLoad2dF32, - "textureLoad(t : texture_2d,\n" - " coords : vec2) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2d, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2)); // coords - }, - }, - { - ValidTextureOverload::kLoad2dU32, - "textureLoad(t : texture_2d,\n" - " coords : vec2) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2d, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2)); // coords - }, - }, - { - ValidTextureOverload::kLoad2dI32, - "textureLoad(t : texture_2d,\n" - " coords : vec2) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2d, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2)); // coords - }, - }, { ValidTextureOverload::kLoad2dLevelF32, "textureLoad(t : texture_2d,\n" @@ -1829,51 +1751,6 @@ std::vector TextureOverloadCase::ValidCases() { 3); // level }, }, - { - ValidTextureOverload::kLoad2dArrayF32, - "textureLoad(t : texture_2d_array,\n" - " coords : vec2,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3); // array_index - }, - }, - { - ValidTextureOverload::kLoad2dArrayU32, - "textureLoad(t : texture_2d_array,\n" - " coords : vec2,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2dArray, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3); // array_index - }, - }, - { - ValidTextureOverload::kLoad2dArrayI32, - "textureLoad(t : texture_2d_array,\n" - " coords : vec2,\n" - " array_index : i32) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k2dArray, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3); // array_index - }, - }, { ValidTextureOverload::kLoad2dArrayLevelF32, "textureLoad(t : texture_2d_array,\n" @@ -1925,45 +1802,6 @@ std::vector TextureOverloadCase::ValidCases() { 4); // level }, }, - { - ValidTextureOverload::kLoad3dF32, - "textureLoad(t : texture_3d,\n" - " coords : vec3) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k3d, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec3(1, 2, 3)); // coords - }, - }, - { - ValidTextureOverload::kLoad3dU32, - "textureLoad(t : texture_3d,\n" - " coords : vec3) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k3d, - TextureDataType::kU32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec3(1, 2, 3)); // coords - }, - }, - { - ValidTextureOverload::kLoad3dI32, - "textureLoad(t : texture_3d,\n" - " coords : vec3) -> vec4", - TextureKind::kRegular, - type::TextureDimension::k3d, - TextureDataType::kI32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec3(1, 2, 3)); // coords - }, - }, { ValidTextureOverload::kLoad3dLevelF32, "textureLoad(t : texture_3d,\n" @@ -2105,19 +1943,6 @@ std::vector TextureOverloadCase::ValidCases() { 4); // sample_index }, }, - { - ValidTextureOverload::kLoadDepth2dF32, - "textureLoad(t : texture_depth_2d,\n" - " coords : vec2) -> f32", - TextureKind::kDepth, - type::TextureDimension::k2d, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2)); // coords - }, - }, { ValidTextureOverload::kLoadDepth2dLevelF32, "textureLoad(t : texture_depth_2d,\n" @@ -2133,21 +1958,6 @@ std::vector TextureOverloadCase::ValidCases() { 3); // level }, }, - { - ValidTextureOverload::kLoadDepth2dArrayF32, - "textureLoad(t : texture_depth_2d_array,\n" - " coords : vec2,\n" - " array_index : i32) -> f32", - TextureKind::kDepth, - type::TextureDimension::k2dArray, - TextureDataType::kF32, - "textureLoad", - [](ProgramBuilder* b) { - return b->ExprList("texture", // t - b->vec2(1, 2), // coords - 3); // array_index - }, - }, { ValidTextureOverload::kLoadDepth2dArrayLevelF32, "textureLoad(t : texture_depth_2d_array,\n" diff --git a/src/ast/intrinsic_texture_helper_test.h b/src/ast/intrinsic_texture_helper_test.h index 17fac28e82..91425af705 100644 --- a/src/ast/intrinsic_texture_helper_test.h +++ b/src/ast/intrinsic_texture_helper_test.h @@ -134,27 +134,15 @@ enum class ValidTextureOverload { 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, @@ -164,9 +152,7 @@ enum class ValidTextureOverload { 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 31b1a7ef5d..c9dc2bfb72 100644 --- a/src/intrinsic_table.cc +++ b/src/intrinsic_table.cc @@ -1241,6 +1241,7 @@ Impl::Impl() { 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 @@ -1253,20 +1254,6 @@ Impl::Impl() { 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 2a282467c0..7f377b4a3c 100644 --- a/src/intrinsic_table_test.cc +++ b/src/intrinsic_table_test.cc @@ -73,14 +73,15 @@ TEST_F(IntrinsicTableTest, MatchI32) { auto* tex = create(type::TextureDimension::k1d, ty.f32()); auto result = table->Lookup(*this, IntrinsicType::kTextureLoad, - {tex, ty.i32()}, Source{}); + {tex, ty.i32(), 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()); EXPECT_THAT(result.intrinsic->Parameters(), ElementsAre(Parameter{tex, Parameter::Usage::kTexture}, - Parameter{ty.i32(), Parameter::Usage::kCoords})); + Parameter{ty.i32(), Parameter::Usage::kCoords}, + Parameter{ty.i32(), Parameter::Usage::kLevel})); } TEST_F(IntrinsicTableTest, MismatchI32) { @@ -250,15 +251,15 @@ TEST_F(IntrinsicTableTest, MatchSampledTexture) { auto* tex = create(type::TextureDimension::k2d, ty.f32()); auto result = table->Lookup(*this, IntrinsicType::kTextureLoad, - {tex, ty.vec2()}, Source{}); + {tex, ty.vec2(), 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()); - EXPECT_THAT( - result.intrinsic->Parameters(), - ElementsAre(Parameter{tex, Parameter::Usage::kTexture}, - Parameter{ty.vec2(), Parameter::Usage::kCoords})); + EXPECT_THAT(result.intrinsic->Parameters(), + ElementsAre(Parameter{tex, Parameter::Usage::kTexture}, + Parameter{ty.vec2(), Parameter::Usage::kCoords}, + Parameter{ty.i32(), Parameter::Usage::kLevel})); } TEST_F(IntrinsicTableTest, MatchMultisampledTexture) { @@ -279,15 +280,15 @@ TEST_F(IntrinsicTableTest, MatchMultisampledTexture) { TEST_F(IntrinsicTableTest, MatchDepthTexture) { auto* tex = create(type::TextureDimension::k2d); auto result = table->Lookup(*this, IntrinsicType::kTextureLoad, - {tex, ty.vec2()}, Source{}); + {tex, ty.vec2(), 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.f32()); - EXPECT_THAT( - result.intrinsic->Parameters(), - ElementsAre(Parameter{tex, Parameter::Usage::kTexture}, - Parameter{ty.vec2(), Parameter::Usage::kCoords})); + EXPECT_THAT(result.intrinsic->Parameters(), + ElementsAre(Parameter{tex, Parameter::Usage::kTexture}, + Parameter{ty.vec2(), Parameter::Usage::kCoords}, + Parameter{ty.i32(), Parameter::Usage::kLevel})); } TEST_F(IntrinsicTableTest, MatchROStorageTexture) { diff --git a/src/type_determiner_test.cc b/src/type_determiner_test.cc index 212da355c1..edb95cf99a 100644 --- a/src/type_determiner_test.cc +++ b/src/type_determiner_test.cc @@ -1746,7 +1746,10 @@ TEST_P(Intrinsic_SampledTextureOperation, TextureLoadSampled) { add_call_param("texture", texture_type, &call_params); add_call_param("coords", coords_type, &call_params); - add_call_param("lod", ty.i32(), &call_params); + if (dim == type::TextureDimension::k2dArray) { + add_call_param("array_index", ty.i32(), &call_params); + } + add_call_param("level", ty.i32(), &call_params); auto* expr = Call("textureLoad", call_params); WrapInFunction(expr); @@ -3447,48 +3450,24 @@ const char* expected_texture_overload( 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: @@ -3507,12 +3486,8 @@ const char* expected_texture_overload( 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 c63dd7df76..99a79500d3 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc @@ -305,48 +305,24 @@ texture_tint_0.GetDimensions(_tint_tmp.x, _tint_tmp.y, _tint_tmp.z, _tint_tmp.w) 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: @@ -365,12 +341,8 @@ 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::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 f4f8412b7d..55378f8917 100644 --- a/src/writer/msl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/msl/generator_impl_intrinsic_texture_test.cc @@ -190,48 +190,24 @@ std::string expected_texture_overload( 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: @@ -250,12 +226,8 @@ std::string expected_texture_overload( 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 b1ca0dc030..b7deeb0d98 100644 --- a/src/writer/spirv/builder_intrinsic_texture_test.cc +++ b/src/writer/spirv/builder_intrinsic_texture_test.cc @@ -2549,68 +2549,6 @@ OpCapability SampledCubeArray )", 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 { @@ -2676,74 +2614,6 @@ OpCapability Sampled1D )", 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 { @@ -2813,77 +2683,6 @@ OpCapability Sampled1D R"( %10 = OpLoad %3 %1 %8 = OpImageFetch %9 %10 %14 Lod %15 -)", - 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"( )"}; @@ -2958,77 +2757,6 @@ OpCapability Sampled1D R"( %10 = OpLoad %3 %1 %8 = OpImageFetch %9 %10 %15 Lod %16 -)", - 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"( )"}; @@ -3248,30 +2976,6 @@ OpCapability Sampled1D R"( %10 = OpLoad %3 %1 %8 = OpImageFetch %9 %10 %15 Sample %16 -)", - 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"( )"}; @@ -3297,31 +3001,6 @@ OpCapability Sampled1D %11 = OpLoad %3 %1 %9 = OpImageFetch %10 %11 %16 Lod %17 %8 = OpCompositeExtract %4 %9 0 -)", - 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"( )"};