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 as_image_copy where possible #10733

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

torsteingrindvik
Copy link
Contributor

Objective

wgpu has a helper method texture.as_image_copy() for a common pattern when making a default-like ImageCopyTexture from a texture.

This is used in various places in Bevy for texture copy operations, but it was not used where write_texture is called.

Solution

  • Replace struct ImageCopyTexture initialization with texture.as_image_copy() where appropriate

Signed-off-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
@james7132 james7132 requested a review from superdump November 25, 2023 20:12
@james7132 james7132 added A-Rendering Drawing game state to the screen C-Code-Quality A section of code that is hard to understand or change labels Nov 25, 2023
@james7132
Copy link
Member

Are there any caveats or benefits to using this API? Or is this purely for code quality?

@torsteingrindvik
Copy link
Contributor Author

Are there any caveats or benefits to using this API? Or is this purely for code quality?

No caveats- it's equivalent: https://docs.rs/wgpu/latest/src/wgpu/lib.rs.html#3284-3291

So just code quality.

@james7132 james7132 added this pull request to the merge queue Nov 26, 2023
Merged via the queue into bevyengine:main with commit 4788315 Nov 26, 2023
25 checks passed
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-Code-Quality A section of code that is hard to understand or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants