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;