bevy/crates/bevy_render
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
..
macros Release 0.15.0 2024-11-29 01:50:42 +01:00
src Don't overalign aligned values in gpu_readback::align_byte_size (#17007) 2025-01-03 19:34:16 +01:00
Cargo.toml Release 0.15.0 2024-11-29 01:50:42 +01:00
README.md

Bevy Render

License Crates.io Downloads Docs Discord