radv: check VkMemoryDedicatedRequirements before bind image memory
Background
Since the bo metadata is not set for un-dedicated images, so the use cases that try to import un-dedicated buffer would fail. For example, Vulkan-Samples test case open_gl_interop create an un-dedicated image in vulkan and radeonsi try to import this image using RADEON_SURF_MODE_LINEAR_ALIGNED tiling mode by default. But the result is incorrect because of the unmatched swizzleMode.
So this MR is more to discuss if this is a possible way to handle this use case.
Implementation
- Radv would create VK_IMAGE_TILING_OPTIMAL image by default, but setting the TexParameter TEXTURE_TILING_EXT would change templ->bind, so this call si_choose_tiling to select tiling mode according to templ->bind in si_texture_from_winsys_buffer().
- Since for un-dedicated image, surface dcc info can't be synchronized from metadata and vulkan would also disable dcc for both of shareable linear image and optimal image, this set DISABLE_DCC for this imported surface.
- get_preferred_swizzle_mode for the surface of imported un-dedicated image.
v1->v2 changes
- Add checking dedicate requirements in radv.
- Drop previous implementation of choosing tile mode for undedicated memobj.
Edited by Julia Zhang