summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
Diffstat (limited to 'libvo')
-rw-r--r--libvo/video_out.c2
-rw-r--r--libvo/vo_direct3d.c52
2 files changed, 44 insertions, 10 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 95ab8977dd..f821723242 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -102,6 +102,7 @@ extern struct vo_driver video_out_caca;
extern struct vo_driver video_out_mpegpes;
extern struct vo_driver video_out_yuv4mpeg;
extern struct vo_driver video_out_direct3d;
+extern struct vo_driver video_out_direct3d_shaders;
extern struct vo_driver video_out_directx;
extern struct vo_driver video_out_kva;
extern struct vo_driver video_out_dxr3;
@@ -130,6 +131,7 @@ const struct vo_driver *video_out_drivers[] =
#endif
#ifdef CONFIG_DIRECT3D
&video_out_direct3d,
+ &video_out_direct3d_shaders,
#endif
#ifdef CONFIG_DIRECTX
&video_out_directx,
diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c
index c7529dadd0..619fa09fdc 100644
--- a/libvo/vo_direct3d.c
+++ b/libvo/vo_direct3d.c
@@ -49,13 +49,6 @@
// shaders generated by fxc.exe from d3d_shader_yuv.hlsl
#include "d3d_shader_yuv.h"
-static const vo_info_t info =
-{
- "Direct3D 9 Renderer",
- "direct3d",
- "Georgi Petrov (gogothebee) <gogothebee@gmail.com> and others",
- ""
-};
// TODO: beg someone to add this (there is already IMGFMT_Y8)
// equals MAKEFOURCC('Y', '1', '6', ' ')
@@ -1278,7 +1271,7 @@ const char *options_help_text = "-vo direct3d command line help:\n"
* @return 0 on success, -1 on failure
*/
-static int preinit(struct vo *vo, const char *arg)
+static int preinit_internal(struct vo *vo, const char *arg, bool allow_shaders)
{
D3DDISPLAYMODE disp_mode;
D3DCAPS9 disp_caps;
@@ -1295,6 +1288,10 @@ static int preinit(struct vo *vo, const char *arg)
.video_eq = { MP_CSP_EQ_CAPS_COLORMATRIX },
};
+ if (!allow_shaders) {
+ priv->opt_disable_shaders = priv->opt_disable_textures = true;
+ }
+
int opt_force_power_of_2 = false;
const opt_t subopts[] = {
@@ -1402,6 +1399,16 @@ err_out:
return -1;
}
+static int preinit_standard(struct vo *vo, const char *arg)
+{
+ return preinit_internal(vo, arg, false);
+}
+
+static int preinit_shaders(struct vo *vo, const char *arg)
+{
+ return preinit_internal(vo, arg, true);
+}
+
/** @brief libvo Callback: Handle control requests.
* @return VO_TRUE on success, VO_NOTIMPL when not implemented
*/
@@ -1957,10 +1964,35 @@ static void draw_eosd(d3d_priv *priv)
D3DRS_ALPHABLENDENABLE, FALSE);
}
+#define AUTHOR "Georgi Petrov (gogothebee) <gogothebee@gmail.com> and others"
+
const struct vo_driver video_out_direct3d = {
.is_new = true,
- .info = &info,
- .preinit = preinit,
+ .info = &(const vo_info_t) {
+ "Direct3D 9 Renderer",
+ "direct3d",
+ AUTHOR,
+ ""
+ },
+ .preinit = preinit_standard,
+ .config = config,
+ .control = control,
+ .draw_slice = draw_slice,
+ .draw_osd = draw_osd,
+ .flip_page = flip_page,
+ .check_events = check_events,
+ .uninit = uninit,
+};
+
+const struct vo_driver video_out_direct3d_shaders = {
+ .is_new = true,
+ .info = &(const vo_info_t) {
+ "Direct3D 9 Renderer (using shaders for YUV conversion)",
+ "direct3d_shaders",
+ AUTHOR,
+ ""
+ },
+ .preinit = preinit_shaders,
.config = config,
.control = control,
.draw_slice = draw_slice,