Bug 110348

Summary: radv: Resolve attachments do not work if view format differs from image format
Product: Mesa Reporter: Philip Rebohle <philip.rebohle>
Component: Drivers/Vulkan/radeonAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Probably incomplete fix

Description Philip Rebohle 2019-04-07 21:28:14 UTC
Created attachment 143889 [details] [review]
Probably incomplete fix

Hello,

using resolve attachments where the image view format differs from the actual image format sometimes leads to incorrect or garbled results. The following renderdoc capture (recorded on Polaris 10) shows one such example:

https://mega.nz/#!FeoBSKBS!AaXSH5e_VTs05s7_xStBVB-ptbl-C_lGx7854Apel8o

Here, the image format is R16G16B16A16_UNORM, while the view format is R16G16B16A16_SFLOAT. The resolved image is garbled.

Playing around in the code, I observed the following:
- The HW path is the one that's used here and produces the broken image.
- The CS path works, but interprets image data using the image format, not the view format.
- The FS path works and uses the view format.

The attached patch fixes the problem for this sample, but more work is likely needed since radv_pick_resolve_method_images currently only takes the image format into account as well.

I'm also not sure which format should actually be used for the resolve operation; both AMDVLK and Nvidia use the image format and not the view format, which is not what I need, and it doesn't look like the Vulkan spec actually defines this.

- Philip
Comment 1 Samuel Pitoiset 2019-04-08 06:53:13 UTC
This probably needs a spec clarification?
Comment 2 Samuel Pitoiset 2019-05-29 06:56:09 UTC
No need to ask for a spec clarification actually. I think it's pretty clear that we should use the view formats for subpass resolves.

Should be fixed with https://cgit.freedesktop.org/mesa/mesa/commit/?id=017170a7859ab1a5c82e8cb5991b2bbb83d70c10

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.