bevy/crates/bevy_sprite/src/mesh2d
charlotte 🌸 7b5e4e3be0
Allow images to be resized on the GPU without losing data (#19462)
# Objective

#19410 added support for resizing images "in place" meaning that their
data was copied into the new texture allocation on the CPU. However,
there are some scenarios where an image may be created and populated
entirely on the GPU. Using this method would cause data to disappear, as
it wouldn't be copied into the new texture.

## Solution

When an image is resized in place, if it has no data in it's asset,
we'll opt into a new flag `copy_on_resize` which will issue a
`copy_texture_to_texture` command on the old allocation.

To support this, we require passing the old asset to all `RenderAsset`
implementations. This will be generally useful in the future for
reducing things like buffer re-allocations.

## Testing

Tested using the example in the issue.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-06-24 06:22:50 +00:00
..
color_material.rs Remove Shader weak_handles from bevy_sprite. (#19392) 2025-05-27 04:01:34 +00:00
color_material.wgsl Add uv_transform to ColorMaterial (#17879) 2025-02-24 21:17:26 +00:00
material.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
mesh2d_bindings.wgsl
mesh2d_functions.wgsl Fix mesh tag feature for 2d. (#18636) 2025-03-31 18:07:20 +00:00
mesh2d_types.wgsl Fix mesh tag feature for 2d. (#18636) 2025-03-31 18:07:20 +00:00
mesh2d_vertex_output.wgsl
mesh2d_view_bindings.wgsl
mesh2d_view_types.wgsl
mesh2d.wgsl
mesh.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
mod.rs
wireframe2d.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
wireframe2d.wgsl Add binned 2d/3d Wireframe render phase (#18587) 2025-04-09 21:34:53 +00:00