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>
This commit is contained in:
Stephen White 2021-10-28 19:24:48 +00:00 committed by Tint LUCI CQ
parent 2f17549702
commit 85a4282de6
2 changed files with 4 additions and 0 deletions

View File

@ -1914,6 +1914,9 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) {
out << " = outputs." << name << ";" << std::endl; 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; out << "}" << std::endl << std::endl;

View File

@ -292,6 +292,7 @@ void main() {
col1 = outputs.col1; col1 = outputs.col1;
col2 = outputs.col2; col2 = outputs.col2;
gl_Position = outputs.pos; gl_Position = outputs.pos;
gl_Position.y = -gl_Position.y;
} }