summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-17 14:58:49 +0100
committerwm4 <wm4@nowhere>2016-03-17 14:58:49 +0100
commit0d19316de2c743388e8b2fae7e238f7d4db1ab1f (patch)
treeb04b0000b0400ca50f0dd98bb2d2cbd7b9fd69ca
parent45db7d52a982482c168b8fc2ee05ecc58237e7dc (diff)
downloadmpv-0d19316de2c743388e8b2fae7e238f7d4db1ab1f.tar.bz2
mpv-0d19316de2c743388e8b2fae7e238f7d4db1ab1f.tar.xz
vo_opengl: dxva2egl: ignore alpha component in the mapped video
converted_imgfmt will be used by the renderer logic to build an appropriate shader chain. It doesn't influence the format of any textures. Thus it doesn't matter whether the hw video surface is mapped as RGB or RGBA. What matters is if the video actually contains alpha or not. Since virtually all hardware decoder do not support alpha in any way, this can be hardcoded as "no alpha". This avoids unnecessary GPU work.
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index f2c15145ef..eed942618c 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -202,9 +202,7 @@ static int create(struct gl_hwdec *hw)
goto fail;
}
- hw->converted_imgfmt = p->alpha ? IMGFMT_RGBA : IMGFMT_RGB0;
- MP_VERBOSE(hw, "Using image format %s\n",
- mp_imgfmt_to_name(hw->converted_imgfmt));
+ hw->converted_imgfmt = IMGFMT_RGB0;
p->ctx.d3d9_device = (IDirect3DDevice9 *)p->device9ex;
p->ctx.hwctx.type = HWDEC_DXVA2;