@@ -11299,7 +11299,7 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
11299
11299
],
11300
11300
MinVersion = "1.0"
11301
11301
)]
11302
- public static extern Result CreateDevice (
11302
+ private static extern Result CreateDeviceInternal (
11303
11303
[NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
11304
11304
[NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
11305
11305
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
@@ -12023,7 +12023,7 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
12023
12023
],
12024
12024
MinVersion = "1.0"
12025
12025
)]
12026
- public static extern Result CreateInstance (
12026
+ private static extern Result CreateInstanceInternal (
12027
12027
[NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
12028
12028
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
12029
12029
[NativeTypeName("VkInstance *")] InstanceHandle* pInstance
@@ -37797,12 +37797,12 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
37797
37797
[MethodImpl(
37798
37798
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
37799
37799
)]
37800
- public Result CreateDevice (
37800
+ public Result CreateDeviceInternal (
37801
37801
[NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
37802
37802
[NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
37803
37803
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
37804
37804
[NativeTypeName("VkDevice *")] DeviceHandle* pDevice
37805
- ) => T.CreateDevice (physicalDevice, pCreateInfo, pAllocator, pDevice);
37805
+ ) => T.CreateDeviceInternal (physicalDevice, pCreateInfo, pAllocator, pDevice);
37806
37806
37807
37807
[SupportedApiProfile(
37808
37808
"vulkan",
@@ -38408,11 +38408,11 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
38408
38408
[MethodImpl(
38409
38409
MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization
38410
38410
)]
38411
- public Result CreateInstance (
38411
+ public Result CreateInstanceInternal (
38412
38412
[NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
38413
38413
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
38414
38414
[NativeTypeName("VkInstance *")] InstanceHandle* pInstance
38415
- ) => T.CreateInstance (pCreateInfo, pAllocator, pInstance);
38415
+ ) => T.CreateInstanceInternal (pCreateInfo, pAllocator, pInstance);
38416
38416
38417
38417
[SupportedApiProfile(
38418
38418
"vulkan",
@@ -51462,6 +51462,33 @@ public Result WriteMicromapsPropertiesEXT(
51462
51462
);
51463
51463
}
51464
51464
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
+
51465
51492
[NativeTypeName("const VkTensorCreateFlagBitsARM")]
51466
51493
[SupportedApiProfile("vulkan")]
51467
51494
public const ulong TensorCreateMutableFormatBitARM = 0x00000001UL;
@@ -59601,6 +59628,45 @@ public Result WriteMicromapsPropertiesEXT(
59601
59628
)]
59602
59629
public static Utf8String ExtMeshShaderExtensionName => "VK_EXT_mesh_shader"u8;
59603
59630
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
+
59604
59670
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
59605
59671
Result IVk.AcquireDrmDisplayEXT(
59606
59672
[NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
@@ -79237,7 +79303,7 @@ Ref<DescriptorUpdateTemplateHandle> pDescriptorUpdateTemplate
79237
79303
);
79238
79304
79239
79305
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
79240
- Result IVk.CreateDevice (
79306
+ Result IVk.CreateDeviceInternal (
79241
79307
[NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
79242
79308
[NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
79243
79309
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
@@ -79263,12 +79329,12 @@ _slots[325] is not null and var loadedFnPtr
79263
79329
)]
79264
79330
[NativeFunction("vulkan", EntryPoint = "vkCreateDevice")]
79265
79331
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
79266
- public static Result CreateDevice (
79332
+ private static Result CreateDeviceInternal (
79267
79333
[NativeTypeName("VkPhysicalDevice")] PhysicalDeviceHandle physicalDevice,
79268
79334
[NativeTypeName("const VkDeviceCreateInfo *")] DeviceCreateInfo* pCreateInfo,
79269
79335
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
79270
79336
[NativeTypeName("VkDevice *")] DeviceHandle* pDevice
79271
- ) => DllImport.CreateDevice (physicalDevice, pCreateInfo, pAllocator, pDevice);
79337
+ ) => DllImport.CreateDeviceInternal (physicalDevice, pCreateInfo, pAllocator, pDevice);
79272
79338
79273
79339
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
79274
79340
Result IVk.CreateDevice(
@@ -80341,7 +80407,7 @@ Ref<IndirectExecutionSetEXTHandle> pIndirectExecutionSet
80341
80407
);
80342
80408
80343
80409
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
80344
- Result IVk.CreateInstance (
80410
+ Result IVk.CreateInstanceInternal (
80345
80411
[NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
80346
80412
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
80347
80413
[NativeTypeName("VkInstance *")] InstanceHandle* pInstance
@@ -80365,11 +80431,11 @@ _slots[339] is not null and var loadedFnPtr
80365
80431
)]
80366
80432
[NativeFunction("vulkan", EntryPoint = "vkCreateInstance")]
80367
80433
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
80368
- public static Result CreateInstance (
80434
+ private static Result CreateInstanceInternal (
80369
80435
[NativeTypeName("const VkInstanceCreateInfo *")] InstanceCreateInfo* pCreateInfo,
80370
80436
[NativeTypeName("const VkAllocationCallbacks *")] AllocationCallbacks* pAllocator,
80371
80437
[NativeTypeName("VkInstance *")] InstanceHandle* pInstance
80372
- ) => DllImport.CreateInstance (pCreateInfo, pAllocator, pInstance);
80438
+ ) => DllImport.CreateInstanceInternal (pCreateInfo, pAllocator, pInstance);
80373
80439
80374
80440
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
80375
80441
Result IVk.CreateInstance(
0 commit comments