]> O.S.I.I.S - jp/vkhelpers.git/commitdiff
add vulkan api major, minor to vkh_app create
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 19 Dec 2021 03:24:18 +0000 (04:24 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sun, 19 Dec 2021 03:24:18 +0000 (04:24 +0100)
include/vkh.h
src/vkh_app.c

index 51f13edfc6ef51937889794541c7ce5b113b0e2c..3f8acdaab997407528bf361ffa4fb9c4ceb02fe5 100644 (file)
@@ -67,7 +67,8 @@ typedef struct _vkh_presenter_t* VkhPresenter;
 /*************
  * VkhApp    *
  *************/
-VkhApp              vkh_app_create      (const char* app_name, uint32_t enabledLayersCount, const char **enabledLayers, uint32_t ext_count, const char* extentions[]);
+VkhApp              vkh_app_create      (uint32_t version_major, uint32_t version_minor,
+                                                                                const char* app_name, uint32_t enabledLayersCount, const char **enabledLayers, uint32_t ext_count, const char* extentions[]);
 void                vkh_app_destroy     (VkhApp app);
 VkInstance          vkh_app_get_inst    (VkhApp app);
 //VkPhysicalDevice    vkh_app_select_phy  (VkhApp app, VkPhysicalDeviceType preferedPhyType);
index e94a2305df51bcab756685e4371071d3947e9270..f486b0cadd7ee440a2348f193492ae8602e68ea1 100644 (file)
@@ -63,7 +63,7 @@ VkBool32 debugUtilsMessengerCallback (
        return VK_FALSE;
 }
 
-VkhApp vkh_app_create (const char* app_name, uint32_t enabledLayersCount, const char** enabledLayers, uint32_t ext_count, const char* extentions[]) {
+VkhApp vkh_app_create (uint32_t version_major, uint32_t version_minor, const char* app_name, uint32_t enabledLayersCount, const char** enabledLayers, uint32_t ext_count, const char* extentions[]) {
        VkhApp app = (VkhApp)malloc(sizeof(vkh_app_t));
 
        VkApplicationInfo infos = { .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
@@ -71,7 +71,7 @@ VkhApp vkh_app_create (const char* app_name, uint32_t enabledLayersCount, const
                                                                .applicationVersion = 1,
                                                                .pEngineName = ENGINE_NAME,
                                                                .engineVersion = ENGINE_VERSION,
-                                                               .apiVersion = VK_API_VERSION_1_1};
+                                                               .apiVersion = VK_MAKE_API_VERSION (0, version_major, version_minor, 0)};
 
        VkInstanceCreateInfo inst_info = { .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
                                                                           .pApplicationInfo = &infos,