bevy/crates/bevy_render/src/renderer
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
..
graph_runner.rs Remove thiserror from bevy_render (#15765) 2024-10-09 14:26:28 +00:00
mod.rs Remove render_resource_wrapper (#15441) 2024-09-30 17:37:07 +00:00
render_device.rs Don't overalign aligned values in gpu_readback::align_byte_size (#17007) 2025-01-03 19:34:16 +01:00