wined3d: Get rid of legacy mipmap autogeneration support.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2018-02-13 01:00:44 +01:00 committed by Alexandre Julliard
parent c7ebc8ec32
commit 9a13d48e4e
10 changed files with 14 additions and 88 deletions

View File

@ -3250,7 +3250,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device *i
{
hr = wined3d_check_device_format(wined3d, params.adapter_idx, params.device_type,
WINED3DFMT_UNKNOWN, flag_mapping[i].usage, flag_mapping[i].rtype, wined3d_format);
if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DOK_NOAUTOGEN)
if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DOK_NOMIPGEN)
continue;
if (hr != WINED3D_OK)
{

View File

@ -334,7 +334,7 @@ static inline unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int
static inline DWORD wined3dusage_from_d3dusage(unsigned int usage)
{
return usage & WINED3DUSAGE_MASK & ~WINED3DUSAGE_AUTOGENMIPMAP;
return usage & WINED3DUSAGE_MASK;
}
#endif /* __WINE_D3D9_PRIVATE_H */

View File

@ -270,9 +270,6 @@ static const struct wined3d_extension_map gl_extension_map[] =
{"GL_NV_vertex_program2", NV_VERTEX_PROGRAM2 },
{"GL_NV_vertex_program2_option", NV_VERTEX_PROGRAM2_OPTION },
{"GL_NV_vertex_program3", NV_VERTEX_PROGRAM3 },
/* SGI */
{"GL_SGIS_generate_mipmap", SGIS_GENERATE_MIPMAP },
};
static const struct wined3d_extension_map wgl_extension_map[] =
@ -5338,12 +5335,12 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
gl_type = gl_type_end = WINED3D_GL_RES_TYPE_RB;
break;
}
allowed_usage |= WINED3DUSAGE_AUTOGENMIPMAP
| WINED3DUSAGE_DYNAMIC
allowed_usage |= WINED3DUSAGE_DYNAMIC
| WINED3DUSAGE_LEGACY_CUBEMAP
| WINED3DUSAGE_SOFTWAREPROCESSING
| WINED3DUSAGE_TEXTURE
| WINED3DUSAGE_QUERY_FILTER
| WINED3DUSAGE_QUERY_GENMIPMAP
| WINED3DUSAGE_QUERY_LEGACYBUMPMAP
| WINED3DUSAGE_QUERY_SRGBREAD
| WINED3DUSAGE_QUERY_SRGBWRITE
@ -5443,10 +5440,10 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
mipmap_gen_supported = FALSE;
}
if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && !mipmap_gen_supported)
if ((usage & WINED3DUSAGE_QUERY_GENMIPMAP) && !mipmap_gen_supported)
{
TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n");
return WINED3DOK_NOAUTOGEN;
return WINED3DOK_NOMIPGEN;
}
return WINED3D_OK;
@ -5619,7 +5616,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte
WINED3DCAPS2_FULLSCREENGAMMA |
WINED3DCAPS2_DYNAMICTEXTURES;
if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] || gl_info->supported[EXT_FRAMEBUFFER_OBJECT])
caps->Caps2 |= WINED3DCAPS2_CANAUTOGENMIPMAP;
caps->Caps2 |= WINED3DCAPS2_CANGENMIPMAP;
caps->Caps3 = WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD |
WINED3DCAPS3_COPY_TO_VIDMEM |

View File

@ -34,7 +34,6 @@ static void resource_check_usage(DWORD usage)
| WINED3DUSAGE_DEPTHSTENCIL
| WINED3DUSAGE_WRITEONLY
| WINED3DUSAGE_DYNAMIC
| WINED3DUSAGE_AUTOGENMIPMAP
| WINED3DUSAGE_STATICDECL
| WINED3DUSAGE_OVERLAY
| WINED3DUSAGE_SCRATCH

View File

