From 3bb3116bdf3f3f467447330a5fbcd88053d83eaa Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 19 Feb 2021 12:45:45 +0000 Subject: [PATCH] hlsl/writer: Validate texture intrinsics with DXC Change-Id: I4cb8f9a700842e43facbd83cd9af24a00a74658f Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42023 Commit-Queue: Ben Clayton Reviewed-by: dan sinclair --- .../hlsl/generator_impl_intrinsic_texture_test.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc index b9ddb0f2b2..35aed1f9c4 100644 --- a/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc +++ b/src/writer/hlsl/generator_impl_intrinsic_texture_test.cc @@ -15,7 +15,9 @@ #include #include "gtest/gtest.h" +#include "src/ast/call_statement.h" #include "src/ast/intrinsic_texture_helper_test.h" +#include "src/ast/stage_decoration.h" #include "src/type/depth_texture_type.h" #include "src/type/multisampled_texture_type.h" #include "src/type/sampled_texture_type.h" @@ -439,7 +441,14 @@ TEST_P(HlslGeneratorIntrinsicTextureTest, Call) { param.buildSamplerVariable(this); auto* call = Call(param.function, param.args(this)); - WrapInFunction(call); + + Func("main", ast::VariableList{}, ty.void_(), + ast::StatementList{ + create(call), + }, + ast::FunctionDecorationList{ + create(ast::PipelineStage::kFragment), + }); GeneratorImpl& gen = Build(); @@ -449,6 +458,8 @@ TEST_P(HlslGeneratorIntrinsicTextureTest, Call) { EXPECT_EQ(expected.pre, pre_result()); EXPECT_EQ(expected.out, result()); + + Validate(); } INSTANTIATE_TEST_SUITE_P(