diff --git a/src/validator/validator_function_test.cc b/src/validator/validator_function_test.cc index eb212d91ce..137736934f 100644 --- a/src/validator/validator_function_test.cc +++ b/src/validator/validator_function_test.cc @@ -161,48 +161,6 @@ TEST_F(ValidateFunctionTest, FunctionNamesMustBeUnique_fail) { EXPECT_EQ(v.error(), "12:34 v-0016: function names must be unique 'func'"); } -TEST_F(ValidateFunctionTest, Function_WithPipelineStage_NotVoid_Fail) { - // [[stage(vertex)]] - // fn vtx_main() -> i32 { return 0; } - - Func(Source{Source::Location{12, 34}}, "vtx_main", ast::VariableList{}, - ty.i32(), - ast::StatementList{ - create(Expr(0)), - }, - ast::FunctionDecorationList{ - create(ast::PipelineStage::kVertex), - }); - - ValidatorImpl& v = Build(); - - EXPECT_FALSE(v.Validate()); - EXPECT_EQ(v.error(), - "12:34 v-0024: Entry point function must return void: 'vtx_main'"); -} - -TEST_F(ValidateFunctionTest, Function_WithPipelineStage_WithParams_Fail) { - // [[stage(vertex)]] - // fn vtx_func(a : i32) -> void { return; } - - Func(Source{Source::Location{12, 34}}, "vtx_func", - ast::VariableList{Var("a", ty.i32(), ast::StorageClass::kNone)}, - ty.void_(), - ast::StatementList{ - create(), - }, - ast::FunctionDecorationList{ - create(ast::PipelineStage::kVertex), - }); - - ValidatorImpl& v = Build(); - - EXPECT_FALSE(v.Validate()); - EXPECT_EQ(v.error(), - "12:34 v-0023: Entry point function must accept no parameters: " - "'vtx_func'"); -} - TEST_F(ValidateFunctionTest, PipelineStage_MustBeUnique_Fail) { // [[stage(fragment)]] // [[stage(vertex)]] diff --git a/src/validator/validator_impl.cc b/src/validator/validator_impl.cc index ec46aa6c61..a75dc9eab7 100644 --- a/src/validator/validator_impl.cc +++ b/src/validator/validator_impl.cc @@ -150,19 +150,6 @@ bool ValidatorImpl::ValidateEntryPoint(const ast::FunctionList& funcs) { for (auto* func : funcs) { if (func->IsEntryPoint()) { shader_is_present = true; - if (!func->params().empty()) { - add_error(func->source(), "v-0023", - "Entry point function must accept no parameters: '" + - program_->Symbols().NameFor(func->symbol()) + "'"); - return false; - } - - if (!func->return_type()->Is()) { - add_error(func->source(), "v-0024", - "Entry point function must return void: '" + - program_->Symbols().NameFor(func->symbol()) + "'"); - return false; - } auto stage_deco_count = 0; for (auto* deco : func->decorations()) { if (deco->Is()) {