bevy/crates/bevy_render/src
Brezak 54a3fd7754
Don't overalign aligned values in gpu_readback::align_byte_size (#17007)
# Objective

Fix alignment calculations in our rendering code.
Fixes #16992 

The `gpu_readback::align_byte_size` function incorrectly rounds aligned
values to the next alignment.
If we assume the alignment to be 256 (because that's what wgpu says it
its) the function would align 0 to 256, 256 to 512, etc...

## Solution

Forward the `gpu_readback::align_byte_size` to
`RenderDevice::align_copy_bytes_per_row` so we don't implement the same
method twice.
Simplify `RenderDevice::align_copy_bytes_per_row`.

## Testing

Ran the code provided in #16992 to see if the issue has been solved +
added a test to check if `align_copy_bytes_per_row` returns the correct
values.
2024-12-30 05:51:37 +00:00
..
batching Fix several regressions from recent rendering changes. (#16890) 2024-12-22 23:03:06 +00:00
camera impl EntityBorrow for more types (#16917) 2024-12-24 02:47:03 +00:00
diagnostic Ensure Bevy's rendering byte usage is little-endian (#15750) 2024-10-08 22:43:35 +00:00
mesh Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
primitives Add .contains_aabb for Frustum (#16022) 2024-12-01 21:30:01 +00:00
render_graph Prefer Display over Debug (#16112) 2024-12-27 00:40:06 +00:00
render_phase track_change_detection: Also track spawns/despawns (#16047) 2024-12-17 04:46:31 +00:00
render_resource Move futures.rs, ConditionalSend and BoxedFuture types to bevy_tasks (#16951) 2024-12-29 19:29:53 +00:00
renderer Don't overalign aligned values in gpu_readback::align_byte_size (#17007) 2024-12-30 05:51:37 +00:00
texture Change GpuImage::size from UVec2 to Extent3d (#16815) 2024-12-17 19:08:09 +00:00
view Make RawHandleWrapper fields private to save users from themselves (#16968) 2024-12-29 19:54:57 +00:00
alpha.rs
color_operations.wgsl
extract_component.rs Remove ExtractComponent::Out (#15926) 2024-10-15 23:42:35 +00:00
extract_instances.rs Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
extract_param.rs Implement WorldQuery for MainWorld and RenderWorld components (#15745) 2024-10-13 20:58:46 +00:00
extract_resource.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
globals.rs Remove bevy_core (#16897) 2024-12-19 18:36:51 +00:00
globals.wgsl
gpu_component_array_buffer.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
gpu_readback.rs Don't overalign aligned values in gpu_readback::align_byte_size (#17007) 2024-12-30 05:51:37 +00:00
lib.rs Fix several regressions from recent rendering changes. (#16890) 2024-12-22 23:03:06 +00:00
maths.wgsl
pipelined_rendering.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
render_asset.rs Update hashbrown to 0.15 (#15801) 2024-12-10 19:45:50 +00:00
settings.rs cleanup bevy_render/lib.rs (#16481) 2024-11-22 22:32:04 +00:00
spatial_bundle.rs Deprecate SpatialBundle (#15830) 2024-10-13 17:28:22 +00:00
storage.rs Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
sync_component.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
sync_world.rs impl EntityBorrow for more types (#16917) 2024-12-24 02:47:03 +00:00