-
Notifications
You must be signed in to change notification settings - Fork 474
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
Vulkan support #785
Vulkan support #785
Conversation
Looks good to me! Can you just address the concern I mentioned here? Even if you don't address it right away, let's at least put it in the documentation if that's too much for a first step. |
Do you have anything else in mind before merging or is this ready to merge? |
If you think nothing else is needed, I think it's good to go. |
I've come across a potential issue with the vulkan example. In trying to port the example here to use rust-sdl2, I came across an issue where Unfortunately I'm not sure what to use in place of It may be that this is an unnecessary restriction with vulkano in which case I'll raise an issue there instead. |
I'm not really understanding how |
I have uploaded my code here https://github.com/samp20/HelloTriangle/tree/9b6d066964c2c0b5501d9171182877e5ea374a73. You can swap my comments on lines 70/71 to remove the hacky fix. Here are the errors below:
Edited to reference specific commit |
It looks like this is a possible oversight in Vulkano, so you may want to bring this up with them. I have no idea what the right solution would be, whether In any case, I wonder what is currently preventing |
I can confirm that VideoSubsystem does not support Send on purpose, the Windows API (I think for direct3d?) crashes when calling from 2 different threads (even without race conditions). In any way, SDL was very clear about this: this part is not thread safe, but other parts may be (I think the audio parts can be thread safe for instance) |
I have created an issue here vulkano-rs/vulkano#994. Let me know if I've missed anything (It's rather late here). A crude temporary fix is to pass an empty tuple into |
Should I remove the Vulkan example code? |
I came up with a fix for the Unfortunately with that fix I'm still getting a crash on close. The debugger shows the error occuring when
It looks like something is trying to read a null pointer, although I'm not sure how to debug it further. I'm curious to see if anyone else can reproduce it. It might be that this is a bug with SDL2 itself, or my graphics drivers. The original winit example runs without any problems. |
I think for now the only working solution is to pass |
Hi there, Just wondering what the status is on getting this PR merged. Are we waiting for vulkano-rs/vulkano#994 to be resolved first? Should we be? |
I'm not really following this closely so I don't really know if we should be, but in any case I'm against putting on master code that is potentially unsafe and/or unstable. If you can convince me otherwise that this PR is safe and stable for now (even if it's missing functionalities), I'm going to approve it. Otherwise, if there is something blocking it in another repo or whatever, I'm going to postpone this merge for when we have a solution. |
The code itself is safe. The only unsafe part is when you try to mesh it with Vulkano, Vulkano is what forces you to use SDL in an unsafe way. And even then it can be used safely if you keep the destruction order in mind. Since that's a Vulkano detail and not an SDL detail, it shouldn't affect SDL. |
I know this is a closed PR, but I'd like to say that my previous issues in #785 (comment) seem to be fixed now. I've tested my https://github.com/SamP20/HelloTriangle example on my desktop (GeForce GTX 1070ti) and updated laptop drivers (GeForce 845M), and both work well now :) |
Vulkan support
This includes Rust wrappers for SDL's Vulkan functions. I've also included an example program in the readme, much like the existing one for OpenGL.
edit by @Cobrand: Closes #784