mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 22:41:25 +12:00
vk/swapchain: Fix WSI swapchain configuration overrides
This commit is contained in:
parent
4e9365f76b
commit
b8411a90cd
6 changed files with 20 additions and 12 deletions
|
@ -250,8 +250,11 @@ namespace vk
|
||||||
|
|
||||||
swapchain_base* instance::create_swapchain(display_handle_t window_handle, vk::physical_device& dev)
|
swapchain_base* instance::create_swapchain(display_handle_t window_handle, vk::physical_device& dev)
|
||||||
{
|
{
|
||||||
bool force_wm_reporting_off = false;
|
WSI_config surface_config
|
||||||
m_surface = make_WSI_surface(m_instance, window_handle);
|
{
|
||||||
|
.supports_automatic_wm_reports = true
|
||||||
|
};
|
||||||
|
m_surface = make_WSI_surface(m_instance, window_handle, &surface_config);
|
||||||
|
|
||||||
u32 device_queues = dev.get_queue_count();
|
u32 device_queues = dev.get_queue_count();
|
||||||
std::vector<VkBool32> supports_present(device_queues, VK_FALSE);
|
std::vector<VkBool32> supports_present(device_queues, VK_FALSE);
|
||||||
|
@ -358,6 +361,6 @@ namespace vk
|
||||||
|
|
||||||
color_space = surfFormats[0].colorSpace;
|
color_space = surfFormats[0].colorSpace;
|
||||||
|
|
||||||
return new swapchain_WSI(dev, present_queue_idx, graphics_queue_idx, transfer_queue_idx, format, m_surface, color_space, force_wm_reporting_off);
|
return new swapchain_WSI(dev, present_queue_idx, graphics_queue_idx, transfer_queue_idx, format, m_surface, color_space, !surface_config.supports_automatic_wm_reports);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@ namespace vk
|
||||||
using swapchain_NATIVE = swapchain_ANDROID;
|
using swapchain_NATIVE = swapchain_ANDROID;
|
||||||
|
|
||||||
// TODO: Implement this
|
// TODO: Implement this
|
||||||
static
|
[[maybe_unused]] static
|
||||||
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle)
|
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle, WSI_config* /*config*/)
|
||||||
{
|
{
|
||||||
return VK_NULL_HANDLE;
|
return VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,4 +219,9 @@ namespace vk
|
||||||
return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
return VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct WSI_config
|
||||||
|
{
|
||||||
|
bool supports_automatic_wm_reports = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ namespace vk
|
||||||
using swapchain_MacOS = native_swapchain_base;
|
using swapchain_MacOS = native_swapchain_base;
|
||||||
using swapchain_NATIVE = swapchain_MacOS;
|
using swapchain_NATIVE = swapchain_MacOS;
|
||||||
|
|
||||||
static
|
[[maybe_unused]] static
|
||||||
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t handle)
|
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t handle, WSI_config* /*config*/)
|
||||||
{
|
{
|
||||||
VkSurfaceKHR result = VK_NULL_HANDLE;
|
VkSurfaceKHR result = VK_NULL_HANDLE;
|
||||||
VkMacOSSurfaceCreateInfoMVK createInfo = {};
|
VkMacOSSurfaceCreateInfoMVK createInfo = {};
|
||||||
|
|
|
@ -130,8 +130,8 @@ namespace vk
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static
|
[[maybe_unused]] static
|
||||||
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle)
|
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle, WSI_config* config)
|
||||||
{
|
{
|
||||||
VkSurfaceKHR result = VK_NULL_HANDLE;
|
VkSurfaceKHR result = VK_NULL_HANDLE;
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ namespace vk
|
||||||
createInfo.display = p.first;
|
createInfo.display = p.first;
|
||||||
createInfo.surface = p.second;
|
createInfo.surface = p.second;
|
||||||
CHECK_RESULT(vkCreateWaylandSurfaceKHR(vk_instance, &createInfo, nullptr, &result));
|
CHECK_RESULT(vkCreateWaylandSurfaceKHR(vk_instance, &createInfo, nullptr, &result));
|
||||||
force_wm_reporting_off = true;
|
config->supports_automatic_wm_reports = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -93,8 +93,8 @@ namespace vk
|
||||||
|
|
||||||
using swapchain_NATIVE = swapchain_WIN32;
|
using swapchain_NATIVE = swapchain_WIN32;
|
||||||
|
|
||||||
static
|
[[maybe_unused]] static
|
||||||
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle)
|
VkSurfaceKHR make_WSI_surface(VkInstance vk_instance, display_handle_t window_handle, WSI_config* /*config*/)
|
||||||
{
|
{
|
||||||
HINSTANCE hInstance = NULL;
|
HINSTANCE hInstance = NULL;
|
||||||
VkSurfaceKHR result = VK_NULL_HANDLE;
|
VkSurfaceKHR result = VK_NULL_HANDLE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue