bevy/crates/bevy_render/src
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
..
batching clippy: expect large variants and other small fixes (#19222) 2025-05-15 22:29:59 +00:00
camera Projection Improvements (#18458) 2025-06-24 03:26:38 +00:00
diagnostic bevy_solari: RIS for Direct Lighting (#19620) 2025-06-23 00:47:10 +00:00
experimental Remove Shader weak_handles from bevy_render. (#19362) 2025-05-26 20:20:25 +00:00
mesh Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
primitives reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
render_graph Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
render_phase Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
render_resource Add write_buffer_range to RawBufferVec and BufferVec (#19775) 2025-06-24 00:33:41 +00:00
renderer Initial raytraced lighting progress (bevy_solari) (#19058) 2025-06-12 21:26:10 +00:00
texture Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
view Projection Improvements (#18458) 2025-06-24 03:26:38 +00:00
alpha.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bindless.wgsl Use global binding arrays for bindless resources. (#17898) 2025-02-21 05:55:36 +00:00
color_operations.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
extract_component.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
extract_instances.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
extract_param.rs Stop storing access for all systems (#19477) 2025-06-13 17:56:09 +00:00
extract_resource.rs Fix "Unrecognized Option" error when using Criterion-specific arguments in benchmarks (#17222) 2025-01-08 00:09:31 +00:00
globals.rs Remove Shader weak_handles from bevy_render. (#19362) 2025-05-26 20:20:25 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
gpu_readback.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
lib.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
maths.wgsl Atmosphere LUT parameterization improvements (#17555) 2025-02-03 21:52:11 +00:00
pipelined_rendering.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
render_asset.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
settings.rs clippy: expect large variants and other small fixes (#19222) 2025-05-15 22:29:59 +00:00
storage.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
sync_component.rs Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
sync_world.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00