On Thu, 1 Jul 2021 at 14:37, Conor McCarthy <cmccarthy(a)codeweavers.com> wrote:
+ for (i = 0; i < resource_desc.Width * resource_desc.Height; ++i) + upload_buffer[i] = 0xdeadbeef; + texture_data.SlicePitch = texture_data.RowPitch * resource_desc.Height; + reset_command_list(command_list, context.allocator); + /* Write data to the first texture to check if the second is overwritten. + * Resource overlap may still go undetected depending on the actual layout + * used by the driver. */ + upload_texture_data(textures[0], &texture_data, 1, queue, command_list); + + 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_texture_readback_with_command_list(textures[1], 0, &rb, queue, command_list); + for (y = 0; y < resource_desc.Height; ++y) + { + for (x = 0; x < resource_desc.Width; ++x) + { + i = get_readback_uint(&rb, x, y, 0); + ok(i == 0xcafef00d, "Expected 0xcafef00d, got %#x at %u, %u.\n", i, x, y); + } + } + release_resource_readback(&rb); + We'll want to use check_sub_resource_uint() here.
Is this test missing a todo_if()? The returned alignment is 64 KiB here on all my systems, so I can't test the actual issue, but presumably the test is supposed to fail on setups that do require larger alignments. Or is this succeeding because we fall back to a separate allocation in vkd3d_bind_heap_memory()? In that case though: - Why is that a problem for the actual application? - We may be able to detect that by aliasing multiple resources to the same heap offset.