Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- v2: Rebase, update for the new patch 1/5.
dlls/d3d11/device.c | 2 +- dlls/d3d9/d3d9_private.h | 2 +- dlls/wined3d/directx.c | 13 ++++----- dlls/wined3d/resource.c | 1 - dlls/wined3d/texture.c | 62 ------------------------------------------ dlls/wined3d/utils.c | 4 +-- dlls/wined3d/wined3d.spec | 2 -- dlls/wined3d/wined3d_gl.h | 2 -- dlls/wined3d/wined3d_private.h | 1 - include/wine/wined3d.h | 13 ++++----- 10 files changed, 14 insertions(+), 88 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index f65c9947cb1..25308c29801 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -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) { diff --git a/dlls/d3d9/d3d9_private.h b/dlls/d3d9/d3d9_private.h index b7504c2b357..2e081fd7eb4 100644 --- a/dlls/d3d9/d3d9_private.h +++ b/dlls/d3d9/d3d9_private.h @@ -332,7 +332,7 @@ static inline unsigned int wined3daccess_from_d3dpool(D3DPOOL pool)
static inline DWORD wined3dusage_from_d3dusage(unsigned int usage) { - return usage & WINED3DUSAGE_MASK & ~WINED3DUSAGE_AUTOGENMIPMAP; + return usage & WINED3DUSAGE_MASK; }
#endif /* __WINE_D3D9_PRIVATE_H */ diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index d48b1d3d142..3ddc075d204 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -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 | diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index e3188883205..1f555c36a67 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -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 diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 740afeace80..b04a0a7090b 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -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) @@ -739,12 +738,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 @@ -1188,29 +1181,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) { @@ -2170,22 +2140,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))) { @@ -2624,22 +2578,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)) { diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 960909f35b4..401b978be82 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -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); diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 035746d86aa..d2b6bef3634 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -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) diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index a3dee243595..cc6f8880256 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -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, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 8201536a5de..c2565379e54 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3116,7 +3116,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; diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index ed7445ea5a3..78540f4a8cc 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -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);