summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-17 15:46:11 +0100
committerwm4 <wm4@nowhere>2017-02-17 16:28:31 +0100
commit9c54b224d8cdf05dcb1df73b6e8af1c868eca053 (patch)
treea6ca4c84a7a11af899b05e888d11cc1da18e3efb /video/out/opengl/hwdec.h
parentb5eb326dcb88a309f3b89dc7309f226f2488eb63 (diff)
downloadmpv-9c54b224d8cdf05dcb1df73b6e8af1c868eca053.tar.bz2
mpv-9c54b224d8cdf05dcb1df73b6e8af1c868eca053.tar.xz
vo_opengl: handle GL_LUMINANCE_ALPHA and integer textures differently
GL_LUMINANCE_ALPHA is the only reason why per-plane swizzles exist. Remove per-plane swizzles (again), and regrettably handle them as special cases (again). Carry along the logical texture format (called gl_format in some parts of the code, including the new one). We also don't need a use_integer flag, since the new gl_format member implies whether it's an integer texture. (Yes, the there are separate logical GL formats for integer textures. This aspect of the OpenGL API is hysteric at best.) This should change nothing about actual rendering logic and GL API usage.
Diffstat (limited to 'video/out/opengl/hwdec.h')
-rw-r--r--video/out/opengl/hwdec.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/opengl/hwdec.h b/video/out/opengl/hwdec.h
index 948b42bc74..962bd7b1bd 100644
--- a/video/out/opengl/hwdec.h
+++ b/video/out/opengl/hwdec.h
@@ -23,13 +23,16 @@ struct gl_hwdec {
struct gl_hwdec_plane {
GLuint gl_texture;
GLenum gl_target;
+ // Like struct gl_format.format (GL_RED etc.). Currently to detect
+ // GL_LUMINANCE_ALPHA and integer formats - can be left to 0 otherwise.
+ GLenum gl_format;
int tex_w, tex_h; // allocated texture size
- char swizzle[5]; // component order (if length is 0, use defaults)
};
struct gl_hwdec_frame {
struct gl_hwdec_plane planes[4];
bool vdpau_fields;
+ char swizzle[5]; // optional component swizzle (4 components if set)
};
struct gl_hwdec_driver {