GlslWriter: Handle OpenGL ES precision qualifier

This commit is contained in:
Jérôme Leclercq
2020-07-08 22:52:33 +02:00
parent b076a517c6
commit cd01facd01
2 changed files with 11 additions and 2 deletions

View File

@@ -98,6 +98,16 @@ namespace Nz
AppendLine();
}
if (m_environment.glES)
{
AppendLine("#if GL_FRAGMENT_PRECISION_HIGH");
AppendLine("precision highp float;");
AppendLine("#else");
AppendLine("precision mediump float;");
AppendLine("#endif");
AppendLine();
}
// Global variables (uniforms, input and outputs)
const char* inKeyword = (glslVersion >= 130) ? "in" : "varying";
const char* outKeyword = (glslVersion >= 130) ? "out" : "varying";