From 0a098393c2fe7e40a02b44481194534ad2572d70 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 15 Mar 2013 14:52:05 +0100 Subject: 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 --- src/uterm_drm3d_render.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/uterm_drm3d_render.c') 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; -- cgit v1.2.3