From fb18b96960692f760419324e18bd4eee61e31d3e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Sun, 30 Oct 2022 11:22:03 +0100 Subject: update to vk 1.3, changed libdl -> dlib for pinvoke name --- Directory.Build.props | 6 +++--- Vulkan-Docs | 2 +- vk.generator/Program.cs | 10 +++++++++- vulkan/Libdl.cs | 8 ++++---- vulkan/Utils.cs | 12 ++++++------ vulkan/vulkan.csproj | 4 ++-- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index a53c9d5..f7e6528 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,10 +21,10 @@ this implies that a loop for the enumerable on each set. AutoSetSType = FALSE - Use the New static property to create a new instance of the structure with the correct value for sType. - ex: VkInstanceCreateInfo ci = VkInstanceCreateInfo.New; + Use the `New` static property to create a new instance of the structure with the correct value for sType. + ex: `VkInstanceCreateInfo ci = VkInstanceCreateInfo.New;` --> - true + false diff --git a/Vulkan-Docs b/Vulkan-Docs index d70e01c..7dcf16f 160000 --- a/Vulkan-Docs +++ b/Vulkan-Docs @@ -1 +1 @@ -Subproject commit d70e01c0be7b8a7d20b186b30b29a75b18bba75d +Subproject commit 7dcf16f3b4a1118ff92207316b68145446f08bb3 diff --git a/vk.generator/Program.cs b/vk.generator/Program.cs index ba2fbab..3b2dba9 100644 --- a/vk.generator/Program.cs +++ b/vk.generator/Program.cs @@ -177,7 +177,15 @@ namespace vk.generator { { "StdVideoH264ProfileIdc","IntPtr" }, { "VkRemoteAddressNV","IntPtr" }, - { "CAMetalLayer", "IntPtr" } + { "CAMetalLayer", "IntPtr" }, + + { "MTLDevice_id", "IntPtr"}, + { "MTLCommandQueue_id", "IntPtr"}, + { "MTLBuffer_id", "IntPtr"}, + { "MTLTexture_id", "IntPtr"}, + { "MTLSharedEvent_id", "IntPtr"}, + + { "IOSurfaceRef", "IntPtr"}, }; static string[] reservedNames = { "event", "object" }; diff --git a/vulkan/Libdl.cs b/vulkan/Libdl.cs index ffd278b..6fe0d13 100644 --- a/vulkan/Libdl.cs +++ b/vulkan/Libdl.cs @@ -8,16 +8,16 @@ namespace Vulkan { internal static class Libdl { - [DllImport("libdl")] + [DllImport("dlib")] public static extern IntPtr dlopen(string fileName, int flags); - [DllImport("libdl")] + [DllImport("dlib")] public static extern IntPtr dlsym(IntPtr handle, string name); - [DllImport("libdl")] + [DllImport("dlib")] public static extern int dlclose(IntPtr handle); - [DllImport("libdl")] + [DllImport("dlib")] public static extern string dlerror(); public const int RTLD_NOW = 0x002; diff --git a/vulkan/Utils.cs b/vulkan/Utils.cs index 9744b5f..84e4e64 100644 --- a/vulkan/Utils.cs +++ b/vulkan/Utils.cs @@ -43,16 +43,16 @@ namespace Vulkan { phy = default; return false; } - public static VkPhysicalDeviceToolPropertiesEXT[] GetToolProperties (VkPhysicalDevice phy) { - CheckResult (vkGetPhysicalDeviceToolPropertiesEXT (phy , out uint count, IntPtr.Zero)); - int sizeStruct = Marshal.SizeOf (); + public static VkPhysicalDeviceToolProperties[] GetToolProperties (VkPhysicalDevice phy) { + CheckResult (vkGetPhysicalDeviceToolProperties (phy , out uint count, IntPtr.Zero)); + int sizeStruct = Marshal.SizeOf (); IntPtr ptrTools = Marshal.AllocHGlobal (sizeStruct * (int)count); - CheckResult (vkGetPhysicalDeviceToolPropertiesEXT (phy , out count, ptrTools)); + CheckResult (vkGetPhysicalDeviceToolProperties (phy , out count, ptrTools)); - VkPhysicalDeviceToolPropertiesEXT[] result = new VkPhysicalDeviceToolPropertiesEXT[count]; + VkPhysicalDeviceToolProperties[] result = new VkPhysicalDeviceToolProperties[count]; IntPtr tmp = ptrTools; for (int i = 0; i < count; i++) { - result[i] = Marshal.PtrToStructure (tmp); + result[i] = Marshal.PtrToStructure (tmp); tmp += sizeStruct; } diff --git a/vulkan/vulkan.csproj b/vulkan/vulkan.csproj index 798bfc0..f90c5cb 100644 --- a/vulkan/vulkan.csproj +++ b/vulkan/vulkan.csproj @@ -3,9 +3,9 @@ netstandard2.1 - 0.4.1 + 0.4.2 Vulkan - $(AssemblyVersion)-beta + $(AssemblyVersion) Low level vulkan bindings for .net Vulkan -- cgit v1.3.1-4-g156e