@ -375,7 +375,6 @@ static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struc
texture->layer_count = layer_count;
texture->level_count = level_count;
texture->filter_type = (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP) ? WINED3D_TEXF_LINEAR : WINED3D_TEXF_NONE;
texture->lod = 0;
texture->flags |= WINED3D_TEXTURE_POW2_MAT_IDENT | WINED3D_TEXTURE_NORMALIZED_COORDS;
if (flags & WINED3D_TEXTURE_CREATE_GET_DC_LENIENT)
@ -728,12 +727,6 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
context_bind_texture(context, target, gl_tex->name);
if (texture->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP)
{
gl_info->gl_ops.gl.p_glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
checkGLcall("glTexParameteri(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE)");
}
/* For a new texture we have to set the texture levels after binding the
* texture. Beware that texture rectangles do not support mipmapping, but
* set the maxmiplevel if we're relying on the partial
@ -1177,29 +1170,6 @@ DWORD CDECL wined3d_texture_get_level_count(const struct wined3d_texture *textur
return texture->level_count;
}
HRESULT CDECL wined3d_texture_set_autogen_filter_type(struct wined3d_texture *texture,
enum wined3d_texture_filter_type filter_type)
{
FIXME("texture %p, filter_type %s stub!\n", texture, debug_d3dtexturefiltertype(filter_type));
if (!(texture->resource.usage & WINED3DUSAGE_AUTOGENMIPMAP))
{
WARN("Texture doesn't have AUTOGENMIPMAP usage.\n");
return WINED3DERR_INVALIDCALL;
}
texture->filter_type = filter_type;
return WINED3D_OK;
}
enum wined3d_texture_filter_type CDECL wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture)
{
TRACE("texture %p.\n", texture);
return texture->filter_type;
}
HRESULT CDECL wined3d_texture_set_color_key(struct wined3d_texture *texture,
DWORD flags, const struct wined3d_color_key *color_key)
{
@ -2152,22 +2122,6 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
TRACE("Creating an oversized (%ux%u) surface.\n", pow2_width, pow2_height);
}
/* Calculate levels for mip mapping. */
if (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP)
{
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
{
WARN("No mipmap generation support, returning WINED3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
if (level_count != 1)
{
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning WINED3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
}
if (FAILED(hr = wined3d_texture_init(texture, &texture2d_ops, layer_count, level_count, desc,
flags, device, parent, parent_ops, &texture_resource_ops)))
{
@ -2606,22 +2560,6 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
return WINED3DERR_INVALIDCALL;
}
/* Calculate levels for mip mapping. */
if (desc->usage & WINED3DUSAGE_AUTOGENMIPMAP)
{
if (!gl_info->supported[SGIS_GENERATE_MIPMAP])
{
WARN("No mipmap generation support, returning D3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
if (level_count != 1)
{
WARN("WINED3DUSAGE_AUTOGENMIPMAP is set, and level count != 1, returning D3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
}
if (desc->usage & WINED3DUSAGE_DYNAMIC && (wined3d_resource_access_is_managed(desc->access)
|| desc->usage & WINED3DUSAGE_SCRATCH))
{

View File

@ -3599,7 +3599,7 @@ static void init_format_gen_mipmap_info(struct wined3d_gl_info *gl_info)
{
unsigned int i, j;
if (!gl_info->supported[SGIS_GENERATE_MIPMAP] && !gl_info->fbo_ops.glGenerateMipmap)
if (!gl_info->fbo_ops.glGenerateMipmap)
return;
for (i = 0; i < gl_info->format_count; ++i)
@ -4179,7 +4179,6 @@ const char *debug_d3dusage(DWORD usage)
WINED3DUSAGE_TO_STR(WINED3DUSAGE_RTPATCHES);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_NPATCHES);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_DYNAMIC);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_AUTOGENMIPMAP);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_RESTRICTED_CONTENT);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER);
WINED3DUSAGE_TO_STR(WINED3DUSAGE_RESTRICT_SHARED_RESOURCE);
@ -4203,6 +4202,7 @@ const char *debug_d3dusagequery(DWORD usagequery)
buf[0] = '\0';
#define WINED3DUSAGEQUERY_TO_STR(u) if (usagequery & u) { strcat(buf, " | "#u); usagequery &= ~u; }
WINED3DUSAGEQUERY_TO_STR(WINED3DUSAGE_QUERY_FILTER);
WINED3DUSAGEQUERY_TO_STR(WINED3DUSAGE_QUERY_GENMIPMAP);
WINED3DUSAGEQUERY_TO_STR(WINED3DUSAGE_QUERY_LEGACYBUMPMAP);
WINED3DUSAGEQUERY_TO_STR(WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING);
WINED3DUSAGEQUERY_TO_STR(WINED3DUSAGE_QUERY_SRGBREAD);

View File

@ -294,7 +294,6 @@
@ cdecl wined3d_texture_create(ptr ptr long long long ptr ptr ptr ptr)
@ cdecl wined3d_texture_decref(ptr)
@ cdecl wined3d_texture_from_resource(ptr)
@ cdecl wined3d_texture_get_autogen_filter_type(ptr)
@ cdecl wined3d_texture_get_dc(ptr long ptr)
@ cdecl wined3d_texture_get_level_count(ptr)
@ cdecl wined3d_texture_get_lod(ptr)
@ -306,7 +305,6 @@
@ cdecl wined3d_texture_get_sub_resource_parent(ptr long)
@ cdecl wined3d_texture_incref(ptr)
@ cdecl wined3d_texture_release_dc(ptr long ptr)
@ cdecl wined3d_texture_set_autogen_filter_type(ptr long)
@ cdecl wined3d_texture_set_color_key(ptr long ptr)
@ cdecl wined3d_texture_set_lod(ptr long)
@ cdecl wined3d_texture_set_overlay_position(ptr long long long)

View File

@ -199,8 +199,6 @@ enum wined3d_gl_extension
NV_VERTEX_PROGRAM2,
NV_VERTEX_PROGRAM2_OPTION,
NV_VERTEX_PROGRAM3,
/* SGI */
SGIS_GENERATE_MIPMAP,
/* WGL extensions */
WGL_ARB_PIXEL_FORMAT,
WGL_EXT_SWAP_CONTROL,

View File

@ -3117,7 +3117,6 @@ struct wined3d_texture
unsigned int sysmem_count;
float pow2_matrix[16];
UINT lod;
enum wined3d_texture_filter_type filter_type;
DWORD sampler;
DWORD flags;
GLenum target;

View File

@ -36,7 +36,7 @@
#define _FACWINED3D 0x876
#define MAKE_WINED3DSTATUS(code) MAKE_HRESULT(0, _FACWINED3D, code)
#define WINED3DOK_NOAUTOGEN MAKE_WINED3DSTATUS(2159)
#define WINED3DOK_NOMIPGEN MAKE_WINED3DSTATUS(2159)
#define MAKE_WINED3DHRESULT(code) MAKE_HRESULT(1, _FACWINED3D, code)
#define WINED3DERR_CONFLICTINGRENDERSTATE MAKE_WINED3DHRESULT(2081)
@ -884,13 +884,12 @@ enum wined3d_shader_byte_code_format
#define WINED3DUSAGE_RTPATCHES 0x00000080
#define WINED3DUSAGE_NPATCHES 0x00000100
#define WINED3DUSAGE_DYNAMIC 0x00000200
#define WINED3DUSAGE_AUTOGENMIPMAP 0x00000400
#define WINED3DUSAGE_RESTRICTED_CONTENT 0x00000800
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER 0x00001000
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE 0x00002000
#define WINED3DUSAGE_DMAP 0x00004000
#define WINED3DUSAGE_TEXTAPI 0x10000000
#define WINED3DUSAGE_MASK 0x10007fff
#define WINED3DUSAGE_MASK 0x10007bff
#define WINED3DUSAGE_SCRATCH 0x00200000
#define WINED3DUSAGE_PRIVATE 0x00400000
@ -900,6 +899,7 @@ enum wined3d_shader_byte_code_format
#define WINED3DUSAGE_STATICDECL 0x04000000
#define WINED3DUSAGE_OVERLAY 0x08000000
#define WINED3DUSAGE_QUERY_GENMIPMAP 0x00000400
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP 0x00008000
#define WINED3DUSAGE_QUERY_FILTER 0x00020000
#define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000
@ -907,7 +907,7 @@ enum wined3d_shader_byte_code_format
#define WINED3DUSAGE_QUERY_SRGBWRITE 0x00040000
#define WINED3DUSAGE_QUERY_VERTEXTEXTURE 0x00100000
#define WINED3DUSAGE_QUERY_WRAPANDMIP 0x00200000
#define WINED3DUSAGE_QUERY_MASK 0x003f8000
#define WINED3DUSAGE_QUERY_MASK 0x003f8400
#define WINED3D_MAP_READONLY 0x0010
#define WINED3D_MAP_NOSYSLOCK 0x0800
@ -1163,7 +1163,7 @@ enum wined3d_shader_byte_code_format
#define WINED3DCAPS2_RESERVED 0x02000000
#define WINED3DCAPS2_CANMANAGERESOURCE 0x10000000
#define WINED3DCAPS2_DYNAMICTEXTURES 0x20000000
#define WINED3DCAPS2_CANAUTOGENMIPMAP 0x40000000
#define WINED3DCAPS2_CANGENMIPMAP 0x40000000
#define WINED3DPRASTERCAPS_DITHER 0x00000001
#define WINED3DPRASTERCAPS_ROP2 0x00000002
@ -2674,7 +2674,6 @@ HRESULT __cdecl wined3d_texture_create(struct wined3d_device *device, const stru
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
struct wined3d_texture * __cdecl wined3d_texture_from_resource(struct wined3d_resource *resource);
ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture);
enum wined3d_texture_filter_type __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture);
HRESULT __cdecl wined3d_texture_get_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC *dc);
DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture);
DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture);
@ -2689,8 +2688,6 @@ HRESULT __cdecl wined3d_texture_get_sub_resource_desc(const struct wined3d_textu
void * __cdecl wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx);
ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture);
HRESULT __cdecl wined3d_texture_release_dc(struct wined3d_texture *texture, unsigned int sub_resource_idx, HDC dc);
HRESULT __cdecl wined3d_texture_set_autogen_filter_type(struct wined3d_texture *texture,
enum wined3d_texture_filter_type filter_type);
HRESULT __cdecl wined3d_texture_set_color_key(struct wined3d_texture *texture,
DWORD flags, const struct wined3d_color_key *color_key);
DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod);