summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-30 18:07:30 +0200
committerwm4 <wm4@nowhere>2017-06-30 18:13:01 +0200
commit2aff6f8c95b416a8da767c4ee2449b6d86d1d3b0 (patch)
tree9f343a68404ce497563c67e9bf4d8e9058635aa3
parent1ad036a2ef068928640eeda7352e5e70379e2119 (diff)
downloadmpv-2aff6f8c95b416a8da767c4ee2449b6d86d1d3b0.tar.bz2
mpv-2aff6f8c95b416a8da767c4ee2449b6d86d1d3b0.tar.xz
vo_direct3d: remove non-working nv12 shader support
It never worked. It relied on some obscure texture format to provide the equivalent of GL_RG or GL_LUMINANCE_ALPHA, but no hardware seemed to report support for it ever. No idea what's the correct way to do this. On D3D11 it exists, of course. (Actually I'd like to remove the whole VO.)
-rw-r--r--video/fmt-conversion.c2
-rw-r--r--video/img_format.h3
-rw-r--r--video/out/d3d_shader_nv12.h123
-rw-r--r--video/out/vo_direct3d.c11
4 files changed, 0 insertions, 139 deletions
diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c
index d691445146..6d14c28c7a 100644
--- a/video/fmt-conversion.c
+++ b/video/fmt-conversion.c
@@ -36,8 +36,6 @@ static const struct {
{IMGFMT_UYVY, AV_PIX_FMT_UYVY422},
{IMGFMT_NV12, AV_PIX_FMT_NV12},
{IMGFMT_Y8, AV_PIX_FMT_GRAY8},
- // FFmpeg prefers AV_PIX_FMT_GRAY8A, but Libav has only Y400A
- {IMGFMT_YA8, AV_PIX_FMT_Y400A},
{IMGFMT_Y16, AV_PIX_FMT_GRAY16},
{IMGFMT_420P, AV_PIX_FMT_YUV420P},
{IMGFMT_444P, AV_PIX_FMT_YUV444P},
diff --git a/video/img_format.h b/video/img_format.h
index 8567c8aa96..b6f5b9b2fa 100644
--- a/video/img_format.h
+++ b/video/img_format.h
@@ -148,9 +148,6 @@ enum mp_imgfmt {
IMGFMT_Y8,
IMGFMT_Y16,
- // Gray with alpha (packed)
- IMGFMT_YA8,
-
// Packed YUV formats (components are byte-accessed)
IMGFMT_UYVY, // U Y0 V Y1
diff --git a/video/out/d3d_shader_nv12.h b/video/out/d3d_shader_nv12.h
deleted file mode 100644
index 74b592fa04..0000000000
--- a/video/out/d3d_shader_nv12.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
-//
-// fxc /Tps_2_0 -DUSE_NV12=1 /Fhd3d_shader_nv12.h d3d_shader_yuv.hlsl
-// /Vnd3d_shader_nv12
-//
-//
-// Parameters:
-//
-// float4x4 colormatrix;
-// sampler2D tex0;
-// sampler2D tex1;
-//
-//
-// Registers:
-//
-// Name Reg Size
-// ------------ ----- ----
-// colormatrix c0 4
-// tex0 s0 1
-// tex1 s1 1
-//
-
- ps_2_0
- def c4, 1, 0, 0, 0
- dcl t0.xy
- dcl t1.xy
- dcl_2d s0
- dcl_2d s1
- texld r0, t0, s0
- texld r1, t1, s1
- mov r0.y, r1.x
- mov r0.z, r1.z
- mov r0.w, c4.x
- dp4 r1.x, r0, c0
- dp4 r1.y, r0, c1
- dp4 r1.z, r0, c2
- dp4 r1.w, r0, c3
- mov oC0, r1
-
-// approximately 10 instruction slots used (2 texture, 8 arithmetic)
-#endif
-
-const BYTE d3d_shader_nv12[] =
-{
- 0, 2, 255, 255, 254, 255,
- 56, 0, 67, 84, 65, 66,
- 28, 0, 0, 0, 171, 0,
- 0, 0, 0, 2, 255, 255,
- 3, 0, 0, 0, 28, 0,
- 0, 0, 0, 1, 0, 0,
- 164, 0, 0, 0, 88, 0,
- 0, 0, 2, 0, 0, 0,
- 4, 0, 2, 0, 100, 0,
- 0, 0, 0, 0, 0, 0,
- 116, 0, 0, 0, 3, 0,
- 0, 0, 1, 0, 2, 0,
- 124, 0, 0, 0, 0, 0,
- 0, 0, 140, 0, 0, 0,
- 3, 0, 1, 0, 1, 0,
- 6, 0, 148, 0, 0, 0,
- 0, 0, 0, 0, 99, 111,
- 108, 111, 114, 109, 97, 116,
- 114, 105, 120, 0, 3, 0,
- 3, 0, 4, 0, 4, 0,
- 1, 0, 0, 0, 0, 0,
- 0, 0, 116, 101, 120, 48,
- 0, 171, 171, 171, 4, 0,
- 12, 0, 1, 0, 1, 0,
- 1, 0, 0, 0, 0, 0,
- 0, 0, 116, 101, 120, 49,
- 0, 171, 171, 171, 4, 0,
- 12, 0, 1, 0, 1, 0,
- 1, 0, 0, 0, 0, 0,
- 0, 0, 112, 115, 95, 50,
- 95, 48, 0, 77, 105, 99,
- 114, 111, 115, 111, 102, 116,
- 32, 40, 82, 41, 32, 72,
- 76, 83, 76, 32, 83, 104,
- 97, 100, 101, 114, 32, 67,
- 111, 109, 112, 105, 108, 101,
- 114, 32, 57, 46, 50, 57,
- 46, 57, 53, 50, 46, 51,
- 49, 49, 49, 0, 81, 0,
- 0, 5, 4, 0, 15, 160,
- 0, 0, 128, 63, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 31, 0,
- 0, 2, 0, 0, 0, 128,
- 0, 0, 3, 176, 31, 0,
- 0, 2, 0, 0, 0, 128,
- 1, 0, 3, 176, 31, 0,
- 0, 2, 0, 0, 0, 144,
- 0, 8, 15, 160, 31, 0,
- 0, 2, 0, 0, 0, 144,
- 1, 8, 15, 160, 66, 0,
- 0, 3, 0, 0, 15, 128,
- 0, 0, 228, 176, 0, 8,
- 228, 160, 66, 0, 0, 3,
- 1, 0, 15, 128, 1, 0,
- 228, 176, 1, 8, 228, 160,
- 1, 0, 0, 2, 0, 0,
- 2, 128, 1, 0, 0, 128,
- 1, 0, 0, 2, 0, 0,
- 4, 128, 1, 0, 170, 128,
- 1, 0, 0, 2, 0, 0,
- 8, 128, 4, 0, 0, 160,
- 9, 0, 0, 3, 1, 0,
- 1, 128, 0, 0, 228, 128,
- 0, 0, 228, 160, 9, 0,
- 0, 3, 1, 0, 2, 128,
- 0, 0, 228, 128, 1, 0,
- 228, 160, 9, 0, 0, 3,
- 1, 0, 4, 128, 0, 0,
- 228, 128, 2, 0, 228, 160,
- 9, 0, 0, 3, 1, 0,
- 8, 128, 0, 0, 228, 128,
- 3, 0, 228, 160, 1, 0,
- 0, 2, 0, 8, 15, 128,
- 1, 0, 228, 128, 255, 255,
- 0, 0
-};
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 9980a833c7..e18cf8e4e0 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -42,7 +42,6 @@
// shaders generated by fxc.exe from d3d_shader_yuv.hlsl
#include "d3d_shader_420p.h"
-#include "d3d_shader_nv12.h"
#define IMGFMT_IS_Y(x) ((x) == IMGFMT_Y8 || (x) == IMGFMT_Y16)
#define IMGFMT_Y_DEPTH(x) ((x) == IMGFMT_Y8 ? 8 : 16)
@@ -110,7 +109,6 @@ struct osdpart {
enum shaders {
SHADER_NONE = 0,
SHADER_420P,
- SHADER_NV12,
NUM_SHADERS
};
@@ -216,8 +214,6 @@ static const struct fmt_entry fmt_table[] = {
// grayscale (can be considered both packed and planar)
{IMGFMT_Y8, D3DFMT_L8},
{IMGFMT_Y16, D3DFMT_L16},
- // 2 channels (needed for NV12 shader)
- {IMGFMT_YA8, D3DFMT_A8L8},
{0},
};
@@ -747,7 +743,6 @@ static bool change_d3d_backbuffer(d3d_priv *priv)
const DWORD* shaders[NUM_SHADERS] = {
[SHADER_420P] = (DWORD *)d3d_shader_420p,
- [SHADER_NV12] = (DWORD *)d3d_shader_nv12,
};
for (int n = 0; n < NUM_SHADERS; n++) {
@@ -1055,12 +1050,6 @@ static int check_shader_conversion(d3d_priv *priv, uint32_t fmt,
return SHADER_420P;
}
}
- if (fmt == IMGFMT_NV12) {
- shader_d3dfmts[0] = check_format(priv, IMGFMT_Y8, true);
- shader_d3dfmts[1] = check_format(priv, IMGFMT_YA8, true);
- if (shader_d3dfmts[0] && shader_d3dfmts[1])
- return SHADER_NV12;
- }
return 0;
}