mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
tests: Fix resource state transition in test_texture_copy_region().
Fixes Vulkan and D3D12 validation layers errors.
This commit is contained in:
parent
6c9aca956a
commit
3bd3e03767
@ -11746,10 +11746,9 @@ static void test_texture_copy_region(void)
|
||||
ID3D12Resource *texture_src, *texture_dst;
|
||||
D3D12_SUBRESOURCE_DATA texture_data;
|
||||
D3D12_TEXTURE_COPY_LOCATION location_src, location_dst;
|
||||
D3D12_BOX copy_box;
|
||||
struct resource_readback rb;
|
||||
HRESULT hr;
|
||||
int i, j;
|
||||
D3D12_BOX copy_box;
|
||||
unsigned int i, j;
|
||||
|
||||
static const unsigned int clear_data[] =
|
||||
{
|
||||
@ -11765,7 +11764,8 @@ static void test_texture_copy_region(void)
|
||||
0xff00ff20, 0xff00ff21, 0xff00ff22, 0xff00ff23,
|
||||
0xff00ff30, 0xff00ff31, 0xff00ff32, 0xff00ff33,
|
||||
};
|
||||
static const unsigned int result_data[] = {
|
||||
static const unsigned int result_data[] =
|
||||
{
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||
0x00000000, 0xff00ff00, 0xff00ff01, 0x00000000,
|
||||
0x00000000, 0xff00ff10, 0xff00ff12, 0x00000000,
|
||||
@ -11812,15 +11812,9 @@ static void test_texture_copy_region(void)
|
||||
copy_box.back = 1;
|
||||
|
||||
ID3D12GraphicsCommandList_CopyTextureRegion(command_list, &location_dst, 1, 1, 0, &location_src, ©_box);
|
||||
hr = ID3D12GraphicsCommandList_Close(command_list);
|
||||
ok(SUCCEEDED(hr), "Close failed, hr %#x.\n", hr);
|
||||
exec_command_list(queue, command_list);
|
||||
wait_queue_idle(device, queue);
|
||||
|
||||
transition_resource_state(command_list, texture_dst,
|
||||
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
|
||||
reset_command_list(command_list, context.allocator);
|
||||
get_texture_readback_with_command_list(texture_dst, 0, &rb, queue, command_list);
|
||||
for (i = 0; i < 4; ++i)
|
||||
{
|
||||
@ -11829,7 +11823,8 @@ static void test_texture_copy_region(void)
|
||||
unsigned int color = get_readback_uint(&rb, j, i);
|
||||
unsigned int expected = result_data[i * 4 + j];
|
||||
|
||||
ok(color == expected, "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x\n", color, j, i, expected);
|
||||
ok(color == expected, "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x\n",
|
||||
color, j, i, expected);
|
||||
}
|
||||
}
|
||||
release_resource_readback(&rb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user