Merge "libvulkan: revert the false surface support implementation" am: cdec9919a2 am: 5de62c01e6 am: 3e6d95ef25
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1576763
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ie584fceb2241f12a83039d25d57edd576b27a461
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp
index 48090af..cb845a0 100644
--- a/vulkan/libvulkan/swapchain.cpp
+++ b/vulkan/libvulkan/swapchain.cpp
@@ -606,44 +606,9 @@
VKAPI_ATTR
VkResult GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice /*pdev*/,
uint32_t /*queue_family*/,
- VkSurfaceKHR surface_handle,
+ VkSurfaceKHR /*surface_handle*/,
VkBool32* supported) {
- ATRACE_CALL();
-
- const Surface* surface = SurfaceFromHandle(surface_handle);
- if (!surface) {
- return VK_ERROR_SURFACE_LOST_KHR;
- }
- const ANativeWindow* window = surface->window.get();
-
- int query_value;
- int err = window->query(window, NATIVE_WINDOW_FORMAT, &query_value);
- if (err != android::OK || query_value < 0) {
- ALOGE("NATIVE_WINDOW_FORMAT query failed: %s (%d) value=%d",
- strerror(-err), err, query_value);
- return VK_ERROR_SURFACE_LOST_KHR;
- }
-
- android_pixel_format native_format =
- static_cast<android_pixel_format>(query_value);
-
- bool format_supported = false;
- switch (native_format) {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_RGBA_FP16:
- case HAL_PIXEL_FORMAT_RGBA_1010102:
- format_supported = true;
- break;
- default:
- break;
- }
-
- *supported = static_cast<VkBool32>(
- format_supported || (surface->consumer_usage &
- (AHARDWAREBUFFER_USAGE_CPU_READ_MASK |
- AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK)) == 0);
-
+ *supported = VK_TRUE;
return VK_SUCCESS;
}