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

Store and check adapter features before using them #902

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Store and check adapter features before using them #902

merged 1 commit into from
Aug 2, 2022

Conversation

hekno25
Copy link
Contributor

@hekno25 hekno25 commented Aug 2, 2022

This commit solves #33 by adding a wgpu::Features field to the Renderer struct and checking it before drawing the mesh or debug lines. The renderer does not inform the user if it is unable to use the POLYGON_MODE_LINE feature but it should at least prevent crashing. If this is too rudimentary I'd be glad to keep working on it and make the gui prevent mesh or debug rendering when the feature is missing.

Copy link
Owner

@hannobraun hannobraun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @hekno25, this looks great! Glad you found such a simple solution!

The renderer does not inform the user if it is unable to use the POLYGON_MODE_LINE feature but it should at least prevent crashing. If this is too rudimentary I'd be glad to keep working on it and make the gui prevent mesh or debug rendering when the feature is missing.

Informing the user is definitely desirable, and if you want to work on that, that would be very welcome. But this is already an improvement in itself, and I'm glad to merge it.

In general, I prefer merging a series of small improvement, over a big pull request that does everything perfect. Small changes are easier to review, cause less merge conflicts (thus less work for the contributor), and they reduce the risk of wasted work.

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 this pull request may close these issues.

2 participants