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] - Added buffer usage field to buffers #7423

Closed
wants to merge 8 commits into from

Conversation

SpeedRoll
Copy link
Contributor

Objective

Buffers in bevy do not allow for setting buffer usage flags which can be useful for setting COPY_SRC, MAP_READ, MAP_WRITE, which allows for buffers to be copied from gpu to cpu for inspection.

Solution

Add buffer_usage field to buffers and a set_usage function to set them

@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you're read our [contributing guide](CONTRIBUTING.md) and we look forward to reviewing your Pull request shortly ✨

Copy link
Contributor

@kurtkuehnert kurtkuehnert left a comment

Choose a reason for hiding this comment

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

A nice first PR, thank you!
I think the buffer should be recreated, whenever the usage changes.
Besides the minor nit, this looks good to me.

crates/bevy_render/src/render_resource/storage_buffer.rs Outdated Show resolved Hide resolved
crates/bevy_render/src/render_resource/storage_buffer.rs Outdated Show resolved Hide resolved
@kurtkuehnert kurtkuehnert added C-Enhancement A new feature A-Rendering Drawing game state to the screen C-Usability A simple quality-of-life change that makes Bevy easier to use and removed C-Usability A simple quality-of-life change that makes Bevy easier to use labels Jan 30, 2023
@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you're read our [contributing guide](CONTRIBUTING.md) and we look forward to reviewing your Pull request shortly ✨

@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 Feb 3, 2023
@alice-i-cecile
Copy link
Member

bors try

@superdump or @james7132 when you're ready, feel free to merge this. I don't understand buffers well enough to feel confident merging this myself.

bors bot added a commit that referenced this pull request Feb 6, 2023
@bors
Copy link
Contributor

bors bot commented Feb 6, 2023

try

Build failed:

@alice-i-cecile
Copy link
Member

@SpeedRoll can you fix the CI errors listed in the output above so this becomes mergeable?

@SpeedRoll
Copy link
Contributor Author

@alice-i-cecile fixed

@alice-i-cecile
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Feb 6, 2023
@james7132
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Feb 6, 2023
# Objective

Buffers in bevy do not allow for setting buffer usage flags which can be useful for setting COPY_SRC, MAP_READ, MAP_WRITE, which allows for buffers to be copied from gpu to cpu for inspection.

## Solution

Add buffer_usage field to buffers and a set_usage function to set them
@bors
Copy link
Contributor

bors bot commented Feb 6, 2023

Build failed:

@alice-i-cecile
Copy link
Member

Ubuntu mirrors please...

bors retry

bors bot pushed a commit that referenced this pull request Feb 6, 2023
# Objective

Buffers in bevy do not allow for setting buffer usage flags which can be useful for setting COPY_SRC, MAP_READ, MAP_WRITE, which allows for buffers to be copied from gpu to cpu for inspection.

## Solution

Add buffer_usage field to buffers and a set_usage function to set them
@bors
Copy link
Contributor

bors bot commented Feb 6, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Feb 6, 2023
# Objective

Buffers in bevy do not allow for setting buffer usage flags which can be useful for setting COPY_SRC, MAP_READ, MAP_WRITE, which allows for buffers to be copied from gpu to cpu for inspection.

## Solution

Add buffer_usage field to buffers and a set_usage function to set them
@bors bors bot changed the title Added buffer usage field to buffers [Merged by Bors] - Added buffer usage field to buffers Feb 6, 2023
@bors bors bot closed this Feb 6, 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-Enhancement A new feature 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.

6 participants