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

Fix AsBindGroup derive, texture attribute, visibility flag parsing #8868

Merged
merged 4 commits into from
Jun 22, 2023

Conversation

loganbenjamin
Copy link
Contributor

Objective

  • Fix the AsBindGroup texture attribute visibility flag parsing
  • This appears to have been caused by a syn crate update which then the visibility code got updated
  • Also I noticed that by default the vertex and fragment flags were on, so visibility(compute) would actually make the texture visible to vertex, fragment and compute shaders, I fixed this too

Solution

  • Update flag parsing to use MetaList.parse_nested_meta function, which loads the flags into a Vec then loop through those flags
  • Change initial visibility flags to use VisibilityFlags::default() rather than VisibilityFlags::vertex_fragment()

@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Jun 17, 2023
@alice-i-cecile alice-i-cecile requested a review from mockersf June 17, 2023 21:08
@JMS55 JMS55 added this to the 0.11 milestone Jun 18, 2023
@Vrixyz
Copy link
Member

Vrixyz commented Jun 20, 2023

wow good findings :o 👍 ; Would it be possible to catch this as a test ?

@loganbenjamin
Copy link
Contributor Author

Good idea! I've added a test for the derive so that if the parsing fails it would now error.

It would be nice to improve the test to check if the visibility is correctly set but I'm not sure how to do that as I need to be able to call bind_group_layout which requires a RenderDevice. And I'm unsure how I would create/get a RenderDevice?

Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

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

Great work!

@cart cart added this pull request to the merge queue Jun 21, 2023
Merged via the queue into bevyengine:main with commit ee1368a Jun 22, 2023
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-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants