filament
filament copied to clipboard
SSAO Anomaly With Vulkan
Describe the bug
After updating to v1.15.1 from 1.9.19 I noticed in my application that with the Vulkan backend (which Filament now selects by default) that SSAO was unstable with a shimmering rendering anomaly. The intensity of the anomaly depends on whether or not half resolution is selected or not. I confirmed running Filament's gltf_viewer sample that the Vulkan backend had the same unstable anomaly. The anomaly is not present when running with OpenGL backend.
To Reproduce
Run gltf_viewer. On my system it defaults to Vulkan backend which exhibits the SSAO 'shimmering' anomaly. Running gltf_viewer -a opengl the SSAO effect is stable.
Expected behavior No SSAO anomaly with Vulkan backend.
Screenshots
SSAO unstable with Vulkan:

SSAO stable with OpenGL:

Logs If applicable, copy logs from your console here. Please do not use screenshots of logs, copy them as text.
Desktop (please complete the following information):
- OS: Ubuntu 18.04
- GPU: Nvidia GeForce RTX 2060, driver 495.44
- Backend: Vulkan
This seems to be caused by VK_ATTACHMENT_STORE_OP_DONT_CARE being set for the depth attachments in the ssao/blur passes.
Manually setting this in the RenderPassInfo in the ssao and blur passes before the render call fixes it, but it feels like a hack... ssao.params.flags.discardEnd &= ~TargetBufferFlags::DEPTH;
@errissa would you mind providing the console output for gltf_viewer with the device driver and physical device info? In my console, it reads like
Vulkan device driver: radv Mesa 22.2.0
Selected physical device 'AMD Radeon Pro WX 3200 Series (RADV POLARIS12)' from 2 physical devices. (vendor 0x1002, device 0x6981, driver 0x5802000, api 1.3)
I was not able to repro using two different AMD drivers.
@poweifeng I'm currently busy with other work but I will test this again with the latest Filament and report what I find within a week or so. In the meantime, if it's helpful, I was on an Nvidia RTX 2060 with the 495.44 driver when I reported this issue.
Can confirm this on an NV RTX 2060 on Windows 10 too. May be related to #6216 ?
Duplicate of #6216
Duplicate of #6216
No its not (as you seem to have correctly identified now) - its a separate issue. See what was posted by cg-co above:
This seems to be caused by VK_ATTACHMENT_STORE_OP_DONT_CARE being set for the depth attachments in the ssao/blur passes.