Fix ValidTextureOverload enum names for kSampleCompare

For some stupid reason, these were all incorrectly prefixed with kSampleGrad, despite the test data all being correct.

Bug: tint:140
Change-Id: If556194d06c7596419a9e7b83165361bb19c7f44
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/37705
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2021-01-13 16:36:51 +00:00 committed by Commit Bot service account
parent 7c5980991a
commit 57166264e0
6 changed files with 36 additions and 37 deletions

View File

@ -190,7 +190,6 @@ ast::Variable* TextureOverloadCase::buildTextureVariable(
ast::Variable* TextureOverloadCase::buildSamplerVariable( ast::Variable* TextureOverloadCase::buildSamplerVariable(
ast::Builder* b) const { ast::Builder* b) const {
VariableDecorationList decos = { VariableDecorationList decos = {
b->create<ast::SetDecoration>(0), b->create<ast::SetDecoration>(0),
b->create<ast::BindingDecoration>(1), b->create<ast::BindingDecoration>(1),
@ -1422,7 +1421,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepth2dF32, ValidTextureOverload::kSampleCompareDepth2dF32,
"textureSampleCompare(t : texture_depth_2d,\n" "textureSampleCompare(t : texture_depth_2d,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec2<f32>,\n" " coords : vec2<f32>,\n"
@ -1440,7 +1439,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepth2dOffsetF32, ValidTextureOverload::kSampleCompareDepth2dOffsetF32,
"textureSampleCompare(t : texture_depth_2d,\n" "textureSampleCompare(t : texture_depth_2d,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec2<f32>,\n" " coords : vec2<f32>,\n"
@ -1460,7 +1459,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepth2dArrayF32, ValidTextureOverload::kSampleCompareDepth2dArrayF32,
"textureSampleCompare(t : texture_depth_2d_array,\n" "textureSampleCompare(t : texture_depth_2d_array,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec2<f32>,\n" " coords : vec2<f32>,\n"
@ -1480,7 +1479,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepth2dArrayOffsetF32, ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32,
"textureSampleCompare(t : texture_depth_2d_array,\n" "textureSampleCompare(t : texture_depth_2d_array,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec2<f32>,\n" " coords : vec2<f32>,\n"
@ -1502,7 +1501,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepthCubeF32, ValidTextureOverload::kSampleCompareDepthCubeF32,
"textureSampleCompare(t : texture_depth_cube,\n" "textureSampleCompare(t : texture_depth_cube,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec3<f32>,\n" " coords : vec3<f32>,\n"
@ -1520,7 +1519,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
}, },
}, },
{ {
ValidTextureOverload::kSampleGradDepthCubeArrayF32, ValidTextureOverload::kSampleCompareDepthCubeArrayF32,
"textureSampleCompare(t : texture_depth_cube_array,\n" "textureSampleCompare(t : texture_depth_cube_array,\n"
" s : sampler_comparison,\n" " s : sampler_comparison,\n"
" coords : vec3<f32>,\n" " coords : vec3<f32>,\n"

View File

@ -114,12 +114,12 @@ enum class ValidTextureOverload {
kSampleGrad3dOffsetF32, kSampleGrad3dOffsetF32,
kSampleGradCubeF32, kSampleGradCubeF32,
kSampleGradCubeArrayF32, kSampleGradCubeArrayF32,
kSampleGradDepth2dF32, kSampleCompareDepth2dF32,
kSampleGradDepth2dOffsetF32, kSampleCompareDepth2dOffsetF32,
kSampleGradDepth2dArrayF32, kSampleCompareDepth2dArrayF32,
kSampleGradDepth2dArrayOffsetF32, kSampleCompareDepth2dArrayOffsetF32,
kSampleGradDepthCubeF32, kSampleCompareDepthCubeF32,
kSampleGradDepthCubeArrayF32, kSampleCompareDepthCubeArrayF32,
kLoad1dF32, kLoad1dF32,
kLoad1dU32, kLoad1dU32,
kLoad1dI32, kLoad1dI32,

View File

@ -3030,17 +3030,17 @@ const char* expected_texture_overload(
return R"(textureSampleGrad(texture, sampler, coords, ddx, ddy))"; return R"(textureSampleGrad(texture, sampler, coords, ddx, ddy))";
case ValidTextureOverload::kSampleGradCubeArrayF32: case ValidTextureOverload::kSampleGradCubeArrayF32:
return R"(textureSampleGrad(texture, sampler, coords, array_index, ddx, ddy))"; return R"(textureSampleGrad(texture, sampler, coords, array_index, ddx, ddy))";
case ValidTextureOverload::kSampleGradDepth2dF32: case ValidTextureOverload::kSampleCompareDepth2dF32:
return R"(textureSampleCompare(texture, sampler, coords, depth_ref))"; return R"(textureSampleCompare(texture, sampler, coords, depth_ref))";
case ValidTextureOverload::kSampleGradDepth2dOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dOffsetF32:
return R"(textureSampleCompare(texture, sampler, coords, depth_ref, offset))"; return R"(textureSampleCompare(texture, sampler, coords, depth_ref, offset))";
case ValidTextureOverload::kSampleGradDepth2dArrayF32: case ValidTextureOverload::kSampleCompareDepth2dArrayF32:
return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))"; return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
case ValidTextureOverload::kSampleGradDepth2dArrayOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32:
return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref, offset))"; return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref, offset))";
case ValidTextureOverload::kSampleGradDepthCubeF32: case ValidTextureOverload::kSampleCompareDepthCubeF32:
return R"(textureSampleCompare(texture, sampler, coords, depth_ref))"; return R"(textureSampleCompare(texture, sampler, coords, depth_ref))";
case ValidTextureOverload::kSampleGradDepthCubeArrayF32: case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))"; return R"(textureSampleCompare(texture, sampler, coords, array_index, depth_ref))";
case ValidTextureOverload::kLoad1dF32: case ValidTextureOverload::kLoad1dF32:
return R"(textureLoad(texture, coords))"; return R"(textureLoad(texture, coords))";

