mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
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:
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
@@ -32892,11 +32892,13 @@ static void test_64kb_texture_alignment(void)
|
|||||||
ID3D12Resource_Release(textures[1]);
|
ID3D12Resource_Release(textures[1]);
|
||||||
/* Create an aliased texture. */
|
/* Create an aliased texture. */
|
||||||
hr = ID3D12Device_CreatePlacedResource(device, heap, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT,
|
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);
|
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. */
|
/* If the heap could not be used, the texture is not aliased. */
|
||||||
reset_command_list(command_list, context.allocator);
|
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);
|
get_resource_readback_with_command_list(textures[1], 0, &rb, queue, command_list);
|
||||||
check_readback_data_uint(&rb.rb, &box, 0xdeadbeef, 0);
|
check_readback_data_uint(&rb.rb, &box, 0xdeadbeef, 0);
|
||||||
release_resource_readback(&rb);
|
release_resource_readback(&rb);
|
||||||
|
Reference in New Issue
Block a user