From 9cae45e6ca83bb7ea15e6e102e62931b088f620b Mon Sep 17 00:00:00 2001 From: James Price Date: Thu, 24 Jun 2021 08:20:46 +0000 Subject: [PATCH] writer/wgsl: Remove builtin unit test This test is invalid for multiple reasons (wrong types, wrong stages, global variable instead of a parameter). The shader IO E2E tests give better coverage for this anyway, so just delete the unit test. Change-Id: I1627addf1e407e473e33043341d742958ceebca5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/55861 Auto-Submit: James Price Kokoro: Kokoro Commit-Queue: Ben Clayton Reviewed-by: Ben Clayton --- src/writer/wgsl/generator_impl_test.cc | 42 -------------------------- 1 file changed, 42 deletions(-) diff --git a/src/writer/wgsl/generator_impl_test.cc b/src/writer/wgsl/generator_impl_test.cc index 985bf51e1c..18f2991a1f 100644 --- a/src/writer/wgsl/generator_impl_test.cc +++ b/src/writer/wgsl/generator_impl_test.cc @@ -34,48 +34,6 @@ TEST_F(WgslGeneratorImplTest, Generate) { )"); } -struct WgslBuiltinData { - ast::Builtin builtin; - const char* attribute_name; -}; -inline std::ostream& operator<<(std::ostream& out, WgslBuiltinData data) { - out << data.builtin; - return out; -} -using WgslBuiltinConversionTest = TestParamHelper; -TEST_P(WgslBuiltinConversionTest, Emit) { - auto params = GetParam(); - - auto* var = Global("a", ty.f32(), ast::StorageClass::kPrivate, nullptr, - ast::DecorationList{ - Builtin(params.builtin), - }); - - GeneratorImpl& gen = Build(); - - gen.EmitDecorations(var->decorations()); - - EXPECT_EQ(gen.result(), - "[[builtin(" + std::string(params.attribute_name) + ")]]"); -} -INSTANTIATE_TEST_SUITE_P( - WgslGeneratorImplTest, - WgslBuiltinConversionTest, - testing::Values( - WgslBuiltinData{ast::Builtin::kPosition, "position"}, - WgslBuiltinData{ast::Builtin::kVertexIndex, "vertex_index"}, - WgslBuiltinData{ast::Builtin::kInstanceIndex, "instance_index"}, - WgslBuiltinData{ast::Builtin::kFrontFacing, "front_facing"}, - WgslBuiltinData{ast::Builtin::kFragDepth, "frag_depth"}, - WgslBuiltinData{ast::Builtin::kLocalInvocationId, - "local_invocation_id"}, - WgslBuiltinData{ast::Builtin::kLocalInvocationIndex, - "local_invocation_index"}, - WgslBuiltinData{ast::Builtin::kGlobalInvocationId, - "global_invocation_id"}, - WgslBuiltinData{ast::Builtin::kWorkgroupId, "workgroup_id"}, - WgslBuiltinData{ast::Builtin::kSampleIndex, "sample_index"})); - } // namespace } // namespace wgsl } // namespace writer