vulkan/wsi: Add a wsi_device param to get_present_modes
The Win32 WSI will want to query capabilities of the device to determine what's available. Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20945>
This commit is contained in:
@@ -461,7 +461,7 @@ wsi_swapchain_is_present_mode_supported(struct wsi_device *wsi,
|
||||
bool supported = false;
|
||||
VkResult result;
|
||||
|
||||
result = iface->get_present_modes(surface, &present_mode_count, NULL);
|
||||
result = iface->get_present_modes(surface, wsi, &present_mode_count, NULL);
|
||||
if (result != VK_SUCCESS)
|
||||
return supported;
|
||||
|
||||
@@ -469,7 +469,7 @@ wsi_swapchain_is_present_mode_supported(struct wsi_device *wsi,
|
||||
if (!present_modes)
|
||||
return supported;
|
||||
|
||||
result = iface->get_present_modes(surface, &present_mode_count,
|
||||
result = iface->get_present_modes(surface, wsi, &present_mode_count,
|
||||
present_modes);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
@@ -875,7 +875,7 @@ wsi_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice,
|
||||
struct wsi_device *wsi_device = device->wsi_device;
|
||||
struct wsi_interface *iface = wsi_device->wsi[surface->platform];
|
||||
|
||||
return iface->get_present_modes(surface, pPresentModeCount,
|
||||
return iface->get_present_modes(surface, wsi_device, pPresentModeCount,
|
||||
pPresentModes);
|
||||
}
|
||||
|
||||
|
||||
@@ -1052,6 +1052,7 @@ wsi_display_surface_get_formats2(VkIcdSurfaceBase *surface,
|
||||
|
||||
static VkResult
|
||||
wsi_display_surface_get_present_modes(VkIcdSurfaceBase *surface,
|
||||
struct wsi_device *wsi_device,
|
||||
uint32_t *present_mode_count,
|
||||
VkPresentModeKHR *present_modes)
|
||||
{
|
||||
|
||||
@@ -333,6 +333,7 @@ struct wsi_interface {
|
||||
uint32_t* pSurfaceFormatCount,
|
||||
VkSurfaceFormat2KHR* pSurfaceFormats);
|
||||
VkResult (*get_present_modes)(VkIcdSurfaceBase *surface,
|
||||
struct wsi_device *wsi_device,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes);
|
||||
VkResult (*get_present_rectangles)(VkIcdSurfaceBase *surface,
|
||||
|
||||
@@ -1112,6 +1112,7 @@ wsi_wl_surface_get_formats2(VkIcdSurfaceBase *icd_surface,
|
||||
|
||||
static VkResult
|
||||
wsi_wl_surface_get_present_modes(VkIcdSurfaceBase *surface,
|
||||
struct wsi_device *wsi_device,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes)
|
||||
{
|
||||
|
||||
@@ -326,8 +326,9 @@ static const VkPresentModeKHR present_modes[] = {
|
||||
|
||||
static VkResult
|
||||
wsi_win32_surface_get_present_modes(VkIcdSurfaceBase *surface,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes)
|
||||
struct wsi_device *wsi_device,
|
||||
uint32_t* pPresentModeCount,
|
||||
VkPresentModeKHR* pPresentModes)
|
||||
{
|
||||
if (pPresentModes == NULL) {
|
||||
*pPresentModeCount = ARRAY_SIZE(present_modes);
|
||||
|
||||
@@ -849,6 +849,7 @@ x11_surface_get_formats2(VkIcdSurfaceBase *surface,
|
||||
|
||||
static VkResult
|
||||
x11_surface_get_present_modes(VkIcdSurfaceBase *surface,
|
||||
struct wsi_device *wsi_device,
|
||||
uint32_t *pPresentModeCount,
|
||||
VkPresentModeKHR *pPresentModes)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user