From a106e1cf85cbc934dc7628cd3328a8195404ce8b Mon Sep 17 00:00:00 2001 From: Steven Le Rouzic Date: Tue, 21 Jan 2025 00:04:32 +0100 Subject: Add Vulkan 1.3 headers --- game/BUILD.bazel | 1 + game/main.cpp | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'game') diff --git a/game/BUILD.bazel b/game/BUILD.bazel index 753a77a..1f59b90 100644 --- a/game/BUILD.bazel +++ b/game/BUILD.bazel @@ -6,5 +6,6 @@ cc_binary( deps = [ "@asl//asl", "@sdl3_windows//:sdl3", + "//vendor/vulkan", ], ) diff --git a/game/main.cpp b/game/main.cpp index 46f08f0..c78c41e 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -1,7 +1,14 @@ #include +#include #include #include +#include + +#define VK_NO_STDDEF_H +#define VK_NO_STDINT_H +#define VK_NO_PROTOTYPES +#include int SDL_main(int /* argc */, char* /* argv */[]) { @@ -10,6 +17,26 @@ int SDL_main(int /* argc */, char* /* argv */[]) SDL_ShowWindow(window); + asl::buffer instance_extensions; + asl::buffer device_extensions; + asl::buffer layers; + + { + uint32_t count = 0; + const char* const* extensions = SDL_Vulkan_GetInstanceExtensions(&count); + for (uint32_t i = 0; i < count; ++i) + { + instance_extensions.push(extensions[i]); // NOLINT(*-pointer-arithmetic) + } + } + + layers.push("VK_LAYER_KHRONOS_validation"); + layers.push("VK_LAYER_LUNARG_monitor"); + + instance_extensions.push(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); + + device_extensions.push(VK_KHR_SWAPCHAIN_EXTENSION_NAME); + bool running = true; while (running) { -- cgit