Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It's a bit awkward to have this in a patch of its own but the alternatives I can think of don't look any better to me.
dlls/wined3d/directx.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 000d0b75469..a2cc484727d 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -5287,7 +5287,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad const struct wined3d_gl_info *gl_info = &adapter->gl_info; const struct wined3d_format *adapter_format, *format; enum wined3d_gl_resource_type gl_type, gl_type_end; - BOOL mipmap_autogen_supported; + BOOL mipmap_gen_supported; DWORD format_flags = 0; DWORD allowed_usage;
@@ -5401,7 +5401,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad return WINED3DERR_NOTAVAILABLE; }
- mipmap_autogen_supported = gl_info->supported[SGIS_GENERATE_MIPMAP]; + mipmap_gen_supported = gl_info->supported[ARB_FRAMEBUFFER_OBJECT] + || gl_info->supported[EXT_FRAMEBUFFER_OBJECT]; + for (; gl_type <= gl_type_end; ++gl_type) { if ((format->flags[gl_type] & format_flags) != format_flags) @@ -5431,14 +5433,11 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad return WINED3DERR_NOTAVAILABLE; }
- if ((format->flags[gl_type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) - != (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) - { - mipmap_autogen_supported = FALSE; - } + if (~format->flags[gl_type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) + mipmap_gen_supported = FALSE; }
- if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && !mipmap_autogen_supported) + if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && !mipmap_gen_supported) { TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n"); return WINED3DOK_NOAUTOGEN; @@ -5613,7 +5612,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte caps->Caps2 = WINED3DCAPS2_CANRENDERWINDOWED | WINED3DCAPS2_FULLSCREENGAMMA | WINED3DCAPS2_DYNAMICTEXTURES; - if (gl_info->supported[SGIS_GENERATE_MIPMAP]) + if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT] || gl_info->supported[EXT_FRAMEBUFFER_OBJECT]) caps->Caps2 |= WINED3DCAPS2_CANAUTOGENMIPMAP;
caps->Caps3 = WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD |