From 1e9fc33c1585c4010091dd126b408d78c4118029 Mon Sep 17 00:00:00 2001 From: Unknown <0.tamas.marton@gmail.com> Date: Mon, 28 May 2018 15:35:10 +0100 Subject: [PATCH] moved extensions helpers --- driver/driver.c | 26 -------------------------- driver/vkCaps.h | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/driver/driver.c b/driver/driver.c index a85052f..7a7df38 100644 --- a/driver/driver.c +++ b/driver/driver.c @@ -95,32 +95,6 @@ typedef struct VkDevice_T int numQueues[numQueueFamilies]; } _device; -int findInstanceExtension(char* name) -{ - for(int c = 0; c < numInstanceExtensions; ++c) - { - if(strcmp(instanceExtensions[c].extensionName, name) == 0) - { - return c; - } - } - - return -1; -} - -int findDeviceExtension(char* name) -{ - for(int c = 0; c < numDeviceExtensions; ++c) - { - if(strcmp(deviceExtensions[c].extensionName, name) == 0) - { - return c; - } - } - - return -1; -} - /* * https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#vkEnumerateInstanceExtensionProperties * When pLayerName parameter is NULL, only extensions provided by the Vulkan implementation or by implicitly enabled layers are returned. When pLayerName is the name of a layer, diff --git a/driver/vkCaps.h b/driver/vkCaps.h index 7cb730f..3af3778 100644 --- a/driver/vkCaps.h +++ b/driver/vkCaps.h @@ -246,3 +246,29 @@ static VkExtensionProperties deviceExtensions[] = } }; #define numDeviceExtensions (sizeof(deviceExtensions) / sizeof(VkExtensionProperties)) + +int findInstanceExtension(char* name) +{ + for(int c = 0; c < numInstanceExtensions; ++c) + { + if(strcmp(instanceExtensions[c].extensionName, name) == 0) + { + return c; + } + } + + return -1; +} + +int findDeviceExtension(char* name) +{ + for(int c = 0; c < numDeviceExtensions; ++c) + { + if(strcmp(deviceExtensions[c].extensionName, name) == 0) + { + return c; + } + } + + return -1; +}