Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
As far as I can tell, d3d9 always sets BIND_SHADER_RESOURCE for all texture types.
dlls/d3d10_1/tests/d3d10_1.c | 3 --- dlls/d3d10core/tests/d3d10core.c | 3 --- dlls/d3d11/tests/d3d11.c | 3 --- dlls/wined3d/view.c | 2 ++ 4 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index 9c468c13a2..51da614d9d 100644 --- a/dlls/d3d10_1/tests/d3d10_1.c +++ b/dlls/d3d10_1/tests/d3d10_1.c @@ -410,10 +410,7 @@ static void test_create_shader_resource_view(void) ok(SUCCEEDED(hr), "Failed to create a buffer, hr %#x\n", hr);
hr = ID3D10Device1_CreateShaderResourceView1(device, (ID3D10Resource *)buffer, &srv_desc, &srview); -todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D10ShaderResourceView1_Release(srview);
ID3D10Buffer_Release(buffer);
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index cc6b39ccd1..d291c881e3 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -3582,10 +3582,7 @@ static void test_create_shader_resource_view(void) buffer = create_buffer(device, 0, 1024, NULL);
hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)buffer, &srv_desc, &srview); -todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D10ShaderResourceView_Release(srview);
ID3D10Buffer_Release(buffer);
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 97ab9b4487..d58319df58 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -4260,10 +4260,7 @@ static void test_create_shader_resource_view(void) buffer = create_buffer(device, 0, 1024, NULL);
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, &srv_desc, &srview); -todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); - if (SUCCEEDED(hr)) - ID3D11ShaderResourceView_Release(srview);
ID3D11Buffer_Release(buffer);
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index f7bb18934f..f1c99a3b6a 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -767,6 +767,8 @@ static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_ view->parent = parent; view->parent_ops = parent_ops;
+ if (!(resource->bind_flags & WINED3D_BIND_SHADER_RESOURCE)) + return E_INVALIDARG; if (!(view->format = validate_resource_view(desc, resource, FALSE, 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=56968
Your paranoid android.
=== debian10 (32 bit report) ===
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0. d3d11.c:16857: 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 Japanese:Japan report) ===
d3d10core: d3d10core.c:12958: Test failed: d3d10core.c:12598: 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.
d3d11: d3d11.c:6109: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
=== debian10 (32 bit Chinese:China report) ===
d3d10core: d3d10core.c:4787: Test failed: Got unexpected CPrimitives count: 3. d3d10core.c:12598: 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 WoW report) ===
d3d11: d3d11.c:16857: 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 (64 bit WoW report) ===
d3d10core: d3d10core.c:4970: Test succeeded inside todo block: Got unexpected PrimitivesStorageNeeded: 0.
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.