summaryrefslogtreecommitdiff
path: root/debian/patches/81-gl-Fail-if-GL-implementation-doesn-t-support-shaders.patch
blob: bcc4223559ac2aa07a7bf49c81ec45caaab1a30c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From d9124cb697d5f0f40a49ce53339a199f2b92ecc9 Mon Sep 17 00:00:00 2001
From: Alexandros Frantzis <alexandros.frantzis@linaro.org>
Date: Fri, 28 Jan 2011 15:02:52 +0200
Subject: [PATCH 01/16] gl: Fail if GL implementation doesn't support shaders

The non-shaders implementation was never tuned for fixed-function GL
implementation, the maintainers are not interested in supporting it,
and the hardware is rather rare at this point.  This lets us focus on
the implementation for modern hardware, which needs plenty of work
still.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 037c9ba7e27bdd33a4fefa43dad68ce0d25e35ad)

Signed-off-by: Cyril Brulebois <kibi@debian.org>
---
 src/cairo-gl-shaders.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
index 2b31bfc..6a42fd1 100644
--- a/src/cairo-gl-shaders.c
+++ b/src/cairo-gl-shaders.c
@@ -359,9 +359,15 @@ _cairo_gl_context_init_shaders (cairo_gl_context_t *ctx)
 	(_cairo_gl_has_extension ("GL_ARB_shader_objects") &&
 	 _cairo_gl_has_extension ("GL_ARB_fragment_shader") &&
 	 _cairo_gl_has_extension ("GL_ARB_vertex_shader")))
+    {
 	ctx->shader_impl = &shader_impl_core_2_0;
+    }
     else
+    {
 	ctx->shader_impl = NULL;
+	fprintf (stderr, "Error: The cairo gl backend requires shader support!\n");
+	return CAIRO_STATUS_DEVICE_ERROR;
+    }
 
     memset (ctx->vertex_shaders, 0, sizeof (ctx->vertex_shaders));
 
-- 
1.7.5.4