Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a conrod_wgpu backend crate #1331

Merged
merged 11 commits into from
Mar 2, 2020

Conversation

mitchmindtree
Copy link
Contributor

@mitchmindtree mitchmindtree commented Feb 11, 2020

Just about everything should be implemented other than images, resizing,
and perhaps a MSAA resolve in the example. These shouldn't be tricky to
add, I'll do so soon before merging this PR. Edit: This is all done now.

Everything went very smoothly, other than the alpha channel written by
the fragment shader seemingly being ignored. At first I though something
must be wrong with the way I was sampling alpha values from the glyph
cache, however even if I manually set the alpha to 0.0 (and ignore the
glyph cache texture sampling entirely) the text still renders as white
rectangles. Will look into this further next time I get the chance if
noone beats me to it. I'm sure I'm probably just missing a flag or bool
somewhere.

cc @DavidPartouche @freesig

This also includes an update to conrod_winit to support winit 0.21 via a
new v021 module.

Transparency bug

Here's what the output looks like:

Screenshot from 2020-02-12 00-35-47

Screenshot from 2020-02-12 00-37-05

Here's what it should look like:

Screenshot from 2020-02-12 00-22-20

Screenshot from 2020-02-12 00-23-41

Just about everything should be implemented other than images, and
perhaps a MSAA resolve in the example. Neither of these should be tricky
to add, I'll do so soon before merging this PR.

Everything went very smoothly, other than the alpha channel written by
the fragment shader seemingly being ignored. At first I though something
must be wrong with the way I was sampling alpha values from the glyph
cache, however even if I manually set the alpha to 0.0 (and ignore the
glyph cache texture sampling entirely) the text still renders as white
rectangles. Will look into this further next time I get the chance if
noone beats me to it. I'm sure I'm probably just missing a flag or bool
somewhere.

This also includes an update to `conrod_winit` to support winit 0.21 via a
new `v021` module.
Thanks to the kind folks in the wgpu matrix channel for the help on
this one!
This adds dynamic image support by maintaining a map of bind groups for
each unique user image submitted via the image map.

The next step will be to address the `panic!` that occurs and add some
MSAA for polish.
Last step should be MSAA, then I think `conrod_wgpu` should be ready to
land.
Defaults to 4 samples, but can be changed via the MSAA_SAMPLES constant.
@mitchmindtree
Copy link
Contributor Author

mitchmindtree commented Feb 12, 2020

The transparency bug has been fixed thanks to a hot tip from the folks in the wgpu matrix channel - I had failed to specify both the color blend and alpha blend descriptions correctly! Transparency now behaves as expected all round.

I've also added the missing image support, fixed the resizing bug and enabled MSAA in the example.

This PR should be ready to go!

Edit: added some all_winit_wgpu.rs pics

Screenshot from 2020-02-12 23-53-18

Screenshot from 2020-02-12 23-53-30

@mitchmindtree mitchmindtree merged commit e9450ad into PistonDevelopers:master Mar 2, 2020
@mitchmindtree mitchmindtree deleted the conrod_wgpu branch March 2, 2020 23:52
mitchmindtree added a commit to mitchmindtree/conrod that referenced this pull request Mar 3, 2020
This version adds two new backends!

- `conrod_rendy` providing a custom graphics pipeline for rendering UIs.
  PistonDevelopers#1323.
- `conrod_wgpu` for encoding UI rendering to a given command encoder.
  PistonDevelopers#1331.

Also includes some other changes:

- A `Display` trait has been added to `conrod_glium` to allow for
  non-`glutin` opengl context displays. PistonDevelopers#1332.
- Adds a `ui.has_changed()` method, useful for indicating whether or not
  `ui.draw_if_changed()` would return `Some` or `None`. PistonDevelopers#1324.
- Updates some dependencies across all backends PistonDevelopers#1321.

This PR also fixes some warnings introduced on recent versions of rustc
within the `conrod_derive` and `conrod_core` crates.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant