diff mbox

[6/9] gl: Use the GL core 2.0 shader implementation for both GL 1.x ARB and GL 2.x

Message ID 1311602713-6182-6-git-send-email-alexandros.frantzis@linaro.org
State Accepted
Headers show

Commit Message

alexandros.frantzis@linaro.org July 25, 2011, 2:05 p.m. UTC
From: Alexandros Frantzis <alexandros.frantzis@linaro.org>

The GL core 2.0 shader implementation can be used by both GL 1.x and 2.x
thanks to the dispatch table.
---
 src/cairo-gl-shaders.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 06e3c62..909b681 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -543,12 +543,11 @@  _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
     cairo_status_t status;
 
     /* XXX multiple device support? */
-    if (GLEW_VERSION_2_0) {
+    if (GLEW_VERSION_2_0 ||
+	(GLEW_ARB_shader_objects &&
+	 GLEW_ARB_fragment_shader &&
+	 GLEW_ARB_vertex_program)) {
         ctx->shader_impl = &shader_impl_core_2_0;
-    } else if (GLEW_ARB_shader_objects &&
-               GLEW_ARB_fragment_shader &&
-               GLEW_ARB_vertex_program) {
-        ctx->shader_impl = &shader_impl_arb;
     } else {
         ctx->shader_impl = NULL;
     }