diff options
author | wm4 <wm4@nowhere> | 2017-02-17 17:20:33 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-17 17:26:01 +0100 |
commit | d8bf000d29a5868636cbb16aef007b9487d123e2 (patch) | |
tree | e5ca9fe5fe518c1c8e6fe46819c205f6372d3103 /video/out/opengl/formats.c | |
parent | e59e917e71d6e2220f5a6f751f604516ab3e6008 (diff) | |
download | mpv-d8bf000d29a5868636cbb16aef007b9487d123e2.tar.bz2 mpv-d8bf000d29a5868636cbb16aef007b9487d123e2.tar.xz |
vo_opengl: hwdec_vaegl: use new format setup function
Plus add a helper.
Diffstat (limited to 'video/out/opengl/formats.c')
-rw-r--r-- | video/out/opengl/formats.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/video/out/opengl/formats.c b/video/out/opengl/formats.c index 45cb96f8cb..9bdc7828e5 100644 --- a/video/out/opengl/formats.c +++ b/video/out/opengl/formats.c @@ -303,7 +303,14 @@ int gl_bytes_per_pixel(GLenum format, GLenum type) case GL_UNSIGNED_SHORT_8_8_REV_APPLE: return 2; } - return gl_format_components(format) * gl_component_size(type); + return gl_component_size(type) * gl_format_components(format); +} + +// The format has cleanly separated components (on byte boundaries). +bool gl_format_is_regular(const struct gl_format *fmt) +{ + int bpp = gl_component_size(fmt->type) * gl_format_components(fmt->format); + return bpp == gl_bytes_per_pixel(fmt->format, fmt->type); } // dest = src.<w> (always using 4 components) |