bevy/crates/bevy_render/src
Brezak 4f1bc8e2b8 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.
2025-01-03 19:34:16 +01:00
..
batching Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
camera remove ViewUniformOffset from inactive cameras (#16399) 2024-11-17 18:38:10 +01:00
diagnostic Ensure Bevy's rendering byte usage is little-endian (#15750) 2024-10-08 22:43:35 +00:00
mesh Revert default mesh materials (#15930) 2024-10-15 19:47:40 +00:00
primitives Migrate cameras to required components (#15641) 2024-10-05 01:59:52 +00:00
render_graph More #[doc(fake_variadic)] goodness (#16108) 2024-10-27 21:18:18 +01:00
render_phase Make BinnedRenderPhase fields for accessing batchable and unbatchable entities public (#16142) 2024-11-11 21:50:47 +01:00
render_resource Bind only the written parts of storage buffers. (#16405) 2024-11-17 18:39:34 +01:00
renderer Don't overalign aligned values in gpu_readback::align_byte_size (#17007) 2025-01-03 19:34:16 +01:00
texture Do not re-check visibility or re-render shadow maps for point and spot lights for each view (#15156) 2024-11-17 19:06:11 +01:00
view Only use the AABB center for mesh visibility range testing if specified. (#16468) 2024-11-22 21:24:03 +01:00
alpha.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +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 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 aligning public apis of Time,Timer and Stopwatch (#15962) 2024-10-16 21:09:32 +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 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) 2025-01-03 19:34:16 +01:00
lib.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-11 22:16:38 +01:00
maths.wgsl add tonemapping LUT bindings for sprite and mesh2d pipelines (#13262) 2024-05-28 12:09:26 +00:00
pipelined_rendering.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
render_asset.rs Remove thiserror from bevy_render (#15765) 2024-10-09 14:26:28 +00:00
settings.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
spatial_bundle.rs Deprecate SpatialBundle (#15830) 2024-10-13 17:28:22 +00:00
storage.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
sync_component.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
sync_world.rs Use default storage for TemporaryRenderEntity (#16462) 2024-11-22 23:09:40 +01:00