int avg_pool_padded_area_;
int need_mask_;
PaddingMode padding_mode_;
- int activation_;
+ //int activation_;
PoolShaderConfig config_;
};
if (enableValidationLayers) {
auto func = (PFN_vkDestroyDebugReportCallbackEXT)
vkGetInstanceProcAddr(kInstance, "vkDestroyDebugReportCallbackEXT");
- if (func == nullptr) {
- throw std::runtime_error("Could not load vkDestroyDebugReportCallbackEXT");
+ if (func == nullptr)
+ {
+ CV_LOG_FATAL(NULL, "Could not load vkDestroyDebugReportCallbackEXT");
+ }
+ else
+ {
+ func(kInstance, kDebugReportCallback, NULL);
}
- func(kInstance, kDebugReportCallback, NULL);
}
kShaders.clear();
vkDestroyInstance(kInstance, NULL);
#ifdef HAVE_VULKAN
-struct Context
+class Context
{
+public:
Context();
~Context();
};
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++)
{
bindings[i].binding = i;
VkDescriptorSetLayoutCreateInfo info = {};
info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
info.bindingCount = buffer_num;
- info.pBindings = bindings;
+ info.pBindings = &bindings[0];
VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device_, &info, NULL, &descriptor_set_layout_));
}