diff options
| author | Nairo Martins <94945970+pelicanux@users.noreply.github.com> | 2026-11-21 02:35:54 -0300 |
|---|---|---|
| committer | Nairo Martins <94945970+pelicanux@users.noreply.github.com> | 2026-11-21 02:35:54 -0300 |
| commit | 4146672f589ef8ae9b342ae7b0915cb9205e7ebb (patch) | |
| tree | f82703b99b20ca10f5d92ec795844f01bf976b84 /runtime/test/vk_harness.cpp | |
| parent | 56f023a10a726da20702d4e121656ceda2391d93 (diff) | |
Vulkan tools: fix builds on Linux
Diffstat (limited to 'runtime/test/vk_harness.cpp')
| -rw-r--r-- | runtime/test/vk_harness.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/runtime/test/vk_harness.cpp b/runtime/test/vk_harness.cpp index 9835c5469..bd61fa3f0 100644 --- a/runtime/test/vk_harness.cpp +++ b/runtime/test/vk_harness.cpp | |||
| @@ -3,10 +3,8 @@ | |||
| 3 | // | 3 | // |
| 4 | // vk_harness <vs.spv> <fs.spv> <out.raw> [width height] | 4 | // vk_harness <vs.spv> <fs.spv> <out.raw> [width height] |
| 5 | // | 5 | // |
| 6 | // Vulkan is loaded at runtime from vulkan-1.dll (no SDK import library needed). | ||
| 7 | #define VK_NO_PROTOTYPES | 6 | #define VK_NO_PROTOTYPES |
| 8 | #include <vulkan/vulkan.h> | 7 | #include "vulkan_loader.h" |
| 9 | #include <windows.h> | ||
| 10 | 8 | ||
| 11 | #include <cstdio> | 9 | #include <cstdio> |
| 12 | #include <cstdlib> | 10 | #include <cstdlib> |
| @@ -39,9 +37,8 @@ int main(int argc, char** argv) { | |||
| 39 | return 2; | 37 | return 2; |
| 40 | } | 38 | } |
| 41 | uint32_t W = argc > 5 ? atoi(argv[4]) : 64, H = argc > 5 ? atoi(argv[5]) : 64; | 39 | uint32_t W = argc > 5 ? atoi(argv[4]) : 64, H = argc > 5 ? atoi(argv[5]) : 64; |
| 42 | HMODULE lib = LoadLibraryA("vulkan-1.dll"); | 40 | gipa = load_vulkan(); |
| 43 | if (!lib) { std::fprintf(stderr, "no vulkan-1.dll\n"); return 1; } | 41 | if (!gipa) return 1; |
| 44 | gipa = reinterpret_cast<PFN_vkGetInstanceProcAddr>(GetProcAddress(lib, "vkGetInstanceProcAddr")); | ||
| 45 | VkInstance inst = VK_NULL_HANDLE; | 42 | VkInstance inst = VK_NULL_HANDLE; |
| 46 | LOADI(vkCreateInstance); | 43 | LOADI(vkCreateInstance); |
| 47 | VkApplicationInfo app{VK_STRUCTURE_TYPE_APPLICATION_INFO}; | 44 | VkApplicationInfo app{VK_STRUCTURE_TYPE_APPLICATION_INFO}; |