commit | 85a4282de6669c70cf705fb91bb6466967755c19 | [log] [tgz] |
---|---|---|
author | Stephen White <senorblanco@chromium.org> | Thu Oct 28 19:24:48 2021 +0000 |
committer | Tint LUCI CQ <tint-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Oct 28 19:24:48 2021 +0000 |
tree | 915241b6fb1a1cf42f76dc7052deb1820bcc407d | |
parent | 2f17549702b5596689257b73a69a8a1d6d7c10b9 [diff] |
GLSL: perform Y flip in vertex shader. Change-Id: If7d038b4739f475bd26e0f7b3eaeec364df35ad5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/67860 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Commit-Queue: Stephen White <senorblanco@chromium.org>
diff --git a/src/writer/glsl/generator_impl.cc b/src/writer/glsl/generator_impl.cc index 80db771..0909adc 100644 --- a/src/writer/glsl/generator_impl.cc +++ b/src/writer/glsl/generator_impl.cc
@@ -1914,6 +1914,9 @@ out << " = outputs." << name << ";" << std::endl; } } + if (func->PipelineStage() == ast::PipelineStage::kVertex) { + out << " gl_Position.y = -gl_Position.y;" << std::endl; + } out << "}" << std::endl << std::endl;
diff --git a/src/writer/glsl/generator_impl_function_test.cc b/src/writer/glsl/generator_impl_function_test.cc index 0cd8b97..9f82acb 100644 --- a/src/writer/glsl/generator_impl_function_test.cc +++ b/src/writer/glsl/generator_impl_function_test.cc
@@ -292,6 +292,7 @@ col1 = outputs.col1; col2 = outputs.col2; gl_Position = outputs.pos; + gl_Position.y = -gl_Position.y; }