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