View File

@ -203,17 +203,17 @@ ExpectedResult expected_texture_overload(
return R"(texture_tint_0.SampleGrad(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f)))"; return R"(texture_tint_0.SampleGrad(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f)))";
case ValidTextureOverload::kSampleGradCubeArrayF32: case ValidTextureOverload::kSampleGradCubeArrayF32:
return R"(texture_tint_0.SampleGrad(sampler_tint_0, float4(1.0f, 2.0f, 3.0f, float(4)), float3(5.0f, 6.0f, 7.0f), float3(8.0f, 9.0f, 10.0f)))"; return R"(texture_tint_0.SampleGrad(sampler_tint_0, float4(1.0f, 2.0f, 3.0f, float(4)), float3(5.0f, 6.0f, 7.0f), float3(8.0f, 9.0f, 10.0f)))";
case ValidTextureOverload::kSampleGradDepth2dF32: case ValidTextureOverload::kSampleCompareDepth2dF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float2(1.0f, 2.0f), 3.0f))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float2(1.0f, 2.0f), 3.0f))";
case ValidTextureOverload::kSampleGradDepth2dOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dOffsetF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float2(1.0f, 2.0f), 3.0f, int2(4, 5)))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float2(1.0f, 2.0f), 3.0f, int2(4, 5)))";
case ValidTextureOverload::kSampleGradDepth2dArrayF32: case ValidTextureOverload::kSampleCompareDepth2dArrayF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, float(4)), 3.0f))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, float(4)), 3.0f))";
case ValidTextureOverload::kSampleGradDepth2dArrayOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, float(4)), 3.0f, int2(5, 6)))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, float(4)), 3.0f, int2(5, 6)))";
case ValidTextureOverload::kSampleGradDepthCubeF32: case ValidTextureOverload::kSampleCompareDepthCubeF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))";
case ValidTextureOverload::kSampleGradDepthCubeArrayF32: case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture_tint_0.SampleCmp(sampler_tint_0, float4(1.0f, 2.0f, 3.0f, float(4)), 5.0f))"; return R"(texture_tint_0.SampleCmp(sampler_tint_0, float4(1.0f, 2.0f, 3.0f, float(4)), 5.0f))";
case ValidTextureOverload::kLoad1dF32: case ValidTextureOverload::kLoad1dF32:
return R"(texture_tint_0.Load(int2(1, 0)))"; return R"(texture_tint_0.Load(int2(1, 0)))";

