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

Fixed issue where transform buffer wasn't creating new bindings on resize. #7

Merged
merged 3 commits into from
Jul 1, 2021

Conversation

StarArawn
Copy link

@StarArawn StarArawn commented Jun 28, 2021

This mainly just changes transform bindings from being stored like:

    mesh_transform_bind_group: Option<BindGroup>

to

    mesh_transform_bind_group: FrameSlabMap<BufferId, BindGroup>,
    mesh_transform_bind_group_key: Option<FrameSlabMapKey<BufferId, BindGroup>>,

The reason for this change is that when the transform_uniforms grow in prepare we need to create a new bind group in queue as we have a new uniform buffer.

In the future I think we should have some sort of single item API for single bind groups like this as it felt kinda weird needing to store the FrameSlabMapKey.

@StarArawn StarArawn changed the title Fixed issue where transform buffer wasn't creating new bindings on resize.. Fixed issue where transform buffer wasn't creating new bindings on resize. Jun 28, 2021
@cart
Copy link
Owner

cart commented Jul 1, 2021

Yup good call. My current take for the future:

  • Create a FrameHashMap primitive
  • Re-add an easy way to hash bind groups based on their contents (for small bind groups this should be approximately the same cost as hashing a single BufferId)
  • Create a BindGroupCache resource that is probably just a type alias for FrameHashMap<BindGroupDescriptor, BindGroup>, which we automatically call next_frame() for.

@cart cart merged commit 5de75a5 into cart:pipelined-rendering Jul 1, 2021
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