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

ash::vk::Display is defined as *const c_void while it should just be c_void #749

Closed
philae-ael opened this issue May 6, 2023 · 1 comment · Fixed by #751
Closed

ash::vk::Display is defined as *const c_void while it should just be c_void #749

philae-ael opened this issue May 6, 2023 · 1 comment · Fixed by #751

Comments

@philae-ael
Copy link

philae-ael commented May 6, 2023

This is not a big issue but it makes it's usage confusing in

  • XlibSurface::get_physical_device_xlib_presentation_support (takes a &mut Display)
  • vk::XlibSurfaceCreateInfoKHR (takes a *mut Display)
@philae-ael philae-ael changed the title ash::vk::Display is defined as *const c_void while is should just be c_void ash::vk::Display is defined as *const c_void while it should just be c_void May 6, 2023
@MarijnS95
Copy link
Collaborator

You're right that Xlib.h does not define Display as a pointer, but as a typedef to a forward-declared struct:

typedef struct _XDisplay Display;

And everything in C uses it as Display *. We have double pointers in our implementation that effectively confuse how Display is supposed to be used.

What I'll do is change get_physical_device_xlib_presentation_support() to take a *mut Display instead, and change the type alias to c_void.

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