Skip to content

Commit

Permalink
Sanity checks in InitSwapchain
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed May 4, 2023
1 parent 1bd7da2 commit 38178d3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Common/GPU/Vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,12 @@ static std::string surface_transforms_to_string(VkSurfaceTransformFlagsKHR trans
}

bool VulkanContext::InitSwapchain() {
_assert_(physical_device_ >= 0 && physical_device_ < physical_devices_.size());
if (!surface_) {
ERROR_LOG(G3D, "VK: No surface, can't create swapchain");
return false;
}

VkResult res = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physical_devices_[physical_device_], surface_, &surfCapabilities_);
if (res == VK_ERROR_SURFACE_LOST_KHR) {
// Not much to do.
Expand Down

0 comments on commit 38178d3

Please sign in to comment.