summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/formats.c
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: minor cosmeticswm42017-04-141-6/+10
|
* vo_opengl: don't crash on unsupported formatswm42017-02-171-1/+2
| | | | Regression from recent refactor.
* vo_opengl: hwdec_vaegl: use new format setup functionwm42017-02-171-1/+8
| | | | Plus add a helper.
* vo_opengl: hwdec_osx: use new format setup functionwm42017-02-171-2/+2
| | | | | | | | | | | | | | | | We can drop the custom table. For some reason, the interop does not accept GL_RGB_RAW_422_APPLE as internal format for GL_RGB_422_APPLE, so switch the format table to use GL_RGB (this way both interop and real textures work the same). Another victim of the apparent requirement of exactly matching texture formats is kCVPixelFormatType_32BGRA. vo_opengl wants to handle this as normal RGBA texture, with a swizzle applied in the shader. CGLTexImageIOSurface2D() rejects this, because it wants the exact internal format. Just drop the format, because it's useless anyway. (Maybe this is a bit too fragile...)
* vo_opengl: move texture mapping of pixel formats to helper functionwm42017-02-171-0/+140
| | | | | | | All supported pixel formats have a specific "mapping" of CPU data to textures. This function determines the number and the formats of these textures. Moving it to a helper will be useful for some hardware decode interop backends, since they all need similar things.
* vo_opengl: handle GL_LUMINANCE_ALPHA and integer textures differentlywm42017-02-171-0/+5
| | | | | | | | | | | | | | | 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.
* vo_opengl: make ES float texture format checks stricterwm42016-05-231-3/+1
| | | | | | | | | | | | | | | Some of these checks became pointless after dropping ES 2.0 support for extended filtering. GL_EXT_texture_rg is part of core in ES 3.0, and we already check for this version, so testing for the extension is redundant. GL_OES_texture_half_float_linear is also always available, at least as far as our needs go. The functionality we need from GL_EXT_color_buffer_half_float is always available in ES 3.2, and we explicitly check for ES 3.2, so reject this extension if the ES version is new enough.
* vo_opengl: require at least ES 3.0 for float textureswm42016-05-191-1/+1
| | | | | | | | | | | | ES 2.0 has this weird rule that not the internalformat parameter determines the internal format, but the combination of all texture parameters. GL_OES_texture_half_float thus does not specify e.g. a GL_RGBA16F format, but requires passing GL_RGBA as format and GL_HALF_FLOAT_OES as type. We won't bother with this, since ES 2.0 is a lost cause anyway. This also removes the OpenGL error when the code is trying to create a f16 FBO for testing whether FBOs work.
* vo_opengl: restrict ES2 FBO formatswm42016-05-131-4/+4
| | | | | | | | | Only a few very low bit depth internal formats can be rendered to in pure ES2 (GL_RGB565 is the "best" one). Seems like the only potentially reasonable renderable formats in ES2 could be provided via GL_OES_rgb8_rgba8, or half-floats, so don't bother with this at all.
* vo_opengl: reorganize texture format handlingwm42016-05-121-0/+274
This merges all knowledge about texture format into a central table. Most of the work done here is actually identifying which formats exactly are supported by OpenGL(ES) under which circumstances, and keeping this information in the format table in a somewhat declarative way. (Although only to the extend needed by mpv.) In particular, ES and float formats are a horrible mess. Again this is a big refactor that might cause regression on "obscure" configurations.