[Intel][Vulkan][Gen12] vkCmdCopyImage() generates garbage data when the destination texture is bound to a piece of used device memory
On Intel Gen12 GPUs using latest Mesa Vulkan driver drivervkCmdCopyImage() will bring garbage data to the destination texture when the destination texture is bound to a piece of used device memory.
Steps to reproduce:
- On Intel Gen12 GPUs using latest Mesa Vulkan driver, download and unzip the attached file CopyTest.zip.
OS: Ubuntu 22.10 Mesa: 22.2.5 Device Name: Intel(R) Xe Graphics (TGL GT2) (device ID: 0x9A49)
- Run ./VulkanTest Or you can build it from the source file vulkan_test.cc by below steps:
(1) Install latest Vulkan SDK and libglfw3-dev (2) Run the attached batch file ./compile.sh
On Intel Gen12 GPUs, the output is wrong:
Create instance success
Device count: 2
Device name: Intel(R) Xe Graphics (TGL GT2) (device ID: 0x9A49)
Create graphics queue success
1 copy starts.
readbackBuffer size: 33548
First 20 bytes in readbackBuffer after 1 copy:
0 0 0 0 1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0
2 copy starts.
readbackBuffer size: 4896
First 20 bytes in readbackBuffer after 2 copy:
255 255 255 255 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
The application exits successfully.
On AMD GPUs (RADV VEGA M (LLVM 8.0.0)(device ID: 0x694C)) and Intel Gen9 GPUs (HD Graphics 630 (Kaby Lake GT2)(device ID: 0x591B), UHD Graphics 630 (Coffee Lake GT2)(device ID: 0x3E92)) the output is correct:
Create instance success
Device count: 2
Device name: Intel(R) HD Graphics 630 (Kaby Lake GT2) (device ID: 0x591B)
Create graphics queue success
1 copy starts.
readbackBuffer size: 33548
First 20 bytes in readbackBuffer after 1 copy:
0 0 0 0 1 2 3 4 5 6 7 8 0 0 0 0 0 0 0 0
2 copy starts.
readbackBuffer size: 4896
First 20 bytes in readbackBuffer after 2 copy:
0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
The application exits successfully.
Edited by Shao Jiawei