[gtk/wip/chergert/gdk-macos-for-master: 1/2] gl: specify attribute locations for vUv and aPosition




commit 6883c2214b557aa758afb922ecde250c55707b20
Author: Christian Hergert <chergert redhat com>
Date:   Fri Dec 4 13:33:34 2020 -0800

    gl: specify attribute locations for vUv and aPosition
    
    These positions are not guaranteed to be in a specific order when linked
    into the final GPU program. They need to be specified so that our code
    in gskglrenderer.c can use known positions for them to match up with
    our GskQuadVertex.
    
    This fixes the GL renderer on macOS's OpenGL shader compiler.
    
    Fixes #3420

 gsk/gl/gskglshaderbuilder.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gsk/gl/gskglshaderbuilder.c b/gsk/gl/gskglshaderbuilder.c
index d3b2a8351c..1a4ddc301b 100644
--- a/gsk/gl/gskglshaderbuilder.c
+++ b/gsk/gl/gskglshaderbuilder.c
@@ -229,6 +229,8 @@ gsk_gl_shader_builder_create_program (GskGLShaderBuilder  *self,
   program_id = glCreateProgram ();
   glAttachShader (program_id, vertex_id);
   glAttachShader (program_id, fragment_id);
+  glBindAttribLocation (program_id, 0, "aPosition");
+  glBindAttribLocation (program_id, 1, "vUv");
   glLinkProgram (program_id);
 
   glGetProgramiv (program_id, GL_LINK_STATUS, &status);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]