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

Investigate the possibility of switching to Vulkan #108

Closed
mitchmindtree opened this issue Apr 9, 2018 · 4 comments
Closed

Investigate the possibility of switching to Vulkan #108

mitchmindtree opened this issue Apr 9, 2018 · 4 comments
Labels
Milestone

Comments

@mitchmindtree
Copy link
Member

mitchmindtree commented Apr 9, 2018

Requirements

  • We must be able to support cross-platform compilation without requiring the user download any third-party libs, etc. This includes building and running on macOS and ultimately would include supporting ARM based processors like raspberry pi etc. It looks like some companies have been recently having some luck with apple-based platforms here.
  • Must allow for freely creating commercial works without any platform-specific license caveats or 3rd-party non-free frameworks (don't know if this discludes Molten on macos anymore?).
  • It must be easy enough to write the backend. If the process of integrating vulkano is at least almost as easy as it currently is to setup GL using glium then we should be OK. However, if we have to write our own entire graphics pipeline from scratch on top of very low-level vulkan support we probably would not have the time and would be better off sticking with OpenGL until something higher-level appears. Will have to investigate what kind of high-level APIs vulkan requires.
  • Must work on stable rust.
  • Must continue to work with a simple cargo run.
  • Must actually simplify

Nice-to-haves

  • We should be able to support existing GLSL code. It may not be worth switching from OpenGL if it means abandoning all the awesome shader code out there that already exists. However, if instead we could use some kind of rust-style shading language instead (like RLSL) to which glsl shaders could be ported then maybe it would be worth it.

After having a quick look at vulkano it looks like it might already be close to ticking all these boxes today! We would want to test that the simple triangle example compiles and runs easily on each of the major platforms first (macos, windows, linux). If not, we will have to investigate how easy it is to automate the downloading/installation of any necessary 3rd party free tools etc via a build.rs script.

@mitchmindtree
Copy link
Member Author

Required Steps

Currently glium is used throughout nannou to provide support for OpenGL. The following are the steps required to make the switch to Vulkano.

  • Switching from using the glutin window and glcontext to vulkano-win.
  • Removing GlFrame from the frame module for the vulkano alternative.
  • Changing the nannou::draw::backend module to use vulkano.
  • Switch from using the glium backend of conrod to a vulkano one.

@mitchmindtree mitchmindtree added this to the 1.0.0 milestone Jun 30, 2018
@mitchmindtree
Copy link
Member Author

This interesting thread popped up in /r/rust recently.

My current thoughts are that, I value the "correctness" goals of vulkano enough to put up with some incomplete-ness and breakage in the short-term if it means we don't have to write our own unsafe API around some lower level crate like vk-sys. I would much prefer to have the rust compiler and type-system inform me of what "is" and "isn't" allowed in Vulkan's API than use some other more "flexible" crate that requires I comb over the vulkan documentation to ensure I'm using it correctly and don't run into weird vulkan-specific / GPU bugs. Having used glium, I know that tomaka is capable of pulling off very nice, type-safe APIs over renownly terrible, complex libraries (see OpenGL), however it doesn't look like he's been active on vulkano over the last month so it would be worth enquiring about the future of the crate before adding it as a dependency.

@freesig
Copy link
Collaborator

freesig commented Jul 26, 2018

Yeh I agree, perhaps we could also contribute to vulkano to fix and incomplete-ness / breakage

@mitchmindtree mitchmindtree mentioned this issue Nov 2, 2018
16 tasks
mitchmindtree added a commit to mitchmindtree/nannou that referenced this issue Nov 29, 2018
This switches the windowed-graphics API from OpenGL (via glium) to
Vulkan (via vulkano). You can read more about the motivations, thoughts
and discussion behind this switch at nannou-org#208 and nannou-org#108.

There are still a few items left to complete before this PR is ready:

- [ ] Fix bug where view seems to be vertically flipped (probably in
  vertex mapping process).
- [ ] Fix bug where clearing an image that is then multisampled does not
  work. vulkano-rs/vulkano#1123
- [ ] Add depth attachment to draw renderpass.
- [ ] Fix bug where alpha channels always seem opaque.
- [ ] Update old loop modes for changes in the application loop.
- [ ] Merge conrod vulkan backend and switch to it.
- [ ] Merge and publish vulkano-rs/vulkano#1117 or related fix so we can
  switch to crates.io dep.

Closes nannou-org#208.
Closes nannou-org#108.
@mitchmindtree
Copy link
Member Author

Closed via #216.

mitchmindtree added a commit that referenced this issue Mar 30, 2019
This switches the windowed-graphics API from OpenGL (via glium) to
Vulkan (via vulkano). You can read more about the motivations, thoughts
and discussion behind this switch at #208 and #108.

There are still a few items left to complete before this PR is ready:

- [ ] Fix bug where view seems to be vertically flipped (probably in
  vertex mapping process).
- [ ] Fix bug where clearing an image that is then multisampled does not
  work. vulkano-rs/vulkano#1123
- [ ] Add depth attachment to draw renderpass.
- [ ] Fix bug where alpha channels always seem opaque.
- [ ] Update old loop modes for changes in the application loop.
- [ ] Merge conrod vulkan backend and switch to it.
- [ ] Merge and publish vulkano-rs/vulkano#1117 or related fix so we can
  switch to crates.io dep.

Closes #208.
Closes #108.
mitchmindtree added a commit that referenced this issue May 11, 2019
This switches the windowed-graphics API from OpenGL (via glium) to
Vulkan (via vulkano). You can read more about the motivations, thoughts
and discussion behind this switch at #208 and #108.

There are still a few items left to complete before this PR is ready:

- [ ] Fix bug where view seems to be vertically flipped (probably in
  vertex mapping process).
- [ ] Fix bug where clearing an image that is then multisampled does not
  work. vulkano-rs/vulkano#1123
- [ ] Add depth attachment to draw renderpass.
- [ ] Fix bug where alpha channels always seem opaque.
- [ ] Update old loop modes for changes in the application loop.
- [ ] Merge conrod vulkan backend and switch to it.
- [ ] Merge and publish vulkano-rs/vulkano#1117 or related fix so we can
  switch to crates.io dep.

Closes #208.
Closes #108.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants