commit | b1d2b84f7dcbe753f625c17885866233732e3148 | [log] [tgz] |
---|---|---|
author | Stephen White <senorblanco@chromium.org> | Wed Jan 26 14:45:55 2022 +0000 |
committer | Tint LUCI CQ <tint-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Jan 26 14:45:55 2022 +0000 |
tree | ede40cd1e1a4cf3d565f782785f73bc5d7d827b9 | |
parent | 520bccf8d8bac1d51ecb2391d06ec2c1f31a9613 [diff] [blame] |
GLSL: fix clip space mismatch in gl_Position. OpenGL clips against [-w, w], while WebGPU uses [0, w]. The fix is to modify gl_Position.z on output to match GLSL semantics. (This is the same code used by SPIRV-Cross under the fixup_clipspace option.) Bug: tint:1401 Change-Id: I1b1511352eee11cd9b095cd809aa8e1263c6cf4c Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78261 Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/test/intrinsics/gen/modf/180fed.wgsl.expected.glsl b/test/intrinsics/gen/modf/180fed.wgsl.expected.glsl index 24c591a..efa2621 100644 --- a/test/intrinsics/gen/modf/180fed.wgsl.expected.glsl +++ b/test/intrinsics/gen/modf/180fed.wgsl.expected.glsl
@@ -38,6 +38,7 @@ tint_symbol outputs; outputs = vertex_main(); gl_Position = outputs.value; + gl_Position.z = 2.0 * gl_Position.z - gl_Position.w; gl_Position.y = -gl_Position.y; }