Przeglądaj źródła

imgui: add new config volk (#7722)

CuteLoong 1 miesiąc temu
rodzic
commit
7f4a172d2c
2 zmienionych plików z 18 dodań i 0 usunięć
  1. 12 0
      packages/i/imgui/port/xmake.lua
  2. 6 0
      packages/i/imgui/xmake.lua

+ 12 - 0
packages/i/imgui/port/xmake.lua

@@ -16,6 +16,7 @@ option("sdl3",             {showmenu = true,  default = false})
 option("sdl3_renderer",    {showmenu = true,  default = false})
 option("sdl3_gpu",         {showmenu = true,  default = false})
 option("vulkan",           {showmenu = true,  default = false})
+option("volk",             {showmenu = true,  default = false})
 option("win32",            {showmenu = true,  default = false})
 option("osx",              {showmenu = true,  default = false})
 option("wgpu",             {showmenu = true,  default = false})
@@ -45,6 +46,10 @@ if has_config("vulkan") then
     add_requires("vulkan-headers")
 end
 
+if has_config("volk") then
+    add_requires("volk")
+end
+
 if has_config("wgpu") then
     add_requires("wgpu-native")
 end
@@ -151,6 +156,13 @@ target("imgui")
         add_packages("vulkan-headers")
     end
 
+    if has_config("volk") then
+        add_files("backends/imgui_impl_vulkan.cpp")
+        add_headerfiles("(backends/imgui_impl_vulkan.h)")
+        add_packages("volk")
+        add_defines("IMGUI_IMPL_VULKAN_USE_VOLK")
+    end
+
     if has_config("win32") then
         add_files("backends/imgui_impl_win32.cpp")
         add_headerfiles("(backends/imgui_impl_win32.h)")

+ 6 - 0
packages/i/imgui/xmake.lua

@@ -104,6 +104,7 @@ package("imgui")
     add_configs("sdl3_renderer",    {description = "Enable the sdl3 renderer backend", default = false, type = "boolean"})
     add_configs("sdl3_gpu",         {description = "Enable the sdl3 gpu backend", default = false, type = "boolean"})
     add_configs("vulkan",           {description = "Enable the vulkan backend", default = false, type = "boolean"})
+    add_configs("volk",             {description = "Enable the vulkan backend, and use volk to load Vulkan functions", default = false, type = "boolean"})
     add_configs("win32",            {description = "Enable the win32 backend", default = false, type = "boolean"})
     add_configs("osx",              {description = "Enable the OS X backend", default = false, type = "boolean"})
     add_configs("wgpu",             {description = "Enable the wgpu backend", default = false, type = "boolean"})
@@ -111,6 +112,7 @@ package("imgui")
     add_configs("freetype",         {description = "Use FreeType to build and rasterize the font atlas", default = false, type = "boolean"})
     add_configs("user_config",      {description = "Use user config (disables test!)", default = nil, type = "string"})
     add_configs("wchar32",          {description = "Use 32-bit for ImWchar (default is 16-bit)", default = false, type = "boolean"})
+    
 
     -- deprecated configs (kept for backwards compatibility)
     add_configs("sdlrenderer",  {description = "(deprecated)", default = false, type = "boolean"})
@@ -166,6 +168,9 @@ package("imgui")
         if package:config("vulkan") then
             package:add("deps", "vulkan-headers")
         end
+        if package:config("volk") then
+            package:add("deps", "volk")
+        end
         if package:config("wgpu") then
             package:add("deps", "wgpu-native")
             if package:config("wgpu_backend") then
@@ -196,6 +201,7 @@ package("imgui")
             sdl3_renderer    = package:config("sdl3_renderer"),
             sdl3_gpu         = package:config("sdl3_gpu"),
             vulkan           = package:config("vulkan"),
+            volk             = package:config("volk"),
             win32            = package:config("win32"),
             osx              = package:config("osx"),
             wgpu             = package:config("wgpu"),