summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/utils.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-29 20:14:48 +0200
committerwm4 <wm4@nowhere>2017-07-29 20:14:48 +0200
commit8494fdadaeb25b3c1a42c71559be5bd74d1d4638 (patch)
treeda93683844c45e1fec754c68dc19c99d167562f2 /video/out/opengl/utils.c
parent0f9fcf0ed4ecb54eaadbddd3cbbc14d39ab93227 (diff)
downloadmpv-8494fdadaeb25b3c1a42c71559be5bd74d1d4638.tar.bz2
mpv-8494fdadaeb25b3c1a42c71559be5bd74d1d4638.tar.xz
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.
Diffstat (limited to 'video/out/opengl/utils.c')
-rw-r--r--video/out/opengl/utils.c12
1 files changed, 12 insertions, 0 deletions
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) {