refactor: make Ratio padding a single [f32; 2]

This commit is contained in:
pml68 2025-04-09 23:13:07 +02:00
parent e338e61e0b
commit c2e41a4346

View file

@ -254,11 +254,10 @@ impl Targets {
struct Ratio {
u: f32,
v: f32,
// Padding fields to make Ratio 16 byte aligned
// Padding field to make Ratio 16 byte aligned
//
// See https://docs.rs/wgpu/latest/wgpu/struct.DownlevelFlags.html#associatedconstant.BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED
p0: f32,
p1: f32,
_padding: [f32; 2],
}
pub struct State {
@ -311,8 +310,7 @@ impl State {
let ratio = Ratio {
u: region_size.width as f32 / targets.size.width as f32,
v: region_size.height as f32 / targets.size.height as f32,
p0: 0.0,
p1: 0.0,
_padding: [0.0; 2],
};
if Some(ratio) != self.last_ratio {