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 Swap material and mesh bind groups (#10485) 2023-11-28 22:26:22 +00:00
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 pbr shader cleanup (#10105) 2023-10-13 19:12:40 +00:00
mesh2d_view_bindings.wgsl add tonemapping LUT bindings for sprite and mesh2d pipelines (#13262) 2024-05-28 12:09:26 +00:00
mesh2d_view_types.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
mesh2d.wgsl Normalise matrix naming (#13489) 2024-06-03 16:56:53 +00:00
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 Support wireframes for 2D meshes (#12135) 2024-03-29 18:34:04 +00:00
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