hlsl/writer: Validate texture intrinsics with DXC

Change-Id: I4cb8f9a700842e43facbd83cd9af24a00a74658f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42023
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
Ben Clayton 2021-02-19 12:45:45 +00:00 committed by Commit Bot service account
parent 53d057c572
commit 3bb3116bdf
1 changed files with 12 additions and 1 deletions

View File

@ -15,7 +15,9 @@
#include <memory> #include <memory>
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "src/ast/call_statement.h"
#include "src/ast/intrinsic_texture_helper_test.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/depth_texture_type.h"
#include "src/type/multisampled_texture_type.h" #include "src/type/multisampled_texture_type.h"
#include "src/type/sampled_texture_type.h" #include "src/type/sampled_texture_type.h"
@ -439,7 +441,14 @@ TEST_P(HlslGeneratorIntrinsicTextureTest, Call) {
param.buildSamplerVariable(this); param.buildSamplerVariable(this);
auto* call = Call(param.function, param.args(this)); auto* call = Call(param.function, param.args(this));
WrapInFunction(call);
Func("main", ast::VariableList{}, ty.void_(),
ast::StatementList{
create<ast::CallStatement>(call),
},
ast::FunctionDecorationList{
create<ast::StageDecoration>(ast::PipelineStage::kFragment),
});
GeneratorImpl& gen = Build(); GeneratorImpl& gen = Build();
@ -449,6 +458,8 @@ TEST_P(HlslGeneratorIntrinsicTextureTest, Call) {
EXPECT_EQ(expected.pre, pre_result()); EXPECT_EQ(expected.pre, pre_result());
EXPECT_EQ(expected.out, result()); EXPECT_EQ(expected.out, result());
Validate();
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_TEST_SUITE_P(