From eaa85796c732018e4bbd517bded4a0b837e0ed44 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 20 Nov 2020 10:25:54 +0000 Subject: [PATCH] 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 Reviewed-by: dan sinclair --- src/ast/intrinsic_texture_helper_test.cc | 4 ++-- .../spirv/builder_intrinsic_texture_test.cc | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ast/intrinsic_texture_helper_test.cc b/src/ast/intrinsic_texture_helper_test.cc index 5e1587ccaf..b1bd426f3e 100644 --- a/src/ast/intrinsic_texture_helper_test.cc +++ b/src/ast/intrinsic_texture_helper_test.cc @@ -320,7 +320,7 @@ std::vector TextureOverloadCase::ValidCases() { using f32 = ast::Builder::f32; return b->ExprList("texture", // t "sampler", // s - b->vec2(1.f, 2.f, 3.f)); // coords + b->vec3(1.f, 2.f, 3.f)); // coords }, }, { @@ -338,7 +338,7 @@ std::vector TextureOverloadCase::ValidCases() { using f32 = ast::Builder::f32; return b->ExprList("texture", // t "sampler", // s - b->vec2(1.f, 2.f, 3.f), // coords + b->vec3(1.f, 2.f, 3.f), // coords 4u); // array_index }, }, diff --git a/src/writer/spirv/builder_intrinsic_texture_test.cc b/src/writer/spirv/builder_intrinsic_texture_test.cc index a3ed58f6fc..a6771919d3 100644 --- a/src/writer/spirv/builder_intrinsic_texture_test.cc +++ b/src/writer/spirv/builder_intrinsic_texture_test.cc @@ -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 {