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

Enable wgpu device features and limits #1401

Closed
wants to merge 4 commits into from

Conversation

Neo-Zhixing
Copy link
Contributor

@Neo-Zhixing Neo-Zhixing commented Feb 5, 2021

Alternative implementation to #547.
This PR also added WgpuFeatures, name, and WgpuLimits to WgpuOptions. Additionally, it also re-exported certain wgpu render resource limit constants.

This is ready for review.

@verzuz
Copy link
Contributor

verzuz commented Feb 5, 2021

"getting stuck" is not the right way to call my PR, but I dont mind - @cart can pick which one he wants use.

@cart
Copy link
Member

cart commented Feb 5, 2021

Cool I'll do a review of both in the near future.

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen labels Feb 17, 2021
Base automatically changed from master to main February 19, 2021 20:44
@cart
Copy link
Member

cart commented Mar 3, 2021

@Neo-Zhixing @verzuz

I was initially inclined to merge this pr as it also includes wgpu limits and the api is a closer match to Wgpu. I also like how this pr includes WgpuFeatures inside of WgpuOptions. However #547 has the desirable behavior of breaking when the wgpu bitflags change (ex: a flag is renamed or removed). A list of enums is also more serialization-friendly, and there is a world where we move to "serialized" plugin configuration for the Bevy Editor.

I think I'll merge #547 (with DeviceFeatures merged into WgpuOptions), but it would be awesome if this pr could be adapted to account for #547 so we can get the nice WgpuLimits config too.

@Neo-Zhixing Neo-Zhixing closed this Mar 3, 2021
@Neo-Zhixing Neo-Zhixing deleted the wgpu_device_features branch March 3, 2021 20:08
@Neo-Zhixing
Copy link
Contributor Author

@cart I've added #1544 for WgpuLimits.

bors bot pushed a commit that referenced this pull request Mar 3, 2021
Follow up on #547 and #1401 

Co-authored-by: Zhixing Zhang <me@neoto.xin>
bors bot pushed a commit that referenced this pull request Mar 4, 2021
This PR implements wireframe rendering.

Usage:

This is now ready as soon as #1401 gets merged.


Usage:

```rust
    app
        .insert_resource(WgpuOptions {
            name: Some("3d_scene"),
            features: WgpuFeatures::NON_FILL_POLYGON_MODE,
            ..Default::default()
        }) // To enable the NON_FILL_POLYGON_MODE feature
        .add_plugin(WireframePlugin)
        .run();

```

Now we just need to add the Wireframe component on an entity, and it'll draw. its wireframe.


We can also enable wireframe drawing globally by setting the global property in the `WireframeConfig` resource to `true`.



Co-authored-by: Zhixing Zhang <me@neoto.xin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants