@@ -11299,7 +11299,7 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
1129911299 ],
1130011300 MinVersion = "1.0"
1130111301 )]
11302- public static extern Result CreateDevice (
11302+ private static extern Result CreateDeviceInternal (
1130311303 [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
1130411304 [NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
1130511305 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
@@ -12023,7 +12023,7 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
1202312023 ],
1202412024 MinVersion = "1.0"
1202512025 )]
12026- public static extern Result CreateInstance (
12026+ private static extern Result CreateInstanceInternal (
1202712027 [NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
1202812028 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
1202912029 [NativeTypeName("VkInstance *")] InstanceHandle* pInstance
@@ -37797,12 +37797,12 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
3779737797 [MethodImpl(
3779837798 MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
3779937799 )]
37800- public Result CreateDevice (
37800+ public Result CreateDeviceInternal (
3780137801 [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
3780237802 [NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
3780337803 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
3780437804 [NativeTypeName("VkDevice *")] DeviceHandle* pDevice
37805- ) => T.CreateDevice (physicalDevice, pCreateInfo, pAllocator, pDevice);
37805+ ) => T.CreateDeviceInternal (physicalDevice, pCreateInfo, pAllocator, pDevice);
3780637806
3780737807 [SupportedApiProfile(
3780837808 "vulkan",
@@ -38408,11 +38408,11 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
3840838408 [MethodImpl(
3840938409 MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
3841038410 )]
38411- public Result CreateInstance (
38411+ public Result CreateInstanceInternal (
3841238412 [NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
3841338413 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
3841438414 [NativeTypeName("VkInstance *")] InstanceHandle* pInstance
38415- ) => T.CreateInstance (pCreateInfo, pAllocator, pInstance);
38415+ ) => T.CreateInstanceInternal (pCreateInfo, pAllocator, pInstance);
3841638416
3841738417 [SupportedApiProfile(
3841838418 "vulkan",
@@ -51462,6 +51462,33 @@ public Result WriteMicromapsPropertiesEXT(
5146251462 );
5146351463 }
5146451464
51465+ private InstanceHandle? _currentInstance;
51466+ private DeviceHandle? _currentDevice;
51467+ public InstanceHandle? CurrentInstance
51468+ {
51469+ get => _currentInstance;
51470+ set
51471+ {
51472+ if (_currentInstance != null && _currentInstance != value)
51473+ throw new InvalidOperationException(
51474+ "CurrentInstance has already been set. Please create a new API instance so that the loaded function pointers can be kept separate."
51475+ );
51476+ _currentInstance = value;
51477+ }
51478+ }
51479+ public DeviceHandle? CurrentDevice
51480+ {
51481+ get => _currentDevice;
51482+ set
51483+ {
51484+ if (_currentDevice != null && _currentDevice != value)
51485+ throw new InvalidOperationException(
51486+ "CurrentDevice has already been set. Please create a new API instance so that the loaded function pointers can be kept separate."
51487+ );
51488+ _currentDevice = value;
51489+ }
51490+ }
51491+
5146551492 [NativeTypeName("const VkTensorCreateFlagBitsARM")]
5146651493 [SupportedApiProfile("vulkan")]
5146751494 public const ulong TensorCreateMutableFormatBitARM = 0x00000001UL;
@@ -59601,6 +59628,45 @@ public Result WriteMicromapsPropertiesEXT(
5960159628 )]
5960259629 public static Utf8String ExtMeshShaderExtensionName => "VK_EXT_mesh_shader"u8;
5960359630
59631+ [SupportedApiProfile(
59632+ "vulkan",
59633+ ["VK_VERSION_1_0", "VK_VERSION_1_1", "VK_VERSION_1_2", "VK_VERSION_1_3", "VK_VERSION_1_4"],
59634+ MinVersion = "1.0"
59635+ )]
59636+ public static Result CreateDevice(
59637+ [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
59638+ [NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
59639+ [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
59640+ [NativeTypeName("VkDevice *")] DeviceHandle* pDevice
59641+ )
59642+ {
59643+ Result result = CreateDeviceInternal(physicalDevice, pCreateInfo, pAllocator, pDevice);
59644+ if (result == Result.Success)
59645+ {
59646+ CurrentDevice = *pDevice;
59647+ }
59648+ return result;
59649+ }
59650+
59651+ [SupportedApiProfile(
59652+ "vulkan",
59653+ ["VK_VERSION_1_0", "VK_VERSION_1_1", "VK_VERSION_1_2", "VK_VERSION_1_3", "VK_VERSION_1_4"],
59654+ MinVersion = "1.0"
59655+ )]
59656+ public static Result CreateInstance(
59657+ [NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
59658+ [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
59659+ [NativeTypeName("VkInstance *")] InstanceHandle* pInstance
59660+ )
59661+ {
59662+ Result result = CreateInstanceInternal(pCreateInfo, pAllocator, pInstance);
59663+ if (result == Result.Success)
59664+ {
59665+ CurrentInstance = *pInstance;
59666+ }
59667+ return result;
59668+ }
59669+
5960459670 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
5960559671 Result IVk.AcquireDrmDisplayEXT(
5960659672 [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
@@ -79237,7 +79303,7 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
7923779303 );
7923879304
7923979305 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
79240- Result IVk.CreateDevice (
79306+ Result IVk.CreateDeviceInternal (
7924179307 [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
7924279308 [NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
7924379309 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
@@ -79263,12 +79329,12 @@ _slots[325] is not null and var loadedFnPtr
7926379329 )]
7926479330 [NativeFunction("vulkan", EntryPoint = "vkCreateDevice")]
7926579331 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
79266- public static Result CreateDevice (
79332+ private static Result CreateDeviceInternal (
7926779333 [NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
7926879334 [NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
7926979335 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
7927079336 [NativeTypeName("VkDevice *")] DeviceHandle* pDevice
79271- ) => DllImport.CreateDevice (physicalDevice, pCreateInfo, pAllocator, pDevice);
79337+ ) => DllImport.CreateDeviceInternal (physicalDevice, pCreateInfo, pAllocator, pDevice);
7927279338
7927379339 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
7927479340 Result IVk.CreateDevice(
@@ -80341,7 +80407,7 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
8034180407 );
8034280408
8034380409 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
80344- Result IVk.CreateInstance (
80410+ Result IVk.CreateInstanceInternal (
8034580411 [NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
8034680412 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
8034780413 [NativeTypeName("VkInstance *")] InstanceHandle* pInstance
@@ -80365,11 +80431,11 @@ _slots[339] is not null and var loadedFnPtr
8036580431 )]
8036680432 [NativeFunction("vulkan", EntryPoint = "vkCreateInstance")]
8036780433 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
80368- public static Result CreateInstance (
80434+ private static Result CreateInstanceInternal (
8036980435 [NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
8037080436 [NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
8037180437 [NativeTypeName("VkInstance *")] InstanceHandle* pInstance
80372- ) => DllImport.CreateInstance (pCreateInfo, pAllocator, pInstance);
80438+ ) => DllImport.CreateInstanceInternal (pCreateInfo, pAllocator, pInstance);
8037380439
8037480440 [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
8037580441 Result IVk.CreateInstance(
0 commit comments