[gtk/wip/chergert/glproto] wire up attributes and shared uniforms
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] wire up attributes and shared uniforms
- Date: Thu, 14 Jan 2021 17:15:00 +0000 (UTC)
commit 8444df725599baacc52bea47bd99cf35475af83c
Author: Christian Hergert <chergert redhat com>
Date: Thu Jan 14 09:14:44 2021 -0800
wire up attributes and shared uniforms
gsk/next/gskgldriver.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/gsk/next/gskgldriver.c b/gsk/next/gskgldriver.c
index 1b287c48d8..8ef7e28c5b 100644
--- a/gsk/next/gskgldriver.c
+++ b/gsk/next/gskgldriver.c
@@ -895,8 +895,20 @@ gsk_next_driver_lookup_shader (GskNextDriver *self,
"/org/gtk/libgsk/glsl/preamble.fs.glsl");
gsk_gl_compiler_set_suffix (compiler, GSK_GL_COMPILER_FRAGMENT, suffix);
+ /* Setup attributes that are provided via VBO */
+ gsk_gl_compiler_bind_attribute (compiler, "aPosition", 0);
+ gsk_gl_compiler_bind_attribute (compiler, "aUv", 1);
+
if ((program = gsk_gl_compiler_compile (compiler, NULL, error)))
{
+ gsk_gl_program_add_uniform (program, "u_source", UNIFORM_SHARED_SOURCE);
+ gsk_gl_program_add_uniform (program, "u_clip_rect", UNIFORM_SHARED_CLIP_RECT);
+ gsk_gl_program_add_uniform (program, "u_viewport", UNIFORM_SHARED_VIEWPORT);
+ gsk_gl_program_add_uniform (program, "u_projection", UNIFORM_SHARED_PROJECTION);
+ gsk_gl_program_add_uniform (program, "u_modelview", UNIFORM_SHARED_MODELVIEW);
+ if (gsk_gl_program_add_uniform (program, "u_alpha", UNIFORM_SHARED_ALPHA))
+ gsk_gl_program_set_uniform1f (program, UNIFORM_SHARED_ALPHA, 1.0f);
+
gsk_gl_program_add_uniform (program, "u_size", UNIFORM_CUSTOM_SIZE);
gsk_gl_program_add_uniform (program, "u_texture1", UNIFORM_CUSTOM_TEXTURE1);
gsk_gl_program_add_uniform (program, "u_texture2", UNIFORM_CUSTOM_TEXTURE2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]