d3d11: Translate WINED3DERR_INVALIDCALL to E_INVALIDARG in d3d_texture{2d, 3d}_init().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-03-15 10:52:45 +01:00 committed by Alexandre Julliard
parent d6bef36f22
commit f1c58a93af
5 changed files with 15 additions and 13 deletions

View File

@ -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);

View File

@ -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},

View File

@ -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;
}

View File

@ -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)))

View File

@ -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();