refactor: make Ratio padding a single [f32; 2]
This commit is contained in:
parent
e338e61e0b
commit
c2e41a4346
1 changed files with 3 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue