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

use a u64 for MeshPipelineKey #13015

Merged
merged 6 commits into from
Apr 21, 2024

Conversation

mockersf
Copy link
Member

Objective

  • MeshPipelineKey use some bits for two things
  • First commit in this PR adds an assertion that doesn't work currently on main
  • This leads to some mesh topology not working anymore, for example LineStrip
  • With examples lines, there should be two groups of lines, the blue one doesn't display currently

Solution

  • Change the MeshPipelineKey to be backed by a u64 instead, to have enough bits

@mockersf mockersf added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Apr 18, 2024
@mockersf mockersf added this to the 0.14 milestone Apr 18, 2024
@pcwalton pcwalton self-requested a review April 19, 2024 05:28
Copy link
Contributor

@pcwalton pcwalton left a comment

Choose a reason for hiding this comment

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

Do you know if there's any perf impact from this?

Anyway this is fine since it fixes bugs.

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.

Increasing the storage size isn't ideal when we could localize the extension to the places where we're doing those bitshift operations. It's not a surefire way to avoid the issue, but the primary areas where those shifts are done are already encapsulated in functions on MeshPipelineKey itself (i.e. from_primitive_toplogy)

@mockersf
Copy link
Member Author

Not sure I understand what you mean? The bits should still be reserved for topology, even outside of from_primitive_toplogy

The bits from the base key are reserved from the end, while the bits from the key are reserved from the start, they should not overlap

@james7132
Copy link
Member

Oh I was misreading the code and thought this problem was a result of bitshifting erasing some of the bits, disregard my prior comment.

@mockersf
Copy link
Member Author

also fixed morph bit, used les magic numbers, and updated comments

@james7132 james7132 added this pull request to the merge queue Apr 21, 2024
Merged via the queue into bevyengine:main with commit c40b485 Apr 21, 2024
27 checks passed
@mockersf mockersf deleted the MeshPipelineKey-to-u64 branch May 17, 2024 21:15
@mockersf mockersf restored the MeshPipelineKey-to-u64 branch May 17, 2024 21:15
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