diff --git a/src/writer/glsl/generator_impl.cc b/src/writer/glsl/generator_impl.cc index 80db771f28..0909adc12a 100644 --- a/src/writer/glsl/generator_impl.cc +++ b/src/writer/glsl/generator_impl.cc @@ -1914,6 +1914,9 @@ bool GeneratorImpl::EmitEntryPointFunction(const ast::Function* func) { 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 0cd8b97aa2..9f82acb94a 100644 --- a/src/writer/glsl/generator_impl_function_test.cc +++ b/src/writer/glsl/generator_impl_function_test.cc @@ -292,6 +292,7 @@ void main() { col1 = outputs.col1; col2 = outputs.col2; gl_Position = outputs.pos; + gl_Position.y = -gl_Position.y; }