Bug 110348 - radv: Resolve attachments do not work if view format differs from image format
Summary: radv: Resolve attachments do not work if view format differs from image format
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Vulkan/radeon (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-07 21:28 UTC by Philip Rebohle
Modified: 2019-05-29 06:56 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Probably incomplete fix (3.14 KB, patch)
2019-04-07 21:28 UTC, Philip Rebohle
Details | Splinter Review

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.