mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07: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;
|
ID3D12Resource *texture_src, *texture_dst;
|
||||||
D3D12_SUBRESOURCE_DATA texture_data;
|
D3D12_SUBRESOURCE_DATA texture_data;
|
||||||
D3D12_TEXTURE_COPY_LOCATION location_src, location_dst;
|
D3D12_TEXTURE_COPY_LOCATION location_src, location_dst;
|
||||||
D3D12_BOX copy_box;
|
|
||||||
struct resource_readback rb;
|
struct resource_readback rb;
|
||||||
HRESULT hr;
|
D3D12_BOX copy_box;
|
||||||
int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
static const unsigned int clear_data[] =
|
static const unsigned int clear_data[] =
|
||||||
{
|
{
|
||||||
@ -11765,7 +11764,8 @@ static void test_texture_copy_region(void)
|
|||||||
0xff00ff20, 0xff00ff21, 0xff00ff22, 0xff00ff23,
|
0xff00ff20, 0xff00ff21, 0xff00ff22, 0xff00ff23,
|
||||||
0xff00ff30, 0xff00ff31, 0xff00ff32, 0xff00ff33,
|
0xff00ff30, 0xff00ff31, 0xff00ff32, 0xff00ff33,
|
||||||
};
|
};
|
||||||
static const unsigned int result_data[] = {
|
static const unsigned int result_data[] =
|
||||||
|
{
|
||||||
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
0x00000000, 0x00000000, 0x00000000, 0x00000000,
|
||||||
0x00000000, 0xff00ff00, 0xff00ff01, 0x00000000,
|
0x00000000, 0xff00ff00, 0xff00ff01, 0x00000000,
|
||||||
0x00000000, 0xff00ff10, 0xff00ff12, 0x00000000,
|
0x00000000, 0xff00ff10, 0xff00ff12, 0x00000000,
|
||||||
@ -11812,15 +11812,9 @@ static void test_texture_copy_region(void)
|
|||||||
copy_box.back = 1;
|
copy_box.back = 1;
|
||||||
|
|
||||||
ID3D12GraphicsCommandList_CopyTextureRegion(command_list, &location_dst, 1, 1, 0, &location_src, ©_box);
|
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,
|
transition_resource_state(command_list, texture_dst,
|
||||||
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
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);
|
get_texture_readback_with_command_list(texture_dst, 0, &rb, queue, command_list);
|
||||||
for (i = 0; i < 4; ++i)
|
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 color = get_readback_uint(&rb, j, i);
|
||||||
unsigned int expected = result_data[i * 4 + j];
|
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);
|
release_resource_readback(&rb);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user