Skip to content

Commit

Permalink
Use as_image_copy where possible
Browse files Browse the repository at this point in the history
Signed-off-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
  • Loading branch information
Torstein Grindvik committed Nov 25, 2023
1 parent 4eafd60 commit 0bb5b1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
7 changes: 1 addition & 6 deletions crates/bevy_pbr/src/render/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,7 @@ impl FromWorld for MeshPipeline {

let format_size = image.texture_descriptor.format.pixel_size();
render_queue.write_texture(
ImageCopyTexture {
texture: &texture,
mip_level: 0,
origin: Origin3d::ZERO,
aspect: TextureAspect::All,
},
texture.as_image_copy(),
&image.data,
ImageDataLayout {
offset: 0,
Expand Down
7 changes: 1 addition & 6 deletions crates/bevy_sprite/src/mesh2d/mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,7 @@ impl FromWorld for Mesh2dPipeline {

let format_size = image.texture_descriptor.format.pixel_size();
render_queue.write_texture(
ImageCopyTexture {
texture: &texture,
mip_level: 0,
origin: Origin3d::ZERO,
aspect: TextureAspect::All,
},
texture.as_image_copy(),
&image.data,
ImageDataLayout {
offset: 0,
Expand Down
7 changes: 1 addition & 6 deletions crates/bevy_sprite/src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ impl FromWorld for SpritePipeline {

let format_size = image.texture_descriptor.format.pixel_size();
render_queue.write_texture(
ImageCopyTexture {
texture: &texture,
mip_level: 0,
origin: Origin3d::ZERO,
aspect: TextureAspect::All,
},
texture.as_image_copy(),
&image.data,
ImageDataLayout {
offset: 0,
Expand Down

0 comments on commit 0bb5b1d

Please sign in to comment.