From 4d138fa0acfd1a4e15b10821f6f1aa1273ad320d Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 28 Oct 2020 19:49:47 +0800 Subject: [PATCH] add enable PushDescriptor ext. --- src/RenderDevice/VKDeviceCreater.cpp | 8 +++++--- src/RenderDevice/VKInstance.cpp | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/RenderDevice/VKDeviceCreater.cpp b/src/RenderDevice/VKDeviceCreater.cpp index 012ae7f9..dd115b79 100644 --- a/src/RenderDevice/VKDeviceCreater.cpp +++ b/src/RenderDevice/VKDeviceCreater.cpp @@ -28,7 +28,9 @@ namespace queue_info.flags=0; //如果这里写VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT,会导致vkGetDeviceQueue调用崩溃 VkDeviceCreateInfo create_info={}; - const char *ext_list[1]={VK_KHR_SWAPCHAIN_EXTENSION_NAME}; + CharPointerList ext_list; + ext_list.Add(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + ext_list.Add(VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME); VkPhysicalDeviceFeatures features={}; features.geometryShader=true; @@ -37,8 +39,8 @@ namespace create_info.pNext=nullptr; create_info.queueCreateInfoCount=1; create_info.pQueueCreateInfos=&queue_info; - create_info.enabledExtensionCount=1; - create_info.ppEnabledExtensionNames=ext_list; + create_info.enabledExtensionCount=ext_list.GetCount(); + create_info.ppEnabledExtensionNames=ext_list.GetData(); create_info.enabledLayerCount=0; create_info.ppEnabledLayerNames=nullptr; create_info.pEnabledFeatures=&features; diff --git a/src/RenderDevice/VKInstance.cpp b/src/RenderDevice/VKInstance.cpp index bc87b452..f1a3336e 100644 --- a/src/RenderDevice/VKInstance.cpp +++ b/src/RenderDevice/VKInstance.cpp @@ -31,7 +31,12 @@ VulkanInstance *CreateInstance(const AnsiString &app_name,VKDebugOut *out,Create #endif//_DEBUG if(layer_info) + { + if(layer_info->khronos.validation) + ext_list.Add(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + CheckInstanceLayer(layer_list,layer_info); + } inst_info.enabledExtensionCount = ext_list.GetCount(); inst_info.ppEnabledExtensionNames = ext_list.GetData();