Skip to content

Commit

Permalink
Check if VK_EXT_layer_settings is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Dec 15, 2024
1 parent 15e24a8 commit 12bbe18
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lvk/vulkan/VulkanClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5799,6 +5799,7 @@ void lvk::VulkanContext::createInstance() {
#endif
};

#if defined(VK_EXT_layer_settings) && VK_EXT_layer_settings
// https://github.com/KhronosGroup/MoltenVK/blob/main/Docs/MoltenVK_Configuration_Parameters.md
const int useMetalArgumentBuffers = 1;
const VkBool32 gpuav_descriptor_checks = VK_FALSE; // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/8688
Expand All @@ -5820,6 +5821,7 @@ void lvk::VulkanContext::createInstance() {
.settingCount = (uint32_t)LVK_ARRAY_NUM_ELEMENTS(settings),
.pSettings = settings,
};
#endif // defined(VK_EXT_layer_settings) && VK_EXT_layer_settings

const VkApplicationInfo appInfo = {
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
Expand All @@ -5837,7 +5839,11 @@ void lvk::VulkanContext::createInstance() {
#endif
const VkInstanceCreateInfo ci = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
#if defined(VK_EXT_layer_settings) && VK_EXT_layer_settings
.pNext = &layerSettingsCreateInfo,
#else
.pNext = config_.enableValidation ? &features : nullptr,
#endif // defined(VK_EXT_layer_settings) && VK_EXT_layer_settings
.flags = flags,
.pApplicationInfo = &appInfo,
.enabledLayerCount = config_.enableValidation ? (uint32_t)LVK_ARRAY_NUM_ELEMENTS(kDefaultValidationLayers) : 0u,
Expand Down

0 comments on commit 12bbe18

Please sign in to comment.