[gtk+] gl: Put shaders in static storage
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gl: Put shaders in static storage
- Date: Tue, 10 Feb 2015 03:34:56 +0000 (UTC)
commit 03f5d5a5e41bc42835dc02774a27a5eb5d4d023b
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Feb 10 03:33:02 2015 +0000
gl: Put shaders in static storage
We are not changing the shader code.
The compiler will hopefully put them in the .rodata section.
gdk/gdkgl.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index e497ccc..1d7d2d4 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -146,7 +146,7 @@ bind_vao (GdkGLContextPaintData *paint_data)
static void
use_texture_2d_program (GdkGLContextPaintData *paint_data)
{
- const char *vertex_shader_code =
+ static const char *vertex_shader_code =
"#version 150\n"
"uniform sampler2D map;"
"attribute vec2 position;\n"
@@ -156,7 +156,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n"
"}\n";
- const char *fragment_shader_code =
+ static const char *fragment_shader_code =
"#version 150\n"
"varying vec2 vUv;\n"
"uniform sampler2D map;\n"
@@ -177,7 +177,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
static void
use_texture_rect_program (GdkGLContextPaintData *paint_data)
{
- const char *vertex_shader_code =
+ static const char *vertex_shader_code =
"#version 150\n"
"uniform sampler2DRect map;"
"attribute vec2 position;\n"
@@ -187,7 +187,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
" gl_Position = vec4(position, 0, 1);\n"
" vUv = uv;\n"
"}\n";
- const char *fragment_shader_code =
+ static const char *fragment_shader_code =
"#version 150\n"
"varying vec2 vUv;\n"
"uniform sampler2DRect map;\n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]