Commit 384ac634 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #13425 from alalek:issue_13277

parents 82227b5a d8583b2c
...@@ -59,7 +59,7 @@ private: ...@@ -59,7 +59,7 @@ private:
int avg_pool_padded_area_; int avg_pool_padded_area_;
int need_mask_; int need_mask_;
PaddingMode padding_mode_; PaddingMode padding_mode_;
int activation_; //int activation_;
PoolShaderConfig config_; PoolShaderConfig config_;
}; };
......
...@@ -281,10 +281,14 @@ Context::~Context() ...@@ -281,10 +281,14 @@ Context::~Context()
if (enableValidationLayers) { if (enableValidationLayers) {
auto func = (PFN_vkDestroyDebugReportCallbackEXT) auto func = (PFN_vkDestroyDebugReportCallbackEXT)
vkGetInstanceProcAddr(kInstance, "vkDestroyDebugReportCallbackEXT"); vkGetInstanceProcAddr(kInstance, "vkDestroyDebugReportCallbackEXT");
if (func == nullptr) { if (func == nullptr)
throw std::runtime_error("Could not load vkDestroyDebugReportCallbackEXT"); {
CV_LOG_FATAL(NULL, "Could not load vkDestroyDebugReportCallbackEXT");
}
else
{
func(kInstance, kDebugReportCallback, NULL);
} }
func(kInstance, kDebugReportCallback, NULL);
} }
kShaders.clear(); kShaders.clear();
vkDestroyInstance(kInstance, NULL); vkDestroyInstance(kInstance, NULL);
......
...@@ -12,8 +12,9 @@ namespace cv { namespace dnn { namespace vkcom { ...@@ -12,8 +12,9 @@ namespace cv { namespace dnn { namespace vkcom {
#ifdef HAVE_VULKAN #ifdef HAVE_VULKAN
struct Context class Context
{ {
public:
Context(); Context();
~Context(); ~Context();
}; };
......
...@@ -45,7 +45,9 @@ void OpBase::initVulkanThing(int buffer_num) ...@@ -45,7 +45,9 @@ void OpBase::initVulkanThing(int buffer_num)
void OpBase::createDescriptorSetLayout(int buffer_num) void OpBase::createDescriptorSetLayout(int buffer_num)
{ {
VkDescriptorSetLayoutBinding bindings[buffer_num] = {}; if (buffer_num <= 0)
return;
std::vector<VkDescriptorSetLayoutBinding> bindings(buffer_num);
for (int i = 0; i < buffer_num; i++) for (int i = 0; i < buffer_num; i++)
{ {
bindings[i].binding = i; bindings[i].binding = i;
...@@ -56,7 +58,7 @@ void OpBase::createDescriptorSetLayout(int buffer_num) ...@@ -56,7 +58,7 @@ void OpBase::createDescriptorSetLayout(int buffer_num)
VkDescriptorSetLayoutCreateInfo info = {}; VkDescriptorSetLayoutCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
info.bindingCount = buffer_num; info.bindingCount = buffer_num;
info.pBindings = bindings; info.pBindings = &bindings[0];
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device_, &info, NULL, &descriptor_set_layout_)); VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device_, &info, NULL, &descriptor_set_layout_));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment