Skip to content

Enable wgpu device features and limits#1401

Closed
PixelDust22 wants to merge 4 commits intobevyengine:mainfrom
PixelDust22:wgpu_device_features
Closed

Enable wgpu device features and limits#1401
PixelDust22 wants to merge 4 commits intobevyengine:mainfrom
PixelDust22:wgpu_device_features

Conversation

@PixelDust22
Copy link
Copy Markdown
Contributor

@PixelDust22 PixelDust22 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@PixelDust22 PixelDust22 closed this Mar 3, 2021
@PixelDust22 PixelDust22 deleted the wgpu_device_features branch March 3, 2021 20:08
@PixelDust22
Copy link
Copy Markdown
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 <[email protected]>
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 <[email protected]>
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