tests: Transition texture state to inherit aliased data.

When textures[1] is read for the second time it is aliased to
textures[0]. But textures[0] was left in COPY_DEST state (since
its creation), and textures[1] is currently recreated in COPY_SOURCE
state, which AFAIU is invalid. So recreate textures[1] in COPY_DEST
state and then transition it before reading it.
This commit is contained in:
Giovanni Mascellani
2025-03-14 10:11:20 +01:00
committed by Henri Verbeet
parent c3f01d7db9
commit 44072062ff
Notes: Henri Verbeet 2025-03-17 15:29:57 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1429

View File

@@ -32892,11 +32892,13 @@ static void test_64kb_texture_alignment(void)
ID3D12Resource_Release(textures[1]);
/* Create an aliased texture. */
hr = ID3D12Device_CreatePlacedResource(device, heap, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT,
&resource_desc, D3D12_RESOURCE_STATE_COPY_SOURCE, NULL, &IID_ID3D12Resource, (void **)&textures[1]);
&resource_desc, D3D12_RESOURCE_STATE_COPY_DEST, NULL, &IID_ID3D12Resource, (void **)&textures[1]);
ok(hr == S_OK, "Failed to create placed resource, hr %#x.\n", hr);
/* If the heap could not be used, the texture is not aliased. */
reset_command_list(command_list, context.allocator);
transition_resource_state(command_list, textures[1],
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COPY_SOURCE);
get_resource_readback_with_command_list(textures[1], 0, &rb, queue, command_list);
check_readback_data_uint(&rb.rb, &box, 0xdeadbeef, 0);
release_resource_readback(&rb);