Mesa (master): radv: Handle UNDEFINED format in image format list.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 10 22:33:51 UTC 2019


Module: Mesa
Branch: master
Commit: e0d12f79c5ecdbcf8437d022445fd614b7ecaa8f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e0d12f79c5ecdbcf8437d022445fd614b7ecaa8f

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sat Jun  8 23:51:16 2019 +0200

radv: Handle UNDEFINED format in image format list.

Was watching a presentation on YT where this was used and it turns
out it is not invalid.

The only case it is actually valid as format in the creation of an
image or image view is with Android Hardware Buffers which have
their format specified externally.

So we can just ignore all entries with VK_FORMAT_UNDEFINED.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/amd/vulkan/radv_image.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 777af25445c..131b6356c19 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -109,6 +109,9 @@ radv_use_tc_compat_htile_for_image(struct radv_device *device,
 			 * one format with everything else.
 			 */
 			for (unsigned i = 0; i < format_list->viewFormatCount; ++i) {
+				if (format_list->pViewFormats[i] == VK_FORMAT_UNDEFINED)
+					continue;
+
 				if (pCreateInfo->format != format_list->pViewFormats[i])
 					return false;
 			}
@@ -200,6 +203,9 @@ radv_use_dcc_for_image(struct radv_device *device,
 			/* compatibility is transitive, so we only need to check
 			 * one format with everything else. */
 			for (unsigned i = 0; i < format_list->viewFormatCount; ++i) {
+				if (format_list->pViewFormats[i] == VK_FORMAT_UNDEFINED)
+					continue;
+
 				if (!radv_dcc_formats_compatible(pCreateInfo->format,
 				                                 format_list->pViewFormats[i]))
 					dcc_compatible_formats = false;




More information about the mesa-commit mailing list