[RADV] vkCmdClearAttachments does not clear color attachment when fast clears are enabled on Vega
This bug is related to #3314 (closed)
This bug was found in the OpenXR conformance tests and can be reproduced with this minimal Vulkan OpenXR example. You can find a build system for this minimal example in it's repository.
System
linux 5.7.10
mesa 20.1.4
vulkan 1.2.147
Affected hardware and behavior on other drivers
I was only able to reproduce this bug on RX580, Vega integrated and Vega 64, while it does not occur on Navi 10 (RX5700XT). The bug does occur on amdvlk on these cards.
The bug does not occur on Intel and NVIDIA.
I am able to get similar behaviour on Navi when I comment clearing of the color attachment in vkCmdClearAttachments
.
Workarounds
Disabling fast clears by setting RADV_DEBUG=nofastclears
resolves the issue.
Clearing the color attachment by setting the clear color in VkRenderPassBeginInfo
and setting VK_ATTACHMENT_LOAD_OP_CLEAR on the color attachment also resolves the issue.
Running the example
Unfortunately this example is only reproducible when using the OpenXR API and the Monado runtime. No VR hardware is required to reproduce the issue.
You will also need the OpenXR Loader.
Build Monado and start the service
git clone https://gitlab.freedesktop.org/monado/monado.git
cd monado
meson build
ninja -C build
XRT_COMPOSITOR_FORCE_XCB=TRUE ./build/src/xrt/targets/service/monado-service
Build and run the example
git clone https://gitlab.freedesktop.org/lubosz/amd-vk-bugs.git
cd amd-vk-bugs
cmake . -G Ninja -B build
ninja -C build
XR_RUNTIME_JSON=/path/to/monado/build/openxr_monado-dev.json ./build/fastclears