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

Examples demonstrate bad patterns #190

Open
1 of 5 tasks
Ralith opened this issue Mar 2, 2019 · 4 comments · May be fixed by #356
Open
1 of 5 tasks

Examples demonstrate bad patterns #190

Ralith opened this issue Mar 2, 2019 · 4 comments · May be fixed by #356

Comments

@Ralith
Copy link
Collaborator

Ralith commented Mar 2, 2019

The examples have a few issues that should be corrected to help guide new Vulkan users towards good practice:

  • Window resizes should be handled gracefully rather than panicing
  • Validation layer should not be hardcoded on, as it can be easily enabled via environment variables and will prevent execution when the validation layers are not installed
  • Fences should be reused, rather than reconstructed every frame
  • Presentation should be pipelined with rendering, rather than blocked on the CPU until rendering completes
  • The windowing system event queue should be drained independently of frame rendering, rather than rendering one frame per event, as that leads to massive input lag and low framerates.
@hgallagher1993
Copy link

I can have a go at refactoring this! This will be a bit of a learning exercise for me because apart from some gfx-rs tutorials I'm still new to computer graphics so mightn't have a PR for a while 😄

@Ralith
Copy link
Collaborator Author

Ralith commented Nov 26, 2020

Thanks, that would be awesome!

@hgallagher1993
Copy link

Hi, so I'm pretty much finished with this I think but I just have one question about the second point, do you mean enable the validation layer by passing it in as a feature?...so something like cargo run --bin triangle --features "layer_validation" and then conditionally create the instance with or without it?

@Ralith
Copy link
Collaborator Author

Ralith commented Jan 11, 2021

No; the user can easily enable the validation layers themselves by setting the VK_LAYER_KHRONOS_validation environment variable or using vkconfig, so there's no need for the examples to enable them explicitly at all.

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

Successfully merging a pull request may close this issue.

3 participants