d3d10core/tests: Use get_rtv_desc() in test_render_target_views().

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-06-22 11:37:35 +02:00 committed by Alexandre Julliard
parent 7e1fd3d3c9
commit eab40edba5
1 changed files with 2 additions and 18 deletions

View File

@ -2166,7 +2166,7 @@ static void test_render_target_views(void)
static struct test static struct test
{ {
struct texture texture; struct texture texture;
struct rtv rtv; struct rtv_desc rtv;
DWORD expected_colors[4]; DWORD expected_colors[4];
} }
tests[] = tests[] =
@ -2238,23 +2238,7 @@ static void test_render_target_views(void)
hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
ok(SUCCEEDED(hr), "Test %u: Failed to create texture, hr %#x.\n", i, hr); ok(SUCCEEDED(hr), "Test %u: Failed to create texture, hr %#x.\n", i, hr);
rtv_desc.Format = texture_desc.Format; get_rtv_desc(&rtv_desc, &test->rtv);
rtv_desc.ViewDimension = test->rtv.dimension;
if (test->rtv.dimension == D3D10_RTV_DIMENSION_TEXTURE2D)
{
U(rtv_desc).Texture2D.MipSlice = test->rtv.miplevel_idx;
}
else if (test->rtv.dimension == D3D10_RTV_DIMENSION_TEXTURE2DARRAY)
{
U(rtv_desc).Texture2DArray.MipSlice = test->rtv.miplevel_idx;
U(rtv_desc).Texture2DArray.FirstArraySlice = test->rtv.layer_idx;
U(rtv_desc).Texture2DArray.ArraySize = test->rtv.layer_count;
}
else
{
trace("Test %u: Unhandled view dimension %#x.\n", i, test->rtv.dimension);
}
hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, &rtv_desc, &rtv); hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)texture, &rtv_desc, &rtv);
ok(SUCCEEDED(hr), "Test %u: Failed to create render target view, hr %#x.\n", i, hr); ok(SUCCEEDED(hr), "Test %u: Failed to create render target view, hr %#x.\n", i, hr);