diff options
Diffstat (limited to 'video/out/vo_direct3d.c')
-rw-r--r-- | video/out/vo_direct3d.c | 18 |
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} |