diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | scripts/line_count.sh | 2 | ||||
| -rw-r--r-- | src/window.h | 1 | ||||
| -rw-r--r-- | src/window_wayland.c | 22 | ||||
| -rw-r--r-- | src/window_win32.c | 12 | ||||
| -rw-r--r-- | subprojects/libalabaster.wrap | 4 | ||||
| -rw-r--r-- | subprojects/libnaunet.wrap | 4 |
7 files changed, 37 insertions, 9 deletions
@@ -14,4 +14,3 @@ subprojects/libnaunet subprojects/libnaunet/ subprojects/wayland-protocols-*/ subprojects/wlr-protocols-*/ -tags diff --git a/scripts/line_count.sh b/scripts/line_count.sh index 6af0fe0..a6ac787 100755 --- a/scripts/line_count.sh +++ b/scripts/line_count.sh @@ -1,3 +1,3 @@ #! /usr/bin/env sh export LC_ALL="C" -find ./src ./include -type f -exec loccount {} + +find ./src ./include -type f -exec sloccount {} + diff --git a/src/window.h b/src/window.h index 35aa5f0..e293a8f 100644 --- a/src/window.h +++ b/src/window.h @@ -98,6 +98,7 @@ struct stl_window { #if defined STELA_API_VULKAN VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL (*get_vk_proc_address)(VkInstance, const char *); VkResult (*vk_create_surface)(void *, VkInstance, VkSurfaceKHR *); + VkResult (*vk_destroy_surface)(VkInstance, VkSurfaceKHR); const char *const *(*vk_get_extensions)(u32 *); #elif defined STELA_API_DX11 HWND win32_window; diff --git a/src/window_wayland.c b/src/window_wayland.c index 1c707f8..a313a08 100644 --- a/src/window_wayland.c +++ b/src/window_wayland.c @@ -1213,11 +1213,13 @@ static VkResult window_wayland_vk_create_surface(void *window, VkInstance inst, .surface = wl->surface }; - PFN_vkCreateWaylandSurfaceKHR CreateWaylandSurfaceKHR; - CreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR)get_vk_proc_address(inst, "vkCreateWaylandSurfaceKHR"); - if (!CreateWaylandSurfaceKHR) { + /* + PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR; + vkCreateWaylandSurfaceKHR = (PFN_vkCreateWaylandSurfaceKHR)get_vk_proc_address(inst, "vkCreateWaylandSurfaceKHR"); + if (!vkCreateWaylandSurfaceKHR) { return VK_ERROR_EXTENSION_NOT_PRESENT; } + */ VkResult ret = vkCreateWaylandSurfaceKHR(inst, &info, NULL, surface); if (ret != VK_SUCCESS) { @@ -1226,6 +1228,19 @@ static VkResult window_wayland_vk_create_surface(void *window, VkInstance inst, return ret; } +static VkResult window_wayland_vk_destroy_surface(VkInstance inst, VkSurfaceKHR surface) +{ + /* + PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR; + vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR)get_vk_proc_address(inst, "vkDestroySurfaceKHR"); + if (!vkDestroySurfaceKHR) { + return VK_ERROR_EXTENSION_NOT_PRESENT; + } + */ + vkDestroySurfaceKHR(inst, surface, NULL); + return VK_SUCCESS; +} + static const char *const *window_wayland_vk_get_extensions(u32 *num) { *num = 2; @@ -1283,6 +1298,7 @@ struct stl_window *stl_window_create(void) #if defined STELA_API_VULKAN wl->w.get_vk_proc_address = window_wayland_get_vk_proc_address; wl->w.vk_create_surface = window_wayland_vk_create_surface; + wl->w.vk_destroy_surface = window_wayland_vk_destroy_surface; wl->w.vk_get_extensions = window_wayland_vk_get_extensions; #elif defined STELA_API_OPENGL wl->w.get_gl_proc_address = NULL; diff --git a/src/window_win32.c b/src/window_win32.c index 6e47db6..38cf6bf 100644 --- a/src/window_win32.c +++ b/src/window_win32.c @@ -1278,6 +1278,17 @@ static VkResult window_win32_vk_create_surface(void *window, VkInstance inst, Vk return ret; } +static VkResult window_win32_vk_destroy_surface(VkInstance inst, VkSurfaceKHR surface) +{ + PFN_vkDestroySurfaceKHR DestroySurfaceKHR; + DestroySurfaceKHR = (PFN_vkDestroySurfaceKHR)GetVKProcAddress(inst, "vkDestroySurfaceKHR"); + if (!DestroySurfaceKHR) { + return VK_ERROR_EXTENSION_NOT_PRESENT; + } + DestroySurfaceKHR(inst, surface, NULL); + return VK_SUCCESS; +} + static const char *const *window_win32_vk_get_extensions(u32 *num) { *num = 2; @@ -1343,6 +1354,7 @@ struct stl_window *stl_window_create(void) #if defined STELA_API_VULKAN w32->w.get_vk_proc_address = window_win32_get_vk_proc_address; w32->w.vk_create_surface = window_win32_vk_create_surface; + w32->w.vk_destroy_surface = window_win32_vk_destroy_surface; w32->w.vk_get_extensions = window_win32_vk_get_extensions; #elif defined STELA_API_OPENGL w32->w.get_gl_proc_address = (void (*(*)(const char *))(void))GetAnyGLFuncAddress; diff --git a/subprojects/libalabaster.wrap b/subprojects/libalabaster.wrap index 425ed78..5457b48 100644 --- a/subprojects/libalabaster.wrap +++ b/subprojects/libalabaster.wrap @@ -1,4 +1,4 @@ [wrap-git] -url = https://git.akon.city/libalabaster -revision = 1aa0177d1eb3767f1a7840115c3afeb93e8c858e +url = https://git.akon.city/libalabaster.git +revision = 492f4a38f7b7f32727ab678f333eff840d968d74 depth = 1 diff --git a/subprojects/libnaunet.wrap b/subprojects/libnaunet.wrap index a069af9..57a13ac 100644 --- a/subprojects/libnaunet.wrap +++ b/subprojects/libnaunet.wrap @@ -1,4 +1,4 @@ [wrap-git] -url = https://git.akon.city/libnaunet -revision = eaf84a7850f2af70b16fb417cd002f5e39df5db2 +url = https://git.akon.city/libnaunet.git +revision = ab75884371a3545f7548498549e2faebbc465ed6 depth = 1 |