[cairo] [PATCH] Manually transpose the matrix in _cairo_gl_shader_bind_matrix()

Bryce Harrington bryce at osg.samsung.com
Mon May 18 15:05:18 PDT 2015


On Fri, May 08, 2015 at 04:57:15PM +0000, Henry (Yu) Song wrote:
> That is right.  It is also fixed in our fork
> 
> https://github.com/SRA-SiliconValley/cairogles.git, checkout evasgl branch.
 
Thanks, LGTM.  Applied:
   8b798c3..f52f0e2  master -> master

Documentation on the UniformMatrix3fv routine:
   https://sourcegraph.com/github.com/go-qml/qml/.GoPackage/github.com/go-qml/qml/gl/4.2core/.def/GL/UniformMatrix3fv

Bryce

> ________________________________________
> From: cairo [cairo-bounces at cairographics.org] on behalf of Zan Dobersek [zan at falconsigh.net]
> Sent: Friday, May 08, 2015 1:50 AM
> To: cairo at cairographics.org
> Subject: [cairo] [PATCH] Manually transpose the matrix in       _cairo_gl_shader_bind_matrix()
> 
> From: Zan Dobersek <zdobersek at igalia.com>
> 
> To maintain compatibility with OpenGL ES 2.0, the matrix in
> _cairo_gl_shader_bind_matrix() should be manually transposed,
> and GL_FALSE passed as the transpose argument to the
> glUniformMatrix3fv() call as it is the only valid value for
> that parameter in OpenGL ES 2.0.
> ---
>  src/cairo-gl-shaders.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/cairo-gl-shaders.c b/src/cairo-gl-shaders.c
> index 2710606..fe975d2 100644
> --- a/src/cairo-gl-shaders.c
> +++ b/src/cairo-gl-shaders.c
> @@ -973,12 +973,12 @@ _cairo_gl_shader_bind_matrix (cairo_gl_context_t *ctx,
>  {
>      cairo_gl_dispatch_t *dispatch = &ctx->dispatch;
>      float gl_m[9] = {
> -       m->xx, m->xy, m->x0,
> -       m->yx, m->yy, m->y0,
> -       0,     0,     1
> +       m->xx, m->yx, 0,
> +       m->xy, m->yy, 0,
> +       m->x0, m->y0, 1
>      };
>      assert (location != -1);
> -    dispatch->UniformMatrix3fv (location, 1, GL_TRUE, gl_m);
> +    dispatch->UniformMatrix3fv (location, 1, GL_FALSE, gl_m);
>  }
> 
>  void
> --
> 2.1.4
> 
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
> -- 
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list