summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-18 16:30:24 +0100
committerwm4 <wm4@nowhere>2014-11-18 16:30:32 +0100
commitb8ac594af0cb2c0bfbf9a6f8b4571cf308a69a0f (patch)
tree983b241ceb7527a0a4e1d10989d30cf3f9f6ed86 /video
parentcaf2fbf68896c36b4c4d20d3fd37327b5187dc01 (diff)
downloadmpv-b8ac594af0cb2c0bfbf9a6f8b4571cf308a69a0f.tar.bz2
mpv-b8ac594af0cb2c0bfbf9a6f8b4571cf308a69a0f.tar.xz
vo_direct3d: fix texture-memory sub-option, extend it
This sub-option was turned into a flag when the sub-option parser was changed to the generic one (probably accidentally). Turn it into a proper choice-option. Also, adjust what the options do. Though none of this probably makes much sense; the default should work, and if it doesn't, the GPU/driver is probably beyond help.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_direct3d.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/video/out/vo_direct3d.c b/video/out/vo_direct3d.c
index 88575c4e7a..cecb4be6a8 100644
--- a/video/out/vo_direct3d.c
+++ b/video/out/vo_direct3d.c
@@ -83,7 +83,7 @@ struct d3dtex {
// D3DPOOL_DEFAULT texture:
// - can't be locked (Probably.)
// - must be used for rendering
- // This will be NULL on systems with device_texture_sys != 0.
+ // This can be NULL if the system one can be both locked and mapped.
IDirect3DTexture9 *device;
};
@@ -352,10 +352,13 @@ static bool d3dtex_allocate(d3d_priv *priv, struct d3dtex *tex, D3DFORMAT fmt,
int tw = w, th = h;
d3d_fix_texture_size(priv, &tw, &th);
+ bool use_sh = !priv->device_texture_sys;
int memtype = D3DPOOL_SYSTEMMEM;
switch (priv->opt_texture_memory) {
- case 1: memtype = D3DPOOL_MANAGED; break;
- case 2: memtype = D3DPOOL_DEFAULT; break;
+ case 1: memtype = D3DPOOL_MANAGED; use_sh = false; break;
+ case 2: memtype = D3DPOOL_DEFAULT; use_sh = false; break;
+ case 3: memtype = D3DPOOL_DEFAULT; use_sh = true; break;
+ case 4: memtype = D3DPOOL_SCRATCH; use_sh = true; break;
}
if (FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, tw, th, 1,
@@ -365,7 +368,7 @@ static bool d3dtex_allocate(d3d_priv *priv, struct d3dtex *tex, D3DFORMAT fmt,
goto error_exit;
}
- if (!priv->device_texture_sys && !priv->opt_texture_memory) {
+ if (use_sh) {
if (FAILED(IDirect3DDevice9_CreateTexture(priv->d3d_device, tw, th, 1,
D3DUSAGE_DYNAMIC, fmt, D3DPOOL_DEFAULT, &tex->device, NULL)))
{
@@ -1728,7 +1731,12 @@ static const struct m_option opts[] = {
OPT_FLAG("only-8bit", opt_only_8bit, 0),
OPT_FLAG("force-power-of-2", opt_force_power_of_2, 0),
OPT_FLAG("disable-texture-align", opt_disable_texture_align, 0),
- OPT_FLAG("texture-memory", opt_texture_memory, 0),
+ OPT_CHOICE("texture-memory", opt_texture_memory, 0,
+ ({"default", 0},
+ {"managed", 1},
+ {"default-pool", 2},
+ {"default-pool-shadow", 3},
+ {"scratch", 4})),
OPT_FLAG("swap-discard", opt_swap_discard, 0),
OPT_FLAG("exact-backbuffer", opt_exact_backbuffer, 0),
{0}