From 8494fdadaeb25b3c1a42c71559be5bd74d1d4638 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 29 Jul 2017 20:14:48 +0200 Subject: vo_opengl: manage dither texture via ra Also add some more helpers. Fix the broken math.h include statement. utils.c uses ra_gl.h internals, which it shouldn't, and which will be removed again as soon as this code gets converted to ra fully. --- video/out/opengl/utils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'video/out/opengl/utils.c') diff --git a/video/out/opengl/utils.c b/video/out/opengl/utils.c index 8c52b61cba..024b8d4bbe 100644 --- a/video/out/opengl/utils.c +++ b/video/out/opengl/utils.c @@ -33,6 +33,7 @@ #include "options/path.h" #include "stream/stream.h" #include "formats.h" +#include "ra_gl.h" #include "utils.h" // GLU has this as gluErrorString (we don't use GLU, as it is legacy-OpenGL) @@ -746,6 +747,17 @@ void gl_sc_uniform_tex_ui(struct gl_shader_cache *sc, char *name, GLuint texture u->tex_handle = texture; } +void gl_sc_uniform_texture(struct gl_shader_cache *sc, char *name, + struct ra_tex *tex) +{ + struct ra_tex_gl *tex_gl = tex->priv; + if (tex->params.format->ctype == RA_CTYPE_UINT) { + gl_sc_uniform_tex_ui(sc, name, tex_gl->texture); + } else { + gl_sc_uniform_tex(sc, name, tex_gl->target, tex_gl->texture); + } +} + static const char *mp_image2D_type(GLenum access) { switch (access) { -- cgit v1.2.3