d3d11/tests: Add some tests for copying between depth/stencil and colour formats.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8572de607b
commit
a1bcc9b7ad
|
@ -28184,6 +28184,8 @@ static void test_format_compatibility(void)
|
||||||
DXGI_FORMAT dst_format;
|
DXGI_FORMAT dst_format;
|
||||||
size_t texel_size;
|
size_t texel_size;
|
||||||
BOOL success;
|
BOOL success;
|
||||||
|
BOOL src_ds;
|
||||||
|
BOOL dst_ds;
|
||||||
}
|
}
|
||||||
test_data[] =
|
test_data[] =
|
||||||
{
|
{
|
||||||
|
@ -28213,6 +28215,10 @@ static void test_format_compatibility(void)
|
||||||
{DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_UINT, 8, TRUE},
|
{DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_UINT, 8, TRUE},
|
||||||
{DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_SINT, 8, TRUE},
|
{DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_SINT, 8, TRUE},
|
||||||
{DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_TYPELESS, 8, TRUE},
|
{DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_TYPELESS, 8, TRUE},
|
||||||
|
{DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_R16_UNORM, 2, TRUE, TRUE},
|
||||||
|
{DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, 2, TRUE, FALSE, TRUE},
|
||||||
|
{DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_TYPELESS, 2, TRUE, TRUE},
|
||||||
|
{DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_TYPELESS, 2, TRUE, FALSE, TRUE},
|
||||||
};
|
};
|
||||||
static const DWORD initial_data[16] = {0};
|
static const DWORD initial_data[16] = {0};
|
||||||
static const DWORD bitmap_data[] =
|
static const DWORD bitmap_data[] =
|
||||||
|
@ -28235,7 +28241,6 @@ static void test_format_compatibility(void)
|
||||||
texture_desc.ArraySize = 1;
|
texture_desc.ArraySize = 1;
|
||||||
texture_desc.SampleDesc.Count = 1;
|
texture_desc.SampleDesc.Count = 1;
|
||||||
texture_desc.SampleDesc.Quality = 0;
|
texture_desc.SampleDesc.Quality = 0;
|
||||||
texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
|
|
||||||
texture_desc.CPUAccessFlags = 0;
|
texture_desc.CPUAccessFlags = 0;
|
||||||
texture_desc.MiscFlags = 0;
|
texture_desc.MiscFlags = 0;
|
||||||
|
|
||||||
|
@ -28247,7 +28252,8 @@ static void test_format_compatibility(void)
|
||||||
|
|
||||||
texture_desc.Width = sizeof(bitmap_data) / (texture_desc.Height * test_data[i].texel_size);
|
texture_desc.Width = sizeof(bitmap_data) / (texture_desc.Height * test_data[i].texel_size);
|
||||||
texture_desc.Format = test_data[i].src_format;
|
texture_desc.Format = test_data[i].src_format;
|
||||||
texture_desc.Usage = D3D11_USAGE_IMMUTABLE;
|
texture_desc.Usage = test_data[i].src_ds ? D3D11_USAGE_DEFAULT : D3D11_USAGE_IMMUTABLE;
|
||||||
|
texture_desc.BindFlags = test_data[i].src_ds ? D3D11_BIND_DEPTH_STENCIL : D3D11_BIND_SHADER_RESOURCE;
|
||||||
|
|
||||||
resource_data.pSysMem = bitmap_data;
|
resource_data.pSysMem = bitmap_data;
|
||||||
resource_data.SysMemPitch = texture_desc.Width * test_data[i].texel_size;
|
resource_data.SysMemPitch = texture_desc.Width * test_data[i].texel_size;
|
||||||
|
@ -28258,6 +28264,7 @@ static void test_format_compatibility(void)
|
||||||
|
|
||||||
texture_desc.Format = test_data[i].dst_format;
|
texture_desc.Format = test_data[i].dst_format;
|
||||||
texture_desc.Usage = D3D11_USAGE_DEFAULT;
|
texture_desc.Usage = D3D11_USAGE_DEFAULT;
|
||||||
|
texture_desc.BindFlags = test_data[i].dst_ds ? D3D11_BIND_DEPTH_STENCIL : D3D11_BIND_SHADER_RESOURCE;
|
||||||
|
|
||||||
resource_data.pSysMem = initial_data;
|
resource_data.pSysMem = initial_data;
|
||||||
|
|
||||||
|
@ -28282,8 +28289,9 @@ static void test_format_compatibility(void)
|
||||||
x = j % 4;
|
x = j % 4;
|
||||||
y = j / 4;
|
y = j / 4;
|
||||||
colour = get_readback_color(&rb, x, y, 0);
|
colour = get_readback_color(&rb, x, y, 0);
|
||||||
expected = test_data[i].success && x >= texel_dwords && y
|
expected = test_data[i].success && !test_data[i].src_ds && !test_data[i].dst_ds
|
||||||
? bitmap_data[j - (4 + texel_dwords)] : initial_data[j];
|
&& x >= texel_dwords && y ? bitmap_data[j - (4 + texel_dwords)] : initial_data[j];
|
||||||
|
todo_wine_if((test_data[i].src_ds || test_data[i].dst_ds) && colour)
|
||||||
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
|
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
|
||||||
i, colour, x, y, expected);
|
i, colour, x, y, expected);
|
||||||
}
|
}
|
||||||
|
@ -28298,6 +28306,7 @@ static void test_format_compatibility(void)
|
||||||
y = j / 4;
|
y = j / 4;
|
||||||
colour = get_readback_color(&rb, x, y, 0);
|
colour = get_readback_color(&rb, x, y, 0);
|
||||||
expected = test_data[i].success ? bitmap_data[j] : initial_data[j];
|
expected = test_data[i].success ? bitmap_data[j] : initial_data[j];
|
||||||
|
todo_wine_if(test_data[i].src_ds || test_data[i].dst_ds)
|
||||||
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
|
ok(colour == expected, "Test %u: Got unexpected colour 0x%08x at (%u, %u), expected 0x%08x.\n",
|
||||||
i, colour, x, y, expected);
|
i, colour, x, y, expected);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue