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

get_physical_device_surface_capabilities2 should take a mutable reference to vk::SurfaceCapabilities2KHR #740

Closed
JoshuaMasci opened this issue Apr 11, 2023 · 1 comment · Fixed by #744

Comments

@JoshuaMasci
Copy link

The function vkGetPhysicalDeviceSurfaceCapabilities2KHR can be extended by use of VkSurfaceCapabilitiesKHR.pNext, however the current wrapper get_physical_device_surface_capabilities2 doesn't allow this since it creates and returns the struct vk::SurfaceCapabilities2KHR.

To allow the use of the pNext pointer, the function get_physical_device_surface_capabilities2 should be changed from this:

  pub unsafe fn get_physical_device_surface_capabilities2(
      &self,
      physical_device: vk::PhysicalDevice,
      surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
  ) -> VkResult<vk::SurfaceCapabilities2KHR>

To something like this:

  pub unsafe fn get_physical_device_surface_capabilities2(
      &self,
      physical_device: vk::PhysicalDevice,
      surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
      surface_capabilities: &mut vk::SurfaceCapabilities2KHR,
  ) -> VkResult<()>
@MarijnS95
Copy link
Collaborator

We've had discussions about how to best pass these types in the past and fixed most functions to allow this (e.g. #588), but it seems like it was forgotten about when this extension was originally wrapped in #530. Especially considering that VkSurfaceCapabilities2KHR exists solely to represent VkSurfaceCapabilitiesKHR but with sType and pNext fields 😅.

It looks like at least VkSurfacePresentModeEXT is relying on this behaviour currently.

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.

2 participants