aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-09-25 06:45:37 +0200
committerBas Nieuwenhuizen <[email protected]>2017-09-25 15:36:19 +0200
commit3e685ec9836a274805f5e8aa146754fc3ac5d8fa (patch)
tree3db336cccd532a35a4668cbbacf05d8c8106fb27
parentbf0397b6f570754916b8e0253ac2b5f279b0a3b6 (diff)
radv: Fix VK_KHR_image_format_list.
Spec adding corner cases ... Fixes: 969537d9358 "radv: Add support for more DCC compression with VK_KHR_image_format_list." Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/vulkan/radv_image.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index c96e9e66e14..c0578ff5d3e 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -122,7 +122,9 @@ radv_init_surface(struct radv_device *device,
(const struct VkImageFormatListCreateInfoKHR *)
vk_find_struct_const(pCreateInfo->pNext,
IMAGE_FORMAT_LIST_CREATE_INFO_KHR);
- if (format_list) {
+
+ /* We have to ignore the existence of the list if viewFormatCount = 0 */
+ if (format_list && format_list->viewFormatCount) {
/* compatibility is transitive, so we only need to check
* one format with everything else. */
for (unsigned i = 0; i < format_list->viewFormatCount; ++i) {