From 0ebc82fb851d01a6d7f1fc74a4be6612bc575bb4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 14 Nov 2017 12:56:34 +0200 Subject: [PATCH] Fix shader version declaration when minor version is zero --- source/programcompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 6b8eb6e6..697ec219 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -231,9 +231,9 @@ void ProgramCompiler::Formatter::apply(ProgramSyntax::Stage &s) GLApi api = get_gl_api(); const Version &ver = s.required_version; - if(ver.major) + if(ver) { - formatted += format("#version %d%d", ver.major, ver.minor); + formatted += format("#version %d%02d", ver.major, ver.minor); if(api==OPENGL_ES2 && ver>=Version(3, 0)) formatted += " es"; formatted += '\n'; -- 2.45.2