Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f64ca120 authored by Jesse Hall's avatar Jesse Hall
Browse files

libvulkan: enable scaling for all Vulkan swapchains

Change-Id: I0abe28a06dd24c317ed87270996d308411cb6fa1
(cherry picked from commit 6780552a6f17ee809ecf9b3538bbf9b666d5a160)
parent d1d5e5eb
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -335,6 +335,17 @@ VkResult CreateSwapchainKHR(VkDevice device,
        return VK_ERROR_INITIALIZATION_FAILED;
        return VK_ERROR_INITIALIZATION_FAILED;
    }
    }


    err = native_window_set_scaling_mode(
        window.get(), NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
    if (err != 0) {
        // TODO(jessehall): Improve error reporting. Can we enumerate possible
        // errors and translate them to valid Vulkan result codes?
        ALOGE("native_window_set_scaling_mode(SCALE_TO_WINDOW) failed: %s (%d)",
              strerror(-err), err);
        native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
        return VK_ERROR_INITIALIZATION_FAILED;
    }

    uint32_t min_undequeued_buffers;
    uint32_t min_undequeued_buffers;
    err = window->query(window.get(), NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS,
    err = window->query(window.get(), NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS,
                        reinterpret_cast<int*>(&min_undequeued_buffers));
                        reinterpret_cast<int*>(&min_undequeued_buffers));