Commit 25a8773d authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Advertise AUTOGENMIPMAP only for renderable and filterable formats.

parent cc7c6928
...@@ -6963,7 +6963,6 @@ static void test_mipmap_gen(void) ...@@ -6963,7 +6963,6 @@ static void test_mipmap_gen(void)
D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, formats[i])); D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, formats[i]));
hr = IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, hr = IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8,
D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, formats[i]); D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, formats[i]);
todo_wine_if (!renderable && hr == D3D_OK)
ok((hr == D3D_OK && renderable) || hr == D3DOK_NOAUTOGEN, ok((hr == D3D_OK && renderable) || hr == D3DOK_NOAUTOGEN,
"Got unexpected hr %#x for %srenderable format %#x.\n", "Got unexpected hr %#x for %srenderable format %#x.\n",
hr, renderable ? "" : "non", formats[i]); hr, renderable ? "" : "non", formats[i]);
......
...@@ -5364,7 +5364,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad ...@@ -5364,7 +5364,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
return WINED3DERR_NOTAVAILABLE; return WINED3DERR_NOTAVAILABLE;
} }
if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && !gl_info->supported[SGIS_GENERATE_MIPMAP]) if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && (!gl_info->supported[SGIS_GENERATE_MIPMAP]
|| (format->flags[gl_type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))
!= (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)))
{ {
TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n"); TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n");
return WINED3DOK_NOAUTOGEN; return WINED3DOK_NOAUTOGEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment