From 44072062ffdcfea7aeb972d0fc2b7d302b2b85e9 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 14 Mar 2025 10:11:20 +0100 Subject: [PATCH] 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. --- tests/d3d12.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index cfba61b2..a76ff725 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -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);