resolver: Reenable VS validation for returning position

Fixed: tint:730
Change-Id: I7d5ebeffe2d522182d07f554a671bebab1cce2e6
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54420
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
Ben Clayton
2021-06-16 09:50:11 +00:00
committed by Ben Clayton
parent 7e00263c01
commit 677437d650
8 changed files with 56 additions and 30 deletions

View File

@@ -530,9 +530,7 @@ TEST_F(ResolverEntryPointValidationTest, Parameter_Struct_DuplicateLocation) {
12:34 note: while analysing entry point main)");
}
// TODO(bclayton): Reenable after CTS is updated
TEST_F(ResolverEntryPointValidationTest,
DISABLED_VertexShaderMustReturnPosition) {
TEST_F(ResolverEntryPointValidationTest, VertexShaderMustReturnPosition) {
// [[stage(vertex)]]
// fn main() {}
Func(Source{{12, 34}}, "main", {}, ty.void_(), {},

View File

@@ -1119,8 +1119,7 @@ bool Resolver::ValidateEntryPoint(const ast::Function* func,
}
}
}
// TODO(bclayton): Reenable after CTS is updated
if (((false)) && !found) {
if (!found) {
diagnostics_.add_error(
"a vertex shader must include the 'position' builtin in its return "
"type",

View File

@@ -103,7 +103,8 @@ fn main() {
TEST_F(SingleEntryPointTest, MultipleEntryPoints) {
auto* src = R"(
[[stage(vertex)]]
fn vert_main() {
fn vert_main() -> [[builtin(position)]] vec4<f32> {
return vec4<f32>();
}
[[stage(fragment)]]
@@ -145,8 +146,9 @@ var<private> c : f32;
var<private> d : f32;
[[stage(vertex)]]
fn vert_main() {
fn vert_main() -> [[builtin(position)]] vec4<f32> {
a = 0.0;
return vec4<f32>();
}
[[stage(fragment)]]
@@ -194,8 +196,9 @@ let c : f32 = 1.0;
let d : f32 = 1.0;
[[stage(vertex)]]
fn vert_main() {
fn vert_main() -> [[builtin(position)]] vec4<f32> {
let local_a : f32 = a;
return vec4<f32>();
}
[[stage(fragment)]]