summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-07-29 20:11:51 +0200
committerwm4 <wm4@nowhere>2017-07-29 20:11:51 +0200
commit6fcc09ff3d0db649ff7a8d9fdcb49c0d0b700905 (patch)
tree880e041838d984d1792b780f83a85f2c84cca729 /video/out/opengl/video.c
parent67cda60da08b17a2cdeca04bb7ae72106aa45462 (diff)
downloadmpv-6fcc09ff3d0db649ff7a8d9fdcb49c0d0b700905.tar.bz2
mpv-6fcc09ff3d0db649ff7a8d9fdcb49c0d0b700905.tar.xz
vo_opengl: use ra_* for format negotiation too
Format handling via ra_* was added earlier, but the format negotiation part was forgotten. Actually move some aspects of it to ra_get_imgfmt_desc(). Also make sure the unorm and float formats selected by the common format lookup functions are linear filterable. (For OpenGL, this is implicitly guaranteed, so it wasn't done before.) Whether these assumptions should be checked/enforced in the ra code at all is a bit fuzzy, but with ra being helper code only for the actual video renderer, it's probably justified.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r--video/out/opengl/video.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 1a55d8393d..ac8c9462ee 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -193,7 +193,6 @@ struct gl_video {
struct gl_lcms *cms;
bool gl_debug;
- int texture_16bit_depth; // actual bits available in 16 bit textures
int fb_depth; // actual bits available in GL main framebuffer
struct gl_shader_cache *sc;
@@ -3611,11 +3610,6 @@ static void init_gl(struct gl_video *p)
gl_video_set_gl_state(p);
- // Test whether we can use 10 bit.
- p->texture_16bit_depth = gl_determine_16bit_tex_depth(gl);
- if (p->texture_16bit_depth > 0)
- MP_VERBOSE(p, "16 bit texture depth: %d.\n", p->texture_16bit_depth);
-
p->upload_timer = gl_timer_create(gl);
p->blit_timer = gl_timer_create(gl);
@@ -3689,25 +3683,12 @@ bool gl_video_showing_interpolated_frame(struct gl_video *p)
}
static bool is_imgfmt_desc_supported(struct gl_video *p,
- const struct gl_imgfmt_desc *desc)
+ const struct ra_imgfmt_desc *desc)
{
if (!desc->num_planes)
return false;
- if (desc->component_bits > 8 && desc->component_bits < 16 &&
- desc->component_pad < 0 && p->texture_16bit_depth < 16)
- return false;
-
- int use_integer = -1;
- for (int n = 0; n < desc->num_planes; n++) {
- int use_int_plane = gl_is_integer_format(desc->planes[n]->format);
- if (use_integer < 0)
- use_integer = use_int_plane;
- if (use_integer != use_int_plane)
- return false; // mixed planes not supported
- }
-
- if (use_integer && p->forced_dumb_mode)
+ if (desc->planes[0]->ctype == RA_CTYPE_UINT && p->forced_dumb_mode)
return false;
return true;
@@ -3715,8 +3696,8 @@ static bool is_imgfmt_desc_supported(struct gl_video *p,
bool gl_video_check_format(struct gl_video *p, int mp_format)
{
- struct gl_imgfmt_desc desc;
- if (gl_get_imgfmt_desc(p->gl, mp_format, &desc) &&
+ struct ra_imgfmt_desc desc;
+ if (ra_get_imgfmt_desc(p->ra, mp_format, &desc) &&
is_imgfmt_desc_supported(p, &desc))
return true;
if (p->hwdec && gl_hwdec_test_format(p->hwdec, mp_format))