[spirv-writer] Support optional trailing return.

This CL updates the SPIRV-Writer to inject an OpReturn as the trailing
statement in a function if the function does not end with a `discard` or
a `return` statement.

R=bclayton@google.com, dneto@google.com

Fixes: tint:302
Change-Id: I2e7c7beff15ad30c779c591bb75cf97fc0960bf7
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/33160
Reviewed-by: David Neto <dneto@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
This commit is contained in:
dan sinclair
2020-11-18 18:25:30 +00:00
committed by Commit Bot service account
parent 46d9c7745e
commit a7c9391dc6
11 changed files with 130 additions and 17 deletions

View File

@@ -19,5 +19,4 @@ fn main() -> f32 {
[[stage(compute)]]
[[workgroup_size(2)]]
fn ep() -> void {
return;
}