From e8c602b98f60f5cafd2ce28a059fd483a54b1716 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 20 Oct 2021 15:02:38 +0100 Subject: [PATCH] Correct vulkan headers --- vendor/vulkan/_gen/create_vulkan_odin_wrapper.py | 4 ++++ vendor/vulkan/enums.odin | 2 ++ vendor/vulkan/procedures.odin | 2 ++ vendor/vulkan/structs.odin | 2 ++ 4 files changed, 10 insertions(+) diff --git a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py index 6ea2c3717..1525f4e15 100644 --- a/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py +++ b/vendor/vulkan/_gen/create_vulkan_odin_wrapper.py @@ -262,6 +262,7 @@ def parse_constants(f): def parse_enums(f): + f.write("import \"core:c\"\n\n") f.write("// Enums\n") data = re.findall(r"typedef enum Vk(\w+) {(.+?)} \w+;", src, re.S) @@ -467,6 +468,7 @@ def parse_procedures(f): max_len = max(len(n) for n, t in ff) + f.write("import \"core:c\"\n\n") f.write("// Procedure Types\n\n"); for n, t in ff: f.write("{} :: #type {}\n".format(n.ljust(max_len), t.replace('"c"', '"system"'))) @@ -587,6 +589,8 @@ MAX_GLOBAL_PRIORITY_SIZE_EXT :: 16 with open("../structs.odin", 'w', encoding='utf-8') as f: f.write(BASE) f.write(""" +import "core:c" + when ODIN_OS == "windows" { \timport win32 "core:sys/windows" diff --git a/vendor/vulkan/enums.odin b/vendor/vulkan/enums.odin index d468e7fa1..be6691ab4 100644 --- a/vendor/vulkan/enums.odin +++ b/vendor/vulkan/enums.odin @@ -3,6 +3,8 @@ // package vulkan +import "core:c" + // Enums AccelerationStructureBuildTypeKHR :: enum c.int { HOST = 0, diff --git a/vendor/vulkan/procedures.odin b/vendor/vulkan/procedures.odin index f585215e4..b40523b6d 100644 --- a/vendor/vulkan/procedures.odin +++ b/vendor/vulkan/procedures.odin @@ -3,6 +3,8 @@ // package vulkan +import "core:c" + // Procedure Types ProcAllocationFunction :: #type proc "system" (pUserData: rawptr, size: int, alignment: int, allocationScope: SystemAllocationScope) -> rawptr diff --git a/vendor/vulkan/structs.odin b/vendor/vulkan/structs.odin index ece398cde..4d90a53fa 100644 --- a/vendor/vulkan/structs.odin +++ b/vendor/vulkan/structs.odin @@ -3,6 +3,8 @@ // package vulkan +import "core:c" + when ODIN_OS == "windows" { import win32 "core:sys/windows"