summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tom Murphy <tomnom@google.com> 2024-08-27 13:15:08 +0000
committer Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2024-09-02 09:32:37 +0000
commit7e7812eda2e60f269808e04b51fdfff4832647ab (patch)
treec532c805a61db91129a56690b896293c4d85808b
parent16fbe775c0fe5b57bd96b3122d690d7c34da9ed9 (diff)
Fix GetPhysicalDeviceSurfaceFormats2KHR for compression control struct handling
As per the spec, vkGetPhysicalDeviceImageFormatProperties2 may return VK_ERROR_FORMAT_NOT_SUPPORTED when an invalid combination of parameters appears in VkPhysicalDeviceImageFormatInfo2 pImageFormatInfo argument which is not handled by the loader. i.e.. loader doesn't loop through all surface formats Fix this by correctly handling vkGetPhysicalDeviceImageFormatProperties2 return value Test: Working separately on testing strategy for this: 357903074 Bug: 357903074 Flag: EXEMPT bugfix (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a920d2d6dcc97331a8fffe3a2584eb30b890005e) (cherry picked from https://android-review.googlesource.com/q/commit:e5b150b8cc340c23fa6dd3e7e7b648c6493836df) Merged-In: Id0712387e3249ac6118990441a4bb19102cd4a84 Change-Id: Id0712387e3249ac6118990441a4bb19102cd4a84
-rw-r--r--vulkan/libvulkan/swapchain.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp
index 13141933ac..f15fe4d653 100644
--- a/vulkan/libvulkan/swapchain.cpp
+++ b/vulkan/libvulkan/swapchain.cpp
@@ -1225,8 +1225,15 @@ VkResult GetPhysicalDeviceSurfaceFormats2KHR(
surfaceCompressionProps
->imageCompressionFixedRateFlags =
compressionProps.imageCompressionFixedRateFlags;
- } else {
+ } else if (compressionRes ==
+ VK_ERROR_OUT_OF_HOST_MEMORY ||
+ compressionRes ==
+ VK_ERROR_OUT_OF_DEVICE_MEMORY) {
return compressionRes;
+ } else {
+ // For any of the *_NOT_SUPPORTED errors we continue
+ // onto the next format
+ continue;
}
}
} break;