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

Update Naga with new storage classes API #1766

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

zicklag
Copy link
Contributor

@zicklag zicklag commented Aug 4, 2021

Connections
None

Description
Updates Naga. Needed by me specifically to get gfx-rs/naga#1144 pulled in to fix OpenGL backend with Bevy.

I had to remove the [[access(read)]] the shader for the shadow example or else I would get this error:

Caused by:
        In Device::create_shader_module
        Failed to parse a shader
        
    Shader error:
    error: expected type attribute ('access' or 'stride') or an end of the attribute list (']]'), found 'access'
       ┌─ wgsl:58:26
       │
    58 │ var<storage> s_lights: [[access(read)]] Lights;
       │                          ^^^^^^ expected type attribute ('access' or 'stride') or an end of the attribute list (']]')

Is this a naga bug, maybe? Seems a little off to me.

Also, I'm not exactly sure how the new struct element in the Naga StorageClass enum is meant to be used so let me know if any of that is wrong!

Testing
Tested shadow example on linux with GL and vulkan.

@zicklag zicklag force-pushed the naga-update branch 2 times, most recently from 7736a62 to c19cd51 Compare August 4, 2021 21:38
@zicklag
Copy link
Contributor Author

zicklag commented Aug 4, 2021

I found the new syntax for storage access and update the PR to use that. It wasn't a Naga bug, but I did open a PR to make the naga error message less confusing: gfx-rs/naga#1167.

The CI for webassembly is failing, but that looks like it was introduced by #1763. I'll look into making a separate PR to fix that.\

Edit: #1767 should fix WASM CI.

Copy link
Member

@kvark kvark 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!
Just one small fix is needed

wgpu-hal/src/gles/device.rs Outdated Show resolved Hide resolved
@kvark kvark changed the title Update Naga Update Naga with new storage classes API Aug 5, 2021
@zicklag
Copy link
Contributor Author

zicklag commented Aug 5, 2021

Updated with your code sample, fixed a broken test, and updated the Naga commit hash to the latest master.

@zicklag zicklag requested a review from kvark August 5, 2021 15:57
@zicklag
Copy link
Contributor Author

zicklag commented Aug 5, 2021

Looks like CI is failing on windows for lack of disk space.

@kvark kvark merged commit 9310f26 into gfx-rs:master Aug 5, 2021
@zicklag zicklag deleted the naga-update branch August 5, 2021 17:51
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