summaryrefslogtreecommitdiff
path: root/src/uterm_drm3d_render.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-03-15 14:52:05 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-11-03 12:12:29 +0100
commit0a098393c2fe7e40a02b44481194534ad2572d70 (patch)
treea913ff1e50aaf2ef2ac4aed705cc57bc6f4c355d /src/uterm_drm3d_render.c
parent924a732e7cf26c571f29ff97ba7e8089c7db54c0 (diff)
shl: shader: add "len" parameter to shader sources
Shader sources may not be 0 terminated if we mmap() them. Hence, we need to pass the length to the shader compiler. As glShaderSource() allows this <0 as zero-terminated strings, we can simply add a parameter for the shader length. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src/uterm_drm3d_render.c')
-rw-r--r--src/uterm_drm3d_render.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/uterm_drm3d_render.c b/src/uterm_drm3d_render.c
index c7a213d..698d199 100644
--- a/src/uterm_drm3d_render.c
+++ b/src/uterm_drm3d_render.c
@@ -76,16 +76,17 @@ static int init_shaders(struct uterm_video *video)
v3d->sinit = 1;
- ret = gl_shader_new(&v3d->fill_shader, gl_static_fill_vert,
- gl_static_fill_frag, fill_attr, 2, log_llog, NULL);
+ ret = gl_shader_new(&v3d->fill_shader, gl_static_fill_vert, -1,
+ gl_static_fill_frag, -1, fill_attr, 2, log_llog,
+ NULL);
if (ret)
return ret;
v3d->uni_fill_proj = gl_shader_get_uniform(v3d->fill_shader,
"projection");
- ret = gl_shader_new(&v3d->blend_shader, gl_static_blend_vert,
- gl_static_blend_frag, blend_attr, 2, log_llog,
+ ret = gl_shader_new(&v3d->blend_shader, gl_static_blend_vert, -1,
+ gl_static_blend_frag, -1, blend_attr, 2, log_llog,
NULL);
if (ret)
return ret;
@@ -99,8 +100,9 @@ static int init_shaders(struct uterm_video *video)
v3d->uni_blend_bgcol = gl_shader_get_uniform(v3d->blend_shader,
"bgcolor");
- ret = gl_shader_new(&v3d->blit_shader, gl_static_blit_vert,
- gl_static_blit_frag, blit_attr, 2, log_llog, NULL);
+ ret = gl_shader_new(&v3d->blit_shader, gl_static_blit_vert, -1,
+ gl_static_blit_frag, -1, blit_attr, 2, log_llog,
+ NULL);
if (ret)
return ret;