diff options
Diffstat (limited to 'debian/patches/85-gl-Add-function-to-bind-a-4x4-float-matrix-shader-un.patch')
-rw-r--r-- | debian/patches/85-gl-Add-function-to-bind-a-4x4-float-matrix-shader-un.patch | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/debian/patches/85-gl-Add-function-to-bind-a-4x4-float-matrix-shader-un.patch b/debian/patches/85-gl-Add-function-to-bind-a-4x4-float-matrix-shader-un.patch new file mode 100644 index 0000000..e22284a --- /dev/null +++ b/debian/patches/85-gl-Add-function-to-bind-a-4x4-float-matrix-shader-un.patch @@ -0,0 +1,92 @@ +From 5381425d07518c8c8772766fa74e7374649f9b8b Mon Sep 17 00:00:00 2001 +From: Alexandros Frantzis <alexandros.frantzis@linaro.org> +Date: Mon, 31 Jan 2011 16:18:29 +0200 +Subject: [PATCH 05/16] gl: Add function to bind a 4x4 float matrix shader + uniform + +Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> +(cherry picked from commit b13198348ce053445ca97b513611207e34aa4528) + +Signed-off-by: Cyril Brulebois <kibi@debian.org> +--- + src/cairo-gl-private.h | 5 +++++ + src/cairo-gl-shaders.c | 26 ++++++++++++++++++++++++++ + 2 files changed, 31 insertions(+), 0 deletions(-) + +diff --git a/src/cairo-gl-private.h b/src/cairo-gl-private.h +index 04322f2..3dd75f8 100644 +--- a/src/cairo-gl-private.h ++++ b/src/cairo-gl-private.h +@@ -523,6 +523,11 @@ _cairo_gl_shader_bind_matrix (cairo_gl_context_t *ctx, + cairo_matrix_t* m); + + cairo_private void ++_cairo_gl_shader_bind_matrix4f (cairo_gl_context_t *ctx, ++ const char *name, ++ GLfloat* gl_m); ++ ++cairo_private void + _cairo_gl_shader_bind_texture (cairo_gl_context_t *ctx, + const char *name, + GLuint tex_unit); +diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c +index a39883d..1b10b04 100644 +--- a/src/cairo-gl-shaders.c ++++ b/src/cairo-gl-shaders.c +@@ -93,6 +93,12 @@ typedef struct cairo_gl_shader_impl { + cairo_matrix_t* m); + + void ++ (*bind_matrix4f) (cairo_gl_context_t *ctx, ++ cairo_gl_shader_t *shader, ++ const char *name, ++ GLfloat* gl_m); ++ ++ void + (*bind_texture) (cairo_gl_context_t *ctx, + cairo_gl_shader_t *shader, + const char *name, +@@ -263,6 +269,18 @@ bind_matrix_core_2_0 (cairo_gl_context_t *ctx, + } + + static void ++bind_matrix4f_core_2_0 (cairo_gl_context_t *ctx, ++ cairo_gl_shader_t *shader, ++ const char *name, ++ GLfloat* gl_m) ++{ ++ cairo_gl_dispatch_t *dispatch = &ctx->dispatch; ++ GLint location = dispatch->GetUniformLocation (shader->program, name); ++ assert (location != -1); ++ dispatch->UniformMatrix4fv (location, 1, GL_FALSE, gl_m); ++} ++ ++static void + bind_texture_core_2_0 (cairo_gl_context_t *ctx, cairo_gl_shader_t *shader, + const char *name, cairo_gl_tex_t tex_unit) + { +@@ -292,6 +310,7 @@ static const cairo_gl_shader_impl_t shader_impl_core_2_0 = { + bind_vec3_core_2_0, + bind_vec4_core_2_0, + bind_matrix_core_2_0, ++ bind_matrix4f_core_2_0, + bind_texture_core_2_0, + use_program_core_2_0, + }; +@@ -798,6 +817,13 @@ _cairo_gl_shader_bind_matrix (cairo_gl_context_t *ctx, + } + + void ++_cairo_gl_shader_bind_matrix4f (cairo_gl_context_t *ctx, ++ const char *name, GLfloat* gl_m) ++{ ++ ctx->shader_impl->bind_matrix4f (ctx, ctx->current_shader, name, gl_m); ++} ++ ++void + _cairo_gl_shader_bind_texture (cairo_gl_context_t *ctx, + const char *name, GLuint tex_unit) + { +-- +1.7.5.4 + |