Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/wined3d/directx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 600ad02a427..6296b833709 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1777,6 +1777,19 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D; break;
+ case WINED3D_RTYPE_BUFFER: + if (wined3d_format_is_typeless(format)) + { + TRACE("Requested WINED3D_RTYPE_BUFFER, but format %s is typeless.\n", debug_d3dformat(check_format_id)); + return WINED3DERR_NOTAVAILABLE; + } + + allowed_usage = WINED3DUSAGE_DYNAMIC; + allowed_bind_flags = WINED3D_BIND_SHADER_RESOURCE + | WINED3D_BIND_UNORDERED_ACCESS; + gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER; + break; + default: FIXME("Unhandled resource type %s.\n", debug_d3dresourcetype(resource_type)); return WINED3DERR_NOTAVAILABLE;
Note that native also reports support for DXGI_FORMAT_UNKNOWN; this patch does not implement that behaviour.
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/d3d11/device.c | 4 ++++ dlls/d3d11/tests/d3d11.c | 3 +++ 2 files changed, 7 insertions(+)
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index a7e1999c07a..8e5beb8893b 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3541,6 +3541,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * } flag_mapping[] = { + {WINED3D_RTYPE_BUFFER, WINED3D_BIND_SHADER_RESOURCE, 0, D3D11_FORMAT_SUPPORT_BUFFER}, {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}, @@ -3587,6 +3588,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * } wined3d_mutex_unlock();
+ if (feature_level < D3D_FEATURE_LEVEL_10_0) + *format_support &= ~D3D11_FORMAT_SUPPORT_BUFFER; + if (*format_support & (D3D11_FORMAT_SUPPORT_TEXTURE1D | D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_TEXTURE3D)) { diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index fddb7bfd218..044c1ce5a17 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -19950,6 +19950,9 @@ static void test_format_support(const D3D_FEATURE_LEVEL feature_level) ok(!(format_support[format] & D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON), "Unexpected SHADER_SAMPLE_COMPARISON for format %#x, feature level %#x.\n", format, feature_level); + ok(!(format_support[format] & D3D11_FORMAT_SUPPORT_BUFFER), + "Unexpected BUFFER for format %#x, feature level %#x.\n", + format, feature_level); } if (feature_level < D3D_FEATURE_LEVEL_10_1) {
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=85487
Your paranoid android.
=== w1064 (32 bit report) ===
d3d11: d3d11.c:5811: Test failed: Got unexpected IAVertices count: 0. d3d11.c:5812: Test failed: Got unexpected IAPrimitives count: 0. d3d11.c:5813: Test failed: Got unexpected VSInvocations count: 0. d3d11.c:5816: Test failed: Got unexpected CInvocations count: 0. d3d11.c:5817: Test failed: Got unexpected CPrimitives count: 0.
=== debiant2 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:18309: Test failed: Got {0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 0.00000000e+000}, expected {1.00000000e+000, 2.00000000e+000, 3.00000000e+000, 4.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {0.00000000e+000, 1.04857523e+009, 1.05696435e+009, 1.06535322e+009}, expected {0.00000000e+000, 2.49988556e-001, 4.99992371e-001, 1.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {-1.08213043e+009, 0.00000000e+000, 1.06535322e+009, 0.00000000e+000}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 0.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {1.06535322e+009, 1.06535322e+009, 1.06535322e+009, 1.06535322e+009}, expected {1.00000000e+000, 1.00000000e+000, 1.00000000e+000, 1.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {0.00000000e+000, 1.04860890e+009, 1.05699750e+009, 1.06535322e+009}, expected {0.00000000e+000, 2.50980407e-001, 5.01960814e-001, 1.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {-1.08213043e+009, 0.00000000e+000, 1.06535322e+009, 1.05703066e+009}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {1.06535322e+009, 1.06535322e+009, 1.06535322e+009, 1.06535322e+009}, expected {1.00000000e+000, 1.00000000e+000, 1.00000000e+000, 1.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {0.00000000e+000, 1.06535322e+009, 0.00000000e+000, 0.00000000e+000}, expected {0.00000000e+000, 1.00000000e+000, 0.00000000e+000, 0.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 1.06535322e+009}, expected {0.00000000e+000, 0.00000000e+000, 0.00000000e+000, 1.00000000e+000} at (0, 0), sub-resource 0. d3d11.c:18309: Test failed: Got {1.06535322e+009, 0.00000000e+000, 1.05697280e+009, 1.05976083e+009}, expected {1.00000000e+000, 0.00000000e+000, 5.00488758e-001, 6.66666687e-001} at (0, 0), sub-resource 0.
=== debiant2 (build log) ===
0338:err:d3d:wined3d_debug_callback 0xadcff0: "0:70(19): error: `vs_in1' undeclared". 0338:err:d3d:wined3d_debug_callback 0xadcff0: "0:70(19): error: type mismatch". 0338:fixme:d3d_shader:print_glsl_info_log 0:70(19): error: `vs_in1' undeclared 0338:fixme:d3d_shader:print_glsl_info_log 0:70(19): error: type mismatch
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com