View File

@ -163,17 +163,17 @@ std::string expected_texture_overload(
return R"(texture_tint_0.sample(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), gradientcube(float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f))))"; return R"(texture_tint_0.sample(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), gradientcube(float3(4.0f, 5.0f, 6.0f), float3(7.0f, 8.0f, 9.0f))))";
case ValidTextureOverload::kSampleGradCubeArrayF32: case ValidTextureOverload::kSampleGradCubeArrayF32:
return R"(texture_tint_0.sample(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4, gradientcube(float3(5.0f, 6.0f, 7.0f), float3(8.0f, 9.0f, 10.0f))))"; return R"(texture_tint_0.sample(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4, gradientcube(float3(5.0f, 6.0f, 7.0f), float3(8.0f, 9.0f, 10.0f))))";
case ValidTextureOverload::kSampleGradDepth2dF32: case ValidTextureOverload::kSampleCompareDepth2dF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 3.0f))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 3.0f))";
case ValidTextureOverload::kSampleGradDepth2dOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dOffsetF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 3.0f, int2(4, 5)))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 3.0f, int2(4, 5)))";
case ValidTextureOverload::kSampleGradDepth2dArrayF32: case ValidTextureOverload::kSampleCompareDepth2dArrayF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 4, 3.0f))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 4, 3.0f))";
case ValidTextureOverload::kSampleGradDepth2dArrayOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 4, 3.0f, int2(5, 6)))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float2(1.0f, 2.0f), 4, 3.0f, int2(5, 6)))";
case ValidTextureOverload::kSampleGradDepthCubeF32: case ValidTextureOverload::kSampleCompareDepthCubeF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4.0f))";
case ValidTextureOverload::kSampleGradDepthCubeArrayF32: case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4, 5.0f))"; return R"(texture_tint_0.sample_compare(sampler_tint_0, float3(1.0f, 2.0f, 3.0f), 4, 5.0f))";
case ValidTextureOverload::kLoad1dF32: case ValidTextureOverload::kLoad1dF32:
return R"(texture_tint_0.read(1))"; return R"(texture_tint_0.read(1))";

View File

@ -2144,7 +2144,7 @@ OpCapability SampledCubeArray
R"( R"(
OpCapability SampledCubeArray OpCapability SampledCubeArray
)"}; )"};
case ValidTextureOverload::kSampleGradDepth2dF32: case ValidTextureOverload::kSampleCompareDepth2dF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32
@ -2170,7 +2170,7 @@ OpCapability SampledCubeArray
)", )",
R"( R"(
)"}; )"};
case ValidTextureOverload::kSampleGradDepth2dOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dOffsetF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32
@ -2201,7 +2201,7 @@ OpCapability SampledCubeArray
)", )",
R"( R"(
)"}; )"};
case ValidTextureOverload::kSampleGradDepth2dArrayF32: case ValidTextureOverload::kSampleCompareDepth2dArrayF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32
@ -2230,7 +2230,7 @@ OpCapability SampledCubeArray
)", )",
R"( R"(
)"}; )"};
case ValidTextureOverload::kSampleGradDepth2dArrayOffsetF32: case ValidTextureOverload::kSampleCompareDepth2dArrayOffsetF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32
@ -2263,7 +2263,7 @@ OpCapability SampledCubeArray
)", )",
R"( R"(
)"}; )"};
case ValidTextureOverload::kSampleGradDepthCubeF32: case ValidTextureOverload::kSampleCompareDepthCubeF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32
@ -2290,7 +2290,7 @@ OpCapability SampledCubeArray
)", )",
R"( R"(
)"}; )"};
case ValidTextureOverload::kSampleGradDepthCubeArrayF32: case ValidTextureOverload::kSampleCompareDepthCubeArrayF32:
return { return {
R"( R"(
%4 = OpTypeFloat 32 %4 = OpTypeFloat 32