From f1c58a93afa39c69cd121e90f86b2b93d23d3830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Tue, 15 Mar 2016 10:52:45 +0100 Subject: [PATCH] d3d11: Translate WINED3DERR_INVALIDCALL to E_INVALIDARG in d3d_texture{2d, 3d}_init(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/d3d10_1/tests/d3d10_1.c | 2 +- dlls/d3d10core/tests/device.c | 2 +- dlls/d3d11/device.c | 4 ++-- dlls/d3d11/tests/d3d11.c | 16 ++++++++-------- dlls/d3d11/texture.c | 4 +++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dlls/d3d10_1/tests/d3d10_1.c b/dlls/d3d10_1/tests/d3d10_1.c index 7eba447ff87..ccea06b9be0 100644 --- a/dlls/d3d10_1/tests/d3d10_1.c +++ b/dlls/d3d10_1/tests/d3d10_1.c @@ -221,7 +221,7 @@ static void test_create_device(void) swapchain_desc.BufferDesc.Format = DXGI_FORMAT_BC5_UNORM; hr = D3D10CreateDeviceAndSwapChain1(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, supported_feature_level, D3D10_1_SDK_VERSION, &swapchain_desc, &swapchain, &device); - todo_wine ok(hr == E_INVALIDARG, "D3D10CreateDeviceAndSwapChain1 returned %#x.\n", hr); + ok(hr == E_INVALIDARG, "D3D10CreateDeviceAndSwapChain1 returned %#x.\n", hr); ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); ok(!device, "Got unexpected device pointer %p.\n", device); diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 22f1e9e7f5e..e9ae8d969ef 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -522,7 +522,7 @@ static void test_create_texture2d(void) {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D10_BIND_CONSTANT_BUFFER, FALSE, TRUE}, {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D10_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D10_BIND_RENDER_TARGET, TRUE, FALSE}, - {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D10_BIND_DEPTH_STENCIL, FALSE, TRUE}, + {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D10_BIND_DEPTH_STENCIL, FALSE, FALSE}, {DXGI_FORMAT_R32G32B32_TYPELESS, D3D10_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16G16B16A16_TYPELESS, D3D10_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16G16B16A16_TYPELESS, D3D10_BIND_RENDER_TARGET, TRUE, FALSE}, diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 6ec154f963a..240c995f8bb 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -4849,7 +4849,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic FIXME("device_parent %p, container_parent %p, wined3d_desc %p, wined3d_texture %p partial stub!\n", device_parent, container_parent, wined3d_desc, wined3d_texture); - FIXME("Implement DXGI<->wined3d usage conversion\n"); + FIXME("Implement DXGI<->wined3d usage conversion.\n"); desc.Width = wined3d_desc->width; desc.Height = wined3d_desc->height; @@ -4866,7 +4866,7 @@ static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_devic if (FAILED(hr = d3d10_device_CreateTexture2D(&device->ID3D10Device1_iface, &desc, NULL, &texture_iface))) { - ERR("CreateTexture2D failed, returning %#x\n", hr); + WARN("CreateTexture2D failed, returning %#x.\n", hr); return hr; } diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index ebed409cacd..e8b691480c3 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -606,7 +606,7 @@ static void test_create_device(void) swapchain_desc.BufferDesc.Format = DXGI_FORMAT_BC5_UNORM; hr = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &swapchain_desc, &swapchain, &device, &feature_level, &immediate_context); - todo_wine ok(hr == E_INVALIDARG, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); + ok(hr == E_INVALIDARG, "D3D11CreateDeviceAndSwapChain returned %#x.\n", hr); ok(!swapchain, "Got unexpected swapchain pointer %p.\n", swapchain); ok(!device, "Got unexpected device pointer %p.\n", device); ok(!feature_level, "Got unexpected feature level %#x.\n", feature_level); @@ -742,7 +742,7 @@ static void test_create_texture2d(void) {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_CONSTANT_BUFFER, FALSE, TRUE}, {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_RENDER_TARGET, TRUE, FALSE}, - {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_DEPTH_STENCIL, FALSE, TRUE}, + {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_DEPTH_STENCIL, FALSE, FALSE}, {DXGI_FORMAT_R32G32B32_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16G16B16A16_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16G16B16A16_TYPELESS, D3D11_BIND_RENDER_TARGET, TRUE, FALSE}, @@ -759,9 +759,9 @@ static void test_create_texture2d(void) {DXGI_FORMAT_R8G8_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R8_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, - {DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_DEPTH_STENCIL, FALSE, TRUE}, - {DXGI_FORMAT_D24_UNORM_S8_UINT, D3D11_BIND_RENDER_TARGET, FALSE, TRUE}, - {DXGI_FORMAT_D32_FLOAT, D3D11_BIND_RENDER_TARGET, FALSE, TRUE}, + {DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_DEPTH_STENCIL, FALSE, FALSE}, + {DXGI_FORMAT_D24_UNORM_S8_UINT, D3D11_BIND_RENDER_TARGET, FALSE, FALSE}, + {DXGI_FORMAT_D32_FLOAT, D3D11_BIND_RENDER_TARGET, FALSE, FALSE}, }; if (!(device = create_device(NULL))) @@ -1074,9 +1074,9 @@ static void test_create_texture3d(void) {DXGI_FORMAT_R32G32B32A32_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R16G16B16A16_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, {DXGI_FORMAT_R10G10B10A2_TYPELESS, D3D11_BIND_SHADER_RESOURCE, TRUE, FALSE}, - {DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_DEPTH_STENCIL, FALSE, TRUE}, - {DXGI_FORMAT_D24_UNORM_S8_UINT, D3D11_BIND_RENDER_TARGET, FALSE, TRUE}, - {DXGI_FORMAT_D32_FLOAT, D3D11_BIND_RENDER_TARGET, FALSE, TRUE}, + {DXGI_FORMAT_R8G8B8A8_UNORM, D3D11_BIND_DEPTH_STENCIL, FALSE, FALSE}, + {DXGI_FORMAT_D24_UNORM_S8_UINT, D3D11_BIND_RENDER_TARGET, FALSE, FALSE}, + {DXGI_FORMAT_D32_FLOAT, D3D11_BIND_RENDER_TARGET, FALSE, FALSE}, }; if (!(device = create_device(NULL))) diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c index 11bda45597f..c6cdc299ad7 100644 --- a/dlls/d3d11/texture.c +++ b/dlls/d3d11/texture.c @@ -482,7 +482,7 @@ static HRESULT d3d_texture2d_init(struct d3d_texture2d *texture, struct d3d_devi WARN("Failed to create wined3d texture, hr %#x.\n", hr); wined3d_private_store_cleanup(&texture->private_store); wined3d_mutex_unlock(); - if (hr == WINED3DERR_NOTAVAILABLE) + if (hr == WINED3DERR_NOTAVAILABLE || hr == WINED3DERR_INVALIDCALL) hr = E_INVALIDARG; return hr; } @@ -936,6 +936,8 @@ static HRESULT d3d_texture3d_init(struct d3d_texture3d *texture, struct d3d_devi WARN("Failed to create wined3d texture, hr %#x.\n", hr); wined3d_private_store_cleanup(&texture->private_store); wined3d_mutex_unlock(); + if (hr == WINED3DERR_INVALIDCALL) + hr = E_INVALIDARG; return hr; } wined3d_mutex_unlock();