Mesa (master): glsl/standalone: Use API_OPENGL_CORE if the GLSL version is >= 1.40

Ian Romanick idr at kemper.freedesktop.org
Tue Sep 27 19:07:02 UTC 2016


Module: Mesa
Branch: master
Commit: 798d1b8816fed0a88674c6d89d56e478519a5a55
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=798d1b8816fed0a88674c6d89d56e478519a5a55

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Sep 14 13:51:19 2016 -0700

glsl/standalone: Use API_OPENGL_CORE if the GLSL version is >= 1.40

Otherwise extensions to 1.40 that are only for core profile won't work.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/compiler/glsl/standalone.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/glsl/standalone.cpp b/src/compiler/glsl/standalone.cpp
index d6e6829..a7e6254 100644
--- a/src/compiler/glsl/standalone.cpp
+++ b/src/compiler/glsl/standalone.cpp
@@ -331,7 +331,11 @@ standalone_compile_shader(const struct standalone_options *_options,
       return NULL;
    }
 
-   initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL_COMPAT);
+   if (glsl_es) {
+      initialize_context(ctx, API_OPENGLES2);
+   } else {
+      initialize_context(ctx, options->glsl_version > 130 ? API_OPENGL_CORE : API_OPENGL_COMPAT);
+   }
 
    struct gl_shader_program *whole_program;
 




More information about the mesa-commit mailing list