anv: Add anv_image_plane_needs_shadow_surface() (v2)
authorChad Versace <chadversary@chromium.org>
Fri, 1 Nov 2019 23:04:26 +0000 (16:04 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 6 Mar 2020 23:40:41 +0000 (23:40 +0000)
commitd1b7d80bc358749a4234587e1fda66596f4dd579
treee79c350a96e007bbf870d28e1c955bb84263f0c0
parent1da6b7f8a3b13f44e8d9cc101034319c0b732f08
anv: Add anv_image_plane_needs_shadow_surface() (v2)

The function returns true if hardware limitations require the image
plane to use a shadow surface. It replaces equivalent code in
make_surface().

Refactor only. No intended change in behavior.

Why extract this code out of vkCreateImage? If an image requires
a shadow surface, then that may impact its support for DRM format
modifiers, which must be evaluated during
vkGetPhysicalDeviceImageFormatProperties2.

v2:
  - Use early return. [for jekstrand]
  - Unexport function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4096>
src/intel/vulkan/anv_image.c