bevy/crates/bevy_pbr/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
..
atmosphere Replace FULLSCREEN_SHADER_HANDLE with a FullscreenShader resource. (#19426) 2025-06-24 00:02:23 +00:00
cluster Rename num_entities to entity_count (#19781) 2025-06-23 05:08:02 +00:00
decal Fix incorrect description of ClusteredDecal (#19630) 2025-06-13 19:31:09 +00:00
deferred Add SkipDeferredLighting component (#19628) 2025-06-15 16:30:08 +00:00
light Projection Improvements (#18458) 2025-06-24 03:26:38 +00:00
light_probe rename Transform::compute_matrix to to_matrix (#19646) 2025-06-18 05:37:25 +00:00
lightmap Component lifecycle reorganization and documentation (#19543) 2025-06-10 00:59:16 +00:00
meshlet Replace FULLSCREEN_SHADER_HANDLE with a FullscreenShader resource. (#19426) 2025-06-24 00:02:23 +00:00
prepass rename GlobalTransform::compute_matrix to to_matrix (#19643) 2025-06-17 18:37:26 +00:00
render Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
ssao Remove Shader weak_handles from bevy_pbr (excluding meshlets). (#19365) 2025-05-27 22:32:47 +00:00
ssr Replace FULLSCREEN_SHADER_HANDLE with a FullscreenShader resource. (#19426) 2025-06-24 00:02:23 +00:00
volumetric_fog rename GlobalTransform::compute_matrix to to_matrix (#19643) 2025-06-17 18:37:26 +00:00
components.rs reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
extended_material.rs Rename bevy_platform_support to bevy_platform (#18813) 2025-04-11 23:13:28 +00:00
fog.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
lib.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
material_bind_groups.rs Fix some typos (#19788) 2025-06-23 22:32:46 +00:00
material.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00
mesh_material.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
parallax.rs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
pbr_material.rs Use embedded_asset to load PBR shaders (#19137) 2025-05-16 05:47:34 +00:00
wireframe.rs Allow images to be resized on the GPU without losing data (#19462) 2025-06-24 06:22:50 +00:00