mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
Add want_mipmap function parameter to d3d_texture_new
This commit is contained in:
parent
4ead2df09e
commit
c4d3ea6f8d
@ -467,11 +467,16 @@ LPDIRECT3DTEXTURE d3d_texture_new(LPDIRECT3DDEVICE dev,
|
||||
unsigned miplevels, unsigned usage, D3DFORMAT format,
|
||||
D3DPOOL pool, unsigned filter, unsigned mipfilter,
|
||||
D3DCOLOR color_key, void *src_info_data,
|
||||
PALETTEENTRY *palette)
|
||||
PALETTEENTRY *palette, bool want_mipmap)
|
||||
{
|
||||
HRESULT hr;
|
||||
LPDIRECT3DTEXTURE buf;
|
||||
|
||||
#ifdef HAVE_D3D9
|
||||
if (want_mipmap)
|
||||
usage |= D3DUSAGE_AUTOGENMIPMAP;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_D3DX
|
||||
if (path)
|
||||
return d3d_texture_new_from_file(dev,
|
||||
|
@ -52,7 +52,7 @@ LPDIRECT3DTEXTURE d3d_texture_new(LPDIRECT3DDEVICE dev,
|
||||
unsigned miplevels, unsigned usage, D3DFORMAT format,
|
||||
D3DPOOL pool, unsigned filter, unsigned mipfilter,
|
||||
D3DCOLOR color_key, void *src_info,
|
||||
PALETTEENTRY *palette);
|
||||
PALETTEENTRY *palette, bool want_mipmap);
|
||||
|
||||
void d3d_set_stream_source(LPDIRECT3DDEVICE dev, unsigned stream_no,
|
||||
void *stream_vertbuf, unsigned offset_bytes,
|
||||
|
@ -212,7 +212,6 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info)
|
||||
|
||||
static bool d3d_init_singlepass(d3d_video_t *d3d)
|
||||
{
|
||||
#ifndef _XBOX
|
||||
struct video_shader_pass *pass = NULL;
|
||||
|
||||
if (!d3d)
|
||||
@ -233,7 +232,6 @@ static bool d3d_init_singlepass(d3d_video_t *d3d)
|
||||
if (!string_is_empty(d3d->shader_path))
|
||||
strlcpy(pass->source.path, d3d->shader_path,
|
||||
sizeof(pass->source.path));
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1381,7 +1379,7 @@ static bool d3d_overlay_load(void *data,
|
||||
0,
|
||||
D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_MANAGED, 0, 0, 0,
|
||||
NULL, NULL);
|
||||
NULL, NULL, false);
|
||||
|
||||
if (!overlay->tex)
|
||||
{
|
||||
@ -1640,7 +1638,7 @@ static void d3d_set_menu_texture_frame(void *data,
|
||||
d3d->menu->tex = d3d_texture_new(d3d->dev, NULL,
|
||||
width, height, 1,
|
||||
0, D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL);
|
||||
D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL, false);
|
||||
|
||||
if (!d3d->menu->tex)
|
||||
{
|
||||
@ -1718,18 +1716,19 @@ static void video_texture_load_d3d(d3d_video_t *d3d,
|
||||
{
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
LPDIRECT3DTEXTURE tex = NULL;
|
||||
unsigned usage = 0;
|
||||
unsigned usage = 0;
|
||||
bool want_mipmap = false;
|
||||
|
||||
#ifndef HAVE_D3D8
|
||||
if((filter_type == TEXTURE_FILTER_MIPMAP_LINEAR) ||
|
||||
(filter_type == TEXTURE_FILTER_MIPMAP_NEAREST))
|
||||
usage |= D3DUSAGE_AUTOGENMIPMAP;
|
||||
want_mipmap = true;
|
||||
#endif
|
||||
|
||||
tex = d3d_texture_new(d3d->dev, NULL,
|
||||
ti->width, ti->height, 0,
|
||||
usage, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0, 0, 0,
|
||||
NULL, NULL);
|
||||
NULL, NULL, want_mipmap);
|
||||
|
||||
if (!tex)
|
||||
{
|
||||
|
@ -80,7 +80,8 @@ static bool d3d8_renderchain_create_first_pass(void *data,
|
||||
#else
|
||||
D3DFMT_X8R8G8B8 : D3DFMT_R5G6B5,
|
||||
#endif
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
0, 0, 0, 0, NULL, NULL,
|
||||
false);
|
||||
|
||||
if (!chain->tex)
|
||||
return false;
|
||||
|
@ -865,7 +865,7 @@ static bool d3d9_cg_renderchain_create_first_pass(
|
||||
chain->prev.tex[i] = d3d_texture_new(chain->dev, NULL,
|
||||
info->tex_w, info->tex_h, 1, 0,
|
||||
(fmt == RETRO_PIXEL_FORMAT_RGB565) ? D3DFMT_R5G6B5 : D3DFMT_X8R8G8B8,
|
||||
D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL);
|
||||
D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL, false);
|
||||
|
||||
if (!chain->prev.tex[i])
|
||||
return false;
|
||||
@ -947,7 +947,7 @@ static bool d3d9_cg_renderchain_set_pass_size(
|
||||
chain->passes->data[chain->passes->count - 1].info.pass->fbo.fp_fbo ?
|
||||
D3DFMT_A32B32G32R32F : D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_DEFAULT, 0, 0, 0,
|
||||
NULL, NULL);
|
||||
NULL, NULL, false);
|
||||
|
||||
if (!pass->tex)
|
||||
return false;
|
||||
@ -1104,7 +1104,7 @@ static bool d3d9_cg_renderchain_add_pass(
|
||||
D3DUSAGE_RENDERTARGET,
|
||||
chain->passes->data[chain->passes->count - 1].info.pass->fbo.fp_fbo
|
||||
? D3DFMT_A32B32G32R32F : D3DFMT_A8R8G8B8,
|
||||
D3DPOOL_DEFAULT, 0, 0, 0, NULL, NULL);
|
||||
D3DPOOL_DEFAULT, 0, 0, 0, NULL, NULL, false);
|
||||
|
||||
if (!pass.tex)
|
||||
return false;
|
||||
@ -1138,7 +1138,8 @@ static bool d3d9_cg_renderchain_add_lut(void *data,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL
|
||||
NULL,
|
||||
false
|
||||
);
|
||||
|
||||
RARCH_LOG("[D3D]: LUT texture loaded: %s.\n", path);
|
||||
|
@ -109,7 +109,7 @@ static bool hlsl_d3d9_renderchain_create_first_pass(void *data,
|
||||
#else
|
||||
info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_R5G6B5,
|
||||
#endif
|
||||
0, 0, 0, 0, NULL, NULL);
|
||||
0, 0, 0, 0, NULL, NULL, false);
|
||||
|
||||
if (!chain->tex)
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user