Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
v2: used create_buffer() helper this time.
dlls/d3d11/tests/d3d11.c | 16 +++++++++++++++- dlls/wined3d/view.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index d58319df58..1a615d80b1 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -17236,7 +17236,7 @@ static void test_create_unordered_access_view(void) ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x.\n", hr);
hr = ID3D11Device_CreateUnorderedAccessView(device, (ID3D11Resource *)buffer, NULL, &uav); - ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to create unordered access view, hr %#x.\n", hr);
memset(&uav_desc, 0, sizeof(uav_desc)); ID3D11UnorderedAccessView_GetDesc(uav, &uav_desc); @@ -17251,6 +17251,20 @@ static void test_create_unordered_access_view(void) ID3D11UnorderedAccessView_Release(uav); ID3D11Buffer_Release(buffer);
+ /* Without D3D11_BIND_UNORDERED_ACCESS. */ + buffer = create_buffer(device, 0, 1024, NULL); + + uav_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + U(uav_desc).Buffer.FirstElement = 0; + U(uav_desc).Buffer.NumElements = 64; + U(uav_desc).Buffer.Flags = 0; + + hr = ID3D11Device_CreateUnorderedAccessView(device, (ID3D11Resource *)buffer, &uav_desc, &uav); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + ID3D11Buffer_Release(buffer); + texture2d_desc.Width = 512; texture2d_desc.Height = 512; texture2d_desc.SampleDesc.Count = 1; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index f1c99a3b6a..6710abb270 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1134,6 +1134,8 @@ static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_acces view->parent = parent; view->parent_ops = parent_ops;
+ if (!(resource->bind_flags & WINED3D_BIND_UNORDERED_ACCESS)) + return E_INVALIDARG; if (!(view->format = validate_resource_view(desc, resource, TRUE, FALSE))) return E_INVALIDARG; view->desc = *desc;
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=57228
Your paranoid android.
=== debian10 (32 bit report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:27602: Test failed: Resource type 1, test 8: pixel (200, 200) has color 00000000, expected ffff0000.
=== debian10 (32 bit Japanese:Japan report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16860: Test failed: Got {-1.00787401e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001}, expected {-1.00000000e+000, 0.00000000e+000, 1.00000000e+000, 5.03937006e-001} at (0, 0), sub-resource 0.
=== debian10 (32 bit Chinese:China report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (32 bit WoW report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:6119: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (64 bit WoW report) ===
d3d11: d3d11.c:17958: Test failed: Got {0x00000001, 0xffffffff, 0x00000000, 0x00000000}, expected {0x00000001, 0x00000000, 0x00000000, 0x00000000} at (0, 0), sub-resource 0.