Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index a6f4e6badbca..880c8b6595e6 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3332,15 +3332,17 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * { enum wined3d_resource_type rtype; unsigned int bind_flags; + unsigned int usage; D3D11_FORMAT_SUPPORT flag; } flag_mapping[] = { - {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, D3D11_FORMAT_SUPPORT_TEXTURE1D}, - {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, D3D11_FORMAT_SUPPORT_TEXTURE2D}, - {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, D3D11_FORMAT_SUPPORT_TEXTURE3D}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, - {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, + {WINED3D_RTYPE_TEXTURE_1D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE1D}, + {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE2D}, + {WINED3D_RTYPE_TEXTURE_3D, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_TEXTURE3D}, + {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_LEGACY_CUBEMAP, D3D11_FORMAT_SUPPORT_TEXTURECUBE}, + {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, 0, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, + {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, }; HRESULT hr;
@@ -3364,7 +3366,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * for (i = 0; i < ARRAY_SIZE(flag_mapping); ++i) { hr = wined3d_check_device_format(wined3d, wined3d_adapter, params.device_type, - WINED3DFMT_UNKNOWN, 0, flag_mapping[i].bind_flags, flag_mapping[i].rtype, wined3d_format); + WINED3DFMT_UNKNOWN, flag_mapping[i].usage, flag_mapping[i].bind_flags, flag_mapping[i].rtype, wined3d_format); if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DOK_NOMIPGEN) continue; if (hr != WINED3D_OK)
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 880c8b6595e6..0d38a2f19455 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3343,6 +3343,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_LEGACY_CUBEMAP, D3D11_FORMAT_SUPPORT_TEXTURECUBE}, {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, 0, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, + {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_WRAPANDMIP, D3D11_FORMAT_SUPPORT_MIP}, }; HRESULT hr;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 1 + dlls/d3d11/tests/d3d11.c | 5 +++++ 2 files changed, 6 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 0d38a2f19455..cfcd4acacefc 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3344,6 +3344,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, 0, D3D11_FORMAT_SUPPORT_RENDER_TARGET}, {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_WRAPANDMIP, D3D11_FORMAT_SUPPORT_MIP}, + {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_GENMIPMAP, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN}, }; HRESULT hr;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 5b9bb50a89f5..3099d22d273f 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -18514,6 +18514,11 @@ static void test_format_support(const D3D_FEATURE_LEVEL feature_level) ok(hr == S_OK || (hr == E_FAIL && !format_support[format]), "Got unexpected result for format %#x: hr %#x, format_support %#x.\n", format, hr, format_support[format]); + if (format_support[format] & D3D11_FORMAT_SUPPORT_MIP_AUTOGEN) + { + ok(format_support[format] & D3D11_FORMAT_SUPPORT_TEXTURE2D, + "Got unexpected format support %#x for format %#x", format_support[format], format); + } }
for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=78509
Your paranoid android.
=== w1064v1809 (32 bit report) ===
d3d11: d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0.
=== w10pro64_2scr (32 bit report) ===
d3d11: d3d11.c:5804: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5805: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5806: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5809: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5810: Test failed: Got unexpected CPrimitives count: 0. d3d11.c:5651: Test failed: Got unexpected query result 0x0000000000000000.
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index cfcd4acacefc..29fa8b3752cc 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3345,6 +3345,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * {WINED3D_RTYPE_NONE, WINED3D_BIND_DEPTH_STENCIL, 0, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_WRAPANDMIP, D3D11_FORMAT_SUPPORT_MIP}, {WINED3D_RTYPE_TEXTURE_2D, WINED3D_BIND_SHADER_RESOURCE, WINED3DUSAGE_QUERY_GENMIPMAP, D3D11_FORMAT_SUPPORT_MIP_AUTOGEN}, + {WINED3D_RTYPE_NONE, WINED3D_BIND_RENDER_TARGET, WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3D11_FORMAT_SUPPORT_BLENDABLE}, }; HRESULT hr;
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49614 Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d11/device.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 29fa8b3752cc..0508fa3f7b25 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3402,6 +3402,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * } }
+ /* d3d11 requires 4 and 8 sample counts support for formats reported to + * support multisample. */ + if (wined3d_check_device_multisample_type(wined3d_adapter, params.device_type, wined3d_format, + TRUE, WINED3D_MULTISAMPLE_4_SAMPLES, NULL) == WINED3D_OK && + wined3d_check_device_multisample_type(wined3d_adapter, params.device_type, wined3d_format, + TRUE, WINED3D_MULTISAMPLE_8_SAMPLES, NULL) == WINED3D_OK) + { + *format_support |= D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE + | D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET + | D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD; + } + return S_OK; }
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com