From 282a1e6288f6dfde7a5481fa43d350f755104452 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 24 Jul 2020 20:31:07 -0400 Subject: [PATCH] glsl: don't lower to mediump for desktop OpenGL Desktop OpenGL ignores all precision qualifiers. Also, the lowering pass doesn't work if precision qualifiers are not set, which is only possible with desktop OpenGL, causing random behavior. Reviewed-by: Rob Clark Part-of: --- src/compiler/glsl/glsl_parser_extras.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp index e9130d16d25..cb206e32a49 100644 --- a/src/compiler/glsl/glsl_parser_extras.cpp +++ b/src/compiler/glsl/glsl_parser_extras.cpp @@ -2249,7 +2249,8 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader, &ctx->Const.ShaderCompilerOptions[shader->Stage]; if (!state->error && !shader->ir->is_empty()) { - if (options->LowerPrecisionFloat16 || options->LowerPrecisionInt16) + if (state->es_shader && + (options->LowerPrecisionFloat16 || options->LowerPrecisionInt16)) lower_precision(options, shader->ir); lower_builtins(shader->ir); assign_subroutine_indexes(state); -- 2.30.2