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

[Merged by Bors] - Set naga capabilities corresponding to wgpu features #4824

Closed
wants to merge 1 commit into from

Conversation

MDeiml
Copy link
Contributor

@MDeiml MDeiml commented May 22, 2022

Objective

At the moment all extra capabilities are disabled when validating shaders with naga:

let module_info = naga::valid::Validator::new(
naga::valid::ValidationFlags::default(),
naga::valid::Capabilities::default(),
)

This means these features can't be used even if the corresponding wgpu features are active.

Solution

With these changes capabilities are now set corresponding to RenderDevice::features.


I have validated these changes for push constants with a project I am currently working on. Though bevy does not support creating pipelines with push constants yet, so I was only able to see that shaders are validated and compiled as expected.

@MDeiml MDeiml mentioned this pull request May 22, 2022
@mockersf mockersf added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen labels May 22, 2022
@MDeiml MDeiml force-pushed the naga_capabilities branch from 12ba5ac to cdff7e5 Compare May 23, 2022 08:42
@MDeiml MDeiml force-pushed the naga_capabilities branch from cdff7e5 to e638640 Compare May 23, 2022 12:47
Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Just one readability bit.

),
];
let mut capabilities = Capabilities::empty();
for (f, c) in CAPABILITIES {
Copy link
Member

Choose a reason for hiding this comment

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

Avoid using single letter variable names, generally harder to read.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sure, sry, one moment

@MDeiml MDeiml force-pushed the naga_capabilities branch from e638640 to 421bd2f Compare May 23, 2022 20:05
@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 26, 2022
@james7132
Copy link
Member

bors try

bors bot added a commit that referenced this pull request May 26, 2022
@cart
Copy link
Member

cart commented Jun 3, 2022

bors r+

bors bot pushed a commit that referenced this pull request Jun 3, 2022
# Objective

At the moment all extra capabilities are disabled when validating shaders with naga:
https://github.com/bevyengine/bevy/blob/c7c08f95cb784afc366eb2dcedd21d9d40e72d32/crates/bevy_render/src/render_resource/shader.rs#L146-L149
This means these features can't be used even if the corresponding wgpu features are active.

## Solution

With these changes capabilities are now set corresponding to `RenderDevice::features`.

---

I have validated these changes for push constants with a project I am currently working on. Though bevy does not support creating pipelines with push constants yet, so I was only able to see that shaders are validated and compiled as expected.
@bors bors bot changed the title Set naga capabilities corresponding to wgpu features [Merged by Bors] - Set naga capabilities corresponding to wgpu features Jun 3, 2022
@bors bors bot closed this Jun 3, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Jun 7, 2022
# Objective

At the moment all extra capabilities are disabled when validating shaders with naga:
https://github.com/bevyengine/bevy/blob/c7c08f95cb784afc366eb2dcedd21d9d40e72d32/crates/bevy_render/src/render_resource/shader.rs#L146-L149
This means these features can't be used even if the corresponding wgpu features are active.

## Solution

With these changes capabilities are now set corresponding to `RenderDevice::features`.

---

I have validated these changes for push constants with a project I am currently working on. Though bevy does not support creating pipelines with push constants yet, so I was only able to see that shaders are validated and compiled as expected.
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# Objective

At the moment all extra capabilities are disabled when validating shaders with naga:
https://github.com/bevyengine/bevy/blob/c7c08f95cb784afc366eb2dcedd21d9d40e72d32/crates/bevy_render/src/render_resource/shader.rs#L146-L149
This means these features can't be used even if the corresponding wgpu features are active.

## Solution

With these changes capabilities are now set corresponding to `RenderDevice::features`.

---

I have validated these changes for push constants with a project I am currently working on. Though bevy does not support creating pipelines with push constants yet, so I was only able to see that shaders are validated and compiled as expected.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

At the moment all extra capabilities are disabled when validating shaders with naga:
https://github.com/bevyengine/bevy/blob/c7c08f95cb784afc366eb2dcedd21d9d40e72d32/crates/bevy_render/src/render_resource/shader.rs#L146-L149
This means these features can't be used even if the corresponding wgpu features are active.

## Solution

With these changes capabilities are now set corresponding to `RenderDevice::features`.

---

I have validated these changes for push constants with a project I am currently working on. Though bevy does not support creating pipelines with push constants yet, so I was only able to see that shaders are validated and compiled as expected.
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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants