Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect "enumerate" functions #148

Open
poconn opened this issue Jun 30, 2024 · 1 comment · May be fixed by #160
Open

Autodetect "enumerate" functions #148

poconn opened this issue Jun 30, 2024 · 1 comment · May be fixed by #160

Comments

@poconn
Copy link
Contributor

poconn commented Jun 30, 2024

Followup from #146, posting the issue as a reminder for myself :)

We've currently got a hardcoded list but should instead automatically decide whether to generate an *Alloc() wrapper based on the parameter's "length" attribute and possibly other factors such as an "incomplete" return code.

I won't get to this right away but hopefully in the next few weeks or so.

@poconn
Copy link
Contributor Author

poconn commented Sep 9, 2024

@Snektron Hey, sorry for the delay on this! I haven't started on the implementation but did finally look into how these functions can be classified.

Seems like the most reliable indicators are that (a) the last parameter is an optional pointer, and (b) the previous parameter is tagged as its associated length. That rule seems to correctly classify everything, aside from false positives on some vkCmd*() functions which can be filtered out by name (not a hardcoded list, just reject any name with that prefix). There are a few additional checks we can add for redundancy, e.g. the aforementioned "incomplete" return code.

Full list:

  • vkEnumerateDeviceExtensionProperties
  • vkEnumerateDeviceLayerProperties
  • vkEnumerateInstanceExtensionProperties
  • vkEnumerateInstanceLayerProperties
  • vkEnumeratePhysicalDeviceGroups
  • vkEnumeratePhysicalDevices
  • vkGetCudaModuleCacheNV
  • vkGetDeviceImageSparseMemoryRequirements
  • vkGetDisplayModeProperties2KHR
  • vkGetDisplayModePropertiesKHR
  • vkGetDisplayPlaneSupportedDisplaysKHR
  • vkGetEncodedVideoSessionParametersKHR
  • vkGetFaultData
  • vkGetFramebufferTilePropertiesQCOM
  • vkGetImageSparseMemoryRequirements
  • vkGetImageSparseMemoryRequirements2
  • vkGetPastPresentationTimingGOOGLE
  • vkGetPhysicalDeviceCalibrateableTimeDomainsKHR
  • vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR
  • vkGetPhysicalDeviceCooperativeMatrixPropertiesNV
  • vkGetPhysicalDeviceDisplayPlaneProperties2KHR
  • vkGetPhysicalDeviceDisplayPlanePropertiesKHR
  • vkGetPhysicalDeviceDisplayProperties2KHR
  • vkGetPhysicalDeviceDisplayPropertiesKHR
  • vkGetPhysicalDeviceFragmentShadingRatesKHR
  • vkGetPhysicalDeviceOpticalFlowImageFormatsNV
  • vkGetPhysicalDevicePresentRectanglesKHR
  • vkGetPhysicalDeviceQueueFamilyProperties
  • vkGetPhysicalDeviceQueueFamilyProperties2
  • vkGetPhysicalDeviceRefreshableObjectTypesKHR
  • vkGetPhysicalDeviceSparseImageFormatProperties
  • vkGetPhysicalDeviceSparseImageFormatProperties2
  • vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV
  • vkGetPhysicalDeviceSurfaceFormats2KHR
  • vkGetPhysicalDeviceSurfaceFormatsKHR
  • vkGetPhysicalDeviceSurfacePresentModes2EXT
  • vkGetPhysicalDeviceSurfacePresentModesKHR
  • vkGetPhysicalDeviceToolProperties
  • vkGetPhysicalDeviceVideoFormatPropertiesKHR
  • vkGetPipelineCacheData
  • vkGetPipelineExecutableInternalRepresentationsKHR
  • vkGetPipelineExecutablePropertiesKHR
  • vkGetPipelineExecutableStatisticsKHR
  • vkGetQueueCheckpointData2NV
  • vkGetQueueCheckpointDataNV
  • vkGetShaderBinaryDataEXT
  • vkGetShaderInfoAMD
  • vkGetSwapchainImagesKHR
  • vkGetValidationCacheDataEXT
  • vkGetVideoSessionMemoryRequirementsKHR

So yeah, seems real doable. I should have a PR for you soon, hopefully this weekend at the latest.

@poconn poconn linked a pull request Sep 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant