From eda1214df44e447b5786ecd176d2c58dfb63bb6c Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Sat, 3 Sep 2022 10:14:35 -0700 Subject: [PATCH] Ensure new extension methods are properly marked as manual imports --- generation/remap-classes.rsp | 20 ++++++++++---- generation/remap-imports.rsp | 20 ++++++++++---- .../VkCommandBufferManualImports.cs | 2 ++ .../vulkan_core/VkDeviceManualImports.cs | 16 +++++++++++ .../Vulkan/vulkan/vulkan_core/Vulkan.cs | 27 ------------------- .../vulkan_metal/VkDeviceManualImports.cs | 11 ++++++++ .../Vulkan/vulkan/vulkan_metal/Vulkan.cs | 6 +---- 7 files changed, 60 insertions(+), 42 deletions(-) create mode 100644 sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/VkDeviceManualImports.cs diff --git a/generation/remap-classes.rsp b/generation/remap-classes.rsp index 61b7c073e..587e7ae4b 100644 --- a/generation/remap-classes.rsp +++ b/generation/remap-classes.rsp @@ -13,8 +13,8 @@ vkBuildAccelerationStructuresKHR=VkDeviceManualImports vkCmdBeginConditionalRenderingEXT=VkCommandBufferManualImports vkCmdBeginDebugUtilsLabelEXT=VkCommandBufferManualImports vkCmdBeginQueryIndexedEXT=VkCommandBufferManualImports -vkCmdBeginRenderingKHR=VkCommandBufferManualImports vkCmdBeginRenderPass2KHR=VkCommandBufferManualImports +vkCmdBeginRenderingKHR=VkCommandBufferManualImports vkCmdBeginTransformFeedbackEXT=VkCommandBufferManualImports vkCmdBeginVideoCodingKHR=VkCommandBufferManualImports vkCmdBindInvocationMaskHUAWEI=VkCommandBufferManualImports @@ -55,8 +55,8 @@ vkCmdEncodeVideoKHR=VkCommandBufferManualImports vkCmdEndConditionalRenderingEXT=VkCommandBufferManualImports vkCmdEndDebugUtilsLabelEXT=VkCommandBufferManualImports vkCmdEndQueryIndexedEXT=VkCommandBufferManualImports -vkCmdEndRenderingKHR=VkCommandBufferManualImports vkCmdEndRenderPass2KHR=VkCommandBufferManualImports +vkCmdEndRenderingKHR=VkCommandBufferManualImports vkCmdEndTransformFeedbackEXT=VkCommandBufferManualImports vkCmdEndVideoCodingKHR=VkCommandBufferManualImports vkCmdExecuteGeneratedCommandsNV=VkCommandBufferManualImports @@ -100,9 +100,10 @@ vkCmdSetStencilOpEXT=VkCommandBufferManualImports vkCmdSetStencilTestEnableEXT=VkCommandBufferManualImports vkCmdSetVertexInputEXT=VkCommandBufferManualImports vkCmdSetViewportShadingRatePaletteNV=VkCommandBufferManualImports -vkCmdSetViewportWithCountEXT=VkCommandBufferManualImports vkCmdSetViewportWScalingNV=VkCommandBufferManualImports +vkCmdSetViewportWithCountEXT=VkCommandBufferManualImports vkCmdSubpassShadingHUAWEI=VkCommandBufferManualImports +vkCmdTraceRaysIndirect2KHR=VkCommandBufferManualImports vkCmdTraceRaysIndirectKHR=VkCommandBufferManualImports vkCmdTraceRaysKHR=VkCommandBufferManualImports vkCmdTraceRaysNV=VkCommandBufferManualImports @@ -128,9 +129,9 @@ vkCreateDeferredOperationKHR=VkDeviceManualImports vkCreateDescriptorUpdateTemplateKHR=VkDeviceManualImports vkCreateDirectFBSurfaceEXT=VkInstanceManualImports vkCreateHeadlessSurfaceEXT=VkInstanceManualImports +vkCreateIOSSurfaceMVK=VkInstanceManualImports vkCreateImagePipeSurfaceFUCHSIA=VkInstanceManualImports vkCreateIndirectCommandsLayoutNV=VkDeviceManualImports -vkCreateIOSSurfaceMVK=VkInstanceManualImports vkCreateMacOSSurfaceMVK=VkInstanceManualImports vkCreateMetalSurfaceEXT=VkInstanceManualImports vkCreatePrivateDataSlotEXT=VkDeviceManualImports @@ -141,9 +142,9 @@ vkCreateSamplerYcbcrConversionKHR=VkDeviceManualImports vkCreateScreenSurfaceQNX=VkInstanceManualImports vkCreateStreamDescriptorSurfaceGGP=VkInstanceManualImports vkCreateValidationCacheEXT=VkDeviceManualImports +vkCreateViSurfaceNN=VkInstanceManualImports vkCreateVideoSessionKHR=VkDeviceManualImports vkCreateVideoSessionParametersKHR=VkDeviceManualImports -vkCreateViSurfaceNN=VkInstanceManualImports vkCreateWaylandSurfaceKHR=VkInstanceManualImports vkCreateWin32SurfaceKHR=VkInstanceManualImports vkCreateXcbSurfaceKHR=VkInstanceManualImports @@ -170,6 +171,7 @@ vkDestroyVideoSessionParametersKHR=VkDeviceManualImports vkDisplayPowerControlEXT=VkDeviceManualImports vkEnumeratePhysicalDeviceGroupsKHR=VkInstanceManualImports vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR=VkPhysicalDeviceManualImports +vkExportMetalObjectsEXT=VkDeviceManualImports vkGetAccelerationStructureBuildSizesKHR=VkDeviceManualImports vkGetAccelerationStructureDeviceAddressKHR=VkDeviceManualImports vkGetAccelerationStructureHandleNV=VkDeviceManualImports @@ -183,6 +185,8 @@ vkGetBufferOpaqueCaptureAddressKHR=VkDeviceManualImports vkGetCalibratedTimestampsEXT=VkDeviceManualImports vkGetDeferredOperationMaxConcurrencyKHR=VkDeviceManualImports vkGetDeferredOperationResultKHR=VkDeviceManualImports +vkGetDescriptorSetHostMappingVALVE=VkDeviceManualImports +vkGetDescriptorSetLayoutHostMappingInfoVALVE=VkDeviceManualImports vkGetDescriptorSetLayoutSupportKHR=VkDeviceManualImports vkGetDeviceAccelerationStructureCompatibilityKHR=VkDeviceManualImports vkGetDeviceBufferMemoryRequirementsKHR=VkDeviceManualImports @@ -193,12 +197,15 @@ vkGetDeviceImageSparseMemoryRequirementsKHR=VkDeviceManualImports vkGetDeviceMemoryOpaqueCaptureAddressKHR=VkDeviceManualImports vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI=VkDeviceManualImports vkGetDrmDisplayEXT=VkPhysicalDeviceManualImports +vkGetDynamicRenderingTilePropertiesQCOM=VkDeviceManualImports vkGetFenceFdKHR=VkDeviceManualImports vkGetFenceWin32HandleKHR=VkDeviceManualImports +vkGetFramebufferTilePropertiesQCOM=VkDeviceManualImports vkGetGeneratedCommandsMemoryRequirementsNV=VkDeviceManualImports vkGetImageDrmFormatModifierPropertiesEXT=VkDeviceManualImports vkGetImageMemoryRequirements2KHR=VkDeviceManualImports vkGetImageSparseMemoryRequirements2KHR=VkDeviceManualImports +vkGetImageSubresourceLayout2EXT=VkDeviceManualImports vkGetImageViewAddressNVX=VkDeviceManualImports vkGetImageViewHandleNVX=VkDeviceManualImports vkGetMemoryAndroidHardwareBufferANDROID=VkDeviceManualImports @@ -246,6 +253,7 @@ vkGetPhysicalDeviceXlibPresentationSupportKHR=VkPhysicalDeviceManualImports vkGetPipelineExecutableInternalRepresentationsKHR=VkDeviceManualImports vkGetPipelineExecutablePropertiesKHR=VkDeviceManualImports vkGetPipelineExecutableStatisticsKHR=VkDeviceManualImports +vkGetPipelinePropertiesEXT=VkDeviceManualImports vkGetPrivateDataEXT=VkDeviceManualImports vkGetQueueCheckpointData2NV=VkQueueManualImports vkGetQueueCheckpointDataNV=VkQueueManualImports @@ -260,6 +268,8 @@ vkGetSemaphoreFdKHR=VkDeviceManualImports vkGetSemaphoreWin32HandleKHR=VkDeviceManualImports vkGetSemaphoreZirconHandleFUCHSIA=VkDeviceManualImports vkGetShaderInfoAMD=VkDeviceManualImports +vkGetShaderModuleCreateInfoIdentifierEXT=VkDeviceManualImports +vkGetShaderModuleIdentifierEXT=VkDeviceManualImports vkGetSwapchainCounterEXT=VkDeviceManualImports vkGetSwapchainStatusKHR=VkDeviceManualImports vkGetValidationCacheDataEXT=VkDeviceManualImports diff --git a/generation/remap-imports.rsp b/generation/remap-imports.rsp index e5c1b745f..f3bb055f1 100644 --- a/generation/remap-imports.rsp +++ b/generation/remap-imports.rsp @@ -13,8 +13,8 @@ vkBuildAccelerationStructuresKHR vkCmdBeginConditionalRenderingEXT vkCmdBeginDebugUtilsLabelEXT vkCmdBeginQueryIndexedEXT -vkCmdBeginRenderingKHR vkCmdBeginRenderPass2KHR +vkCmdBeginRenderingKHR vkCmdBeginTransformFeedbackEXT vkCmdBeginVideoCodingKHR vkCmdBindInvocationMaskHUAWEI @@ -55,8 +55,8 @@ vkCmdEncodeVideoKHR vkCmdEndConditionalRenderingEXT vkCmdEndDebugUtilsLabelEXT vkCmdEndQueryIndexedEXT -vkCmdEndRenderingKHR vkCmdEndRenderPass2KHR +vkCmdEndRenderingKHR vkCmdEndTransformFeedbackEXT vkCmdEndVideoCodingKHR vkCmdExecuteGeneratedCommandsNV @@ -100,9 +100,10 @@ vkCmdSetStencilOpEXT vkCmdSetStencilTestEnableEXT vkCmdSetVertexInputEXT vkCmdSetViewportShadingRatePaletteNV -vkCmdSetViewportWithCountEXT vkCmdSetViewportWScalingNV +vkCmdSetViewportWithCountEXT vkCmdSubpassShadingHUAWEI +vkCmdTraceRaysIndirect2KHR vkCmdTraceRaysIndirectKHR vkCmdTraceRaysKHR vkCmdTraceRaysNV @@ -128,9 +129,9 @@ vkCreateDeferredOperationKHR vkCreateDescriptorUpdateTemplateKHR vkCreateDirectFBSurfaceEXT vkCreateHeadlessSurfaceEXT +vkCreateIOSSurfaceMVK vkCreateImagePipeSurfaceFUCHSIA vkCreateIndirectCommandsLayoutNV -vkCreateIOSSurfaceMVK vkCreateMacOSSurfaceMVK vkCreateMetalSurfaceEXT vkCreatePrivateDataSlotEXT @@ -141,9 +142,9 @@ vkCreateSamplerYcbcrConversionKHR vkCreateScreenSurfaceQNX vkCreateStreamDescriptorSurfaceGGP vkCreateValidationCacheEXT +vkCreateViSurfaceNN vkCreateVideoSessionKHR vkCreateVideoSessionParametersKHR -vkCreateViSurfaceNN vkCreateWaylandSurfaceKHR vkCreateWin32SurfaceKHR vkCreateXcbSurfaceKHR @@ -170,6 +171,7 @@ vkDestroyVideoSessionParametersKHR vkDisplayPowerControlEXT vkEnumeratePhysicalDeviceGroupsKHR vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR +vkExportMetalObjectsEXT vkGetAccelerationStructureBuildSizesKHR vkGetAccelerationStructureDeviceAddressKHR vkGetAccelerationStructureHandleNV @@ -183,6 +185,8 @@ vkGetBufferOpaqueCaptureAddressKHR vkGetCalibratedTimestampsEXT vkGetDeferredOperationMaxConcurrencyKHR vkGetDeferredOperationResultKHR +vkGetDescriptorSetHostMappingVALVE +vkGetDescriptorSetLayoutHostMappingInfoVALVE vkGetDescriptorSetLayoutSupportKHR vkGetDeviceAccelerationStructureCompatibilityKHR vkGetDeviceBufferMemoryRequirementsKHR @@ -193,12 +197,15 @@ vkGetDeviceImageSparseMemoryRequirementsKHR vkGetDeviceMemoryOpaqueCaptureAddressKHR vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI vkGetDrmDisplayEXT +vkGetDynamicRenderingTilePropertiesQCOM vkGetFenceFdKHR vkGetFenceWin32HandleKHR +vkGetFramebufferTilePropertiesQCOM vkGetGeneratedCommandsMemoryRequirementsNV vkGetImageDrmFormatModifierPropertiesEXT vkGetImageMemoryRequirements2KHR vkGetImageSparseMemoryRequirements2KHR +vkGetImageSubresourceLayout2EXT vkGetImageViewAddressNVX vkGetImageViewHandleNVX vkGetMemoryAndroidHardwareBufferANDROID @@ -246,6 +253,7 @@ vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPipelineExecutableInternalRepresentationsKHR vkGetPipelineExecutablePropertiesKHR vkGetPipelineExecutableStatisticsKHR +vkGetPipelinePropertiesEXT vkGetPrivateDataEXT vkGetQueueCheckpointData2NV vkGetQueueCheckpointDataNV @@ -260,6 +268,8 @@ vkGetSemaphoreFdKHR vkGetSemaphoreWin32HandleKHR vkGetSemaphoreZirconHandleFUCHSIA vkGetShaderInfoAMD +vkGetShaderModuleCreateInfoIdentifierEXT +vkGetShaderModuleIdentifierEXT vkGetSwapchainCounterEXT vkGetSwapchainStatusKHR vkGetValidationCacheDataEXT diff --git a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkCommandBufferManualImports.cs b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkCommandBufferManualImports.cs index d60aefc67..ba918d427 100644 --- a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkCommandBufferManualImports.cs +++ b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkCommandBufferManualImports.cs @@ -55,6 +55,8 @@ public unsafe partial struct VkCommandBufferManualImports public delegate* unmanaged vkCmdResolveImage2KHR; + public delegate* unmanaged vkCmdTraceRaysIndirect2KHR; + public delegate* unmanaged vkCmdDebugMarkerBeginEXT; public delegate* unmanaged vkCmdDebugMarkerEndEXT; diff --git a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkDeviceManualImports.cs b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkDeviceManualImports.cs index d23ed63fd..21eaf9ad4 100644 --- a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkDeviceManualImports.cs +++ b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/VkDeviceManualImports.cs @@ -187,12 +187,28 @@ public unsafe partial struct VkDeviceManualImports public delegate* unmanaged vkGetPrivateDataEXT; + public delegate* unmanaged vkGetImageSubresourceLayout2EXT; + public delegate* unmanaged vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI; public delegate* unmanaged vkGetMemoryRemoteAddressNV; + public delegate* unmanaged vkGetPipelinePropertiesEXT; + public delegate* unmanaged vkSetDeviceMemoryPriorityEXT; + public delegate* unmanaged vkGetDescriptorSetLayoutHostMappingInfoVALVE; + + public delegate* unmanaged vkGetDescriptorSetHostMappingVALVE; + + public delegate* unmanaged vkGetShaderModuleIdentifierEXT; + + public delegate* unmanaged vkGetShaderModuleCreateInfoIdentifierEXT; + + public delegate* unmanaged vkGetFramebufferTilePropertiesQCOM; + + public delegate* unmanaged vkGetDynamicRenderingTilePropertiesQCOM; + public delegate* unmanaged vkCreateAccelerationStructureKHR; public delegate* unmanaged vkDestroyAccelerationStructureKHR; diff --git a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/Vulkan.cs b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/Vulkan.cs index bb235cd33..611918525 100644 --- a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/Vulkan.cs +++ b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_core/Vulkan.cs @@ -738,33 +738,6 @@ public static unsafe partial class Vulkan [DllImport("vulkan", ExactSpelling = true)] public static extern VkResult vkGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, [NativeTypeName("const VkDisplayPlaneInfo2KHR *")] VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities); - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkCmdTraceRaysIndirect2KHR(VkCommandBuffer commandBuffer, [NativeTypeName("VkDeviceAddress")] ulong indirectDeviceAddress); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkGetImageSubresourceLayout2EXT(VkDevice device, VkImage image, [NativeTypeName("const VkImageSubresource2EXT *")] VkImageSubresource2EXT* pSubresource, VkSubresourceLayout2EXT* pLayout); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern VkResult vkGetPipelinePropertiesEXT(VkDevice device, [NativeTypeName("const VkPipelineInfoEXT *")] VkPipelineInfoKHR* pPipelineInfo, VkBaseOutStructure* pPipelineProperties); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkGetDescriptorSetLayoutHostMappingInfoVALVE(VkDevice device, [NativeTypeName("const VkDescriptorSetBindingReferenceVALVE *")] VkDescriptorSetBindingReferenceVALVE* pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkGetDescriptorSetHostMappingVALVE(VkDevice device, VkDescriptorSet descriptorSet, void** ppData); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkGetShaderModuleIdentifierEXT(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT* pIdentifier); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkGetShaderModuleCreateInfoIdentifierEXT(VkDevice device, [NativeTypeName("const VkShaderModuleCreateInfo *")] VkShaderModuleCreateInfo* pCreateInfo, VkShaderModuleIdentifierEXT* pIdentifier); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern VkResult vkGetFramebufferTilePropertiesQCOM(VkDevice device, VkFramebuffer framebuffer, [NativeTypeName("uint32_t *")] uint* pPropertiesCount, VkTilePropertiesQCOM* pProperties); - - [DllImport("vulkan", ExactSpelling = true)] - public static extern VkResult vkGetDynamicRenderingTilePropertiesQCOM(VkDevice device, [NativeTypeName("const VkRenderingInfo *")] VkRenderingInfo* pRenderingInfo, VkTilePropertiesQCOM* pProperties); - [NativeTypeName("#define VK_VERSION_1_0 1")] public const int VK_VERSION_1_0 = 1; diff --git a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/VkDeviceManualImports.cs b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/VkDeviceManualImports.cs new file mode 100644 index 000000000..898319f2c --- /dev/null +++ b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/VkDeviceManualImports.cs @@ -0,0 +1,11 @@ +// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. + +// Ported from include/vulkan/vulkan_metal.h in the KhronosGroup/Vulkan-Headers repository for tag v1.3.224 +// Original source is Copyright © 2015-2022 The Khronos Group Inc. Licensed under the Apache License v2.0 (Apache-2.0) + +namespace TerraFX.Interop.Vulkan; + +public unsafe partial struct VkDeviceManualImports +{ + public delegate* unmanaged vkExportMetalObjectsEXT; +} diff --git a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/Vulkan.cs b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/Vulkan.cs index 5b48e9f37..8b8f465ee 100644 --- a/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/Vulkan.cs +++ b/sources/Interop/Vulkan/Vulkan/vulkan/vulkan_metal/Vulkan.cs @@ -4,15 +4,11 @@ // Original source is Copyright © 2015-2022 The Khronos Group Inc. Licensed under the Apache License v2.0 (Apache-2.0) using System; -using System.Runtime.InteropServices; namespace TerraFX.Interop.Vulkan; -public static unsafe partial class Vulkan +public static partial class Vulkan { - [DllImport("vulkan", ExactSpelling = true)] - public static extern void vkExportMetalObjectsEXT(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo); - [NativeTypeName("#define VK_EXT_metal_surface 1")] public const int VK_EXT_metal_surface = 1;