ast: Fix vector constructors in ValidCases()

A couple of the vector constructors were the wrong width.
Noticed when looking at the far-more-readable HLSL writer output.

Change-Id: Ibb383eafb55c5f743851aa4500adeda5909f0922
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33423
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2020-11-20 10:25:54 +00:00 committed by Commit Bot service account
parent 2da833d815
commit eaa85796c7
2 changed files with 11 additions and 10 deletions

View File

@ -320,7 +320,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
using f32 = ast::Builder::f32;
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1.f, 2.f, 3.f)); // coords
b->vec3<f32>(1.f, 2.f, 3.f)); // coords
},
},
{
@ -338,7 +338,7 @@ std::vector<TextureOverloadCase> TextureOverloadCase::ValidCases() {
using f32 = ast::Builder::f32;
return b->ExprList("texture", // t
"sampler", // s
b->vec2<f32>(1.f, 2.f, 3.f), // coords
b->vec3<f32>(1.f, 2.f, 3.f), // coords
4u); // array_index
},
},

View File

@ -431,7 +431,7 @@ expected_texture_overload_spirv expected_texture_overload(
%6 = OpTypePointer Private %7
%5 = OpVariable %6 Private
%11 = OpTypeSampledImage %3
%13 = OpTypeVector %4 2
%13 = OpTypeVector %4 3
%14 = OpConstant %4 1
%15 = OpConstant %4 2
%16 = OpConstant %4 3
@ -454,14 +454,14 @@ expected_texture_overload_spirv expected_texture_overload(
%6 = OpTypePointer Private %7
%5 = OpVariable %6 Private
%11 = OpTypeSampledImage %3
%13 = OpTypeVector %4 3
%14 = OpTypeVector %4 2
%13 = OpTypeVector %4 4
%14 = OpTypeVector %4 3
%15 = OpConstant %4 1
%16 = OpConstant %4 2
%17 = OpConstant %4 3
%18 = OpConstantComposite %14 %15 %16 %17
%22 = OpTypeInt 32 0
%23 = OpConstant %22 4
%23 = OpTypeInt 32 0
%24 = OpConstant %23 4
)",
R"(
%9 = OpLoad %7 %5
@ -469,9 +469,10 @@ expected_texture_overload_spirv expected_texture_overload(
%12 = OpSampledImage %11 %10 %9
%19 = OpCompositeExtract %4 %18 0
%20 = OpCompositeExtract %4 %18 1
%21 = OpConvertUToF %4 %23
%24 = OpCompositeConstruct %13 %19 %20 %21
%8 = OpImageSampleImplicitLod %4 %12 %24
%21 = OpCompositeExtract %4 %18 2
%22 = OpConvertUToF %4 %24
%25 = OpCompositeConstruct %13 %19 %20 %21 %22
%8 = OpImageSampleImplicitLod %4 %12 %25
)"};
case ValidTextureOverload::kSampleBias2dF32:
return {