Skip to content

Commit 3c0650e

Browse files
Vulkan: check Maintenance1 extension availability before enabling it
1 parent 0107542 commit 3c0650e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Graphics/GraphicsEngineVulkan/src/EngineFactoryVk.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,11 +676,11 @@ void EngineFactoryVkImpl::CreateDeviceAndContextsVk(const EngineVkCreateInfo& En
676676
auto vkDevice = Instance->SelectPhysicalDevice(EngineCI.AdapterId);
677677
auto PhysicalDevice = VulkanUtilities::VulkanPhysicalDevice::Create(vkDevice, *Instance);
678678

679-
std::vector<const char*> DeviceExtensions =
680-
{
681-
VK_KHR_SWAPCHAIN_EXTENSION_NAME,
682-
VK_KHR_MAINTENANCE1_EXTENSION_NAME // To allow negative viewport height
683-
};
679+
std::vector<const char*> DeviceExtensions = {VK_KHR_SWAPCHAIN_EXTENSION_NAME};
680+
if (PhysicalDevice->IsExtensionSupported(VK_KHR_MAINTENANCE1_EXTENSION_NAME))
681+
DeviceExtensions.push_back(VK_KHR_MAINTENANCE1_EXTENSION_NAME); // To allow negative viewport height
682+
else
683+
LOG_WARNING_MESSAGE(VK_KHR_MAINTENANCE1_EXTENSION_NAME, " is not supported.");
684684

685685
// Enable device features if they are supported and throw an error if not supported, but required by user.
686686
const auto AdapterInfo = GetPhysicalDeviceGraphicsAdapterInfo(*PhysicalDevice);

0 commit comments

Comments
 (0)