wgsl: Implement invariant attribute

Make sure the other backends ICE on unrecognized attributes.

Add E2E tests, currently skipped for the other backends.

Bug: tint:772
Change-Id: I4e68d111ff79b19ebb6c574058a91debcb746011
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/57642
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
James Price
2021-07-12 12:28:52 +00:00
committed by Tint LUCI CQ
parent 508d2491d0
commit fcc0de0b86
15 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
[[stage(vertex)]]
fn main() -> [[builtin(position), invariant]] vec4<f32> {
return vec4<f32>();
}

View File

@@ -0,0 +1,10 @@
SKIP: FAILED
../../src/writer/hlsl/generator_impl.cc:3056 internal compiler error: unhandled struct member attribute: invariant
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************

View File

@@ -0,0 +1,10 @@
SKIP: FAILED
../../src/writer/msl/generator_impl.cc:1990 internal compiler error: unhandled struct member attribute: invariant
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************

View File

@@ -0,0 +1,9 @@
SKIP: FAILED
[[stage(vertex)]]
fn main() -> [[builtin(position), invariant]] vec4<f32> {
return vec4<f32>();
}
Failed to generate: unknown decoration

View File

@@ -0,0 +1,4 @@
[[stage(vertex)]]
fn main() -> [[builtin(position), invariant]] vec4<f32> {
return vec4<f32>();
}

View File

@@ -0,0 +1,8 @@
struct Out {
[[builtin(position), invariant]] pos : vec4<f32>;
};
[[stage(vertex)]]
fn main() -> Out {
return Out();
}

View File

@@ -0,0 +1,10 @@
SKIP: FAILED
../../src/writer/hlsl/generator_impl.cc:3056 internal compiler error: unhandled struct member attribute: invariant
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************

View File

@@ -0,0 +1,10 @@
SKIP: FAILED
../../src/writer/msl/generator_impl.cc:1990 internal compiler error: unhandled struct member attribute: invariant
********************************************************************
* The tint shader compiler has encountered an unexpected error. *
* *
* Please help us fix this issue by submitting a bug report at *
* crbug.com/tint with the source program that triggered the bug. *
********************************************************************

View File

@@ -0,0 +1,14 @@
SKIP: FAILED
struct Out {
[[builtin(position), invariant]]
pos : vec4<f32>;
};
[[stage(vertex)]]
fn main() -> Out {
return Out();
}
Failed to generate: unknown decoration

View File

@@ -0,0 +1,9 @@
struct Out {
[[builtin(position), invariant]]
pos : vec4<f32>;
};
[[stage(vertex)]]
fn main() -> Out {
return Out();
}