Closed QuantumEntangledAndy closed 2 years ago
I can not run the lights example code
Your recent commit of Fix Material Uniform alignment, gives me issues of
Fix Material Uniform alignment
Buffer is bound with size 32 where the shader expects 48 in group[1] compact index 1
I believe that this is because you have defined it as
struct Material { albedo: vec4<f32>; has_texture: u32; reserve: vec3<u32>; }; [[group(1), binding(1)]] var<uniform> u_material: Material;
However I believe it should be
struct Material { albedo: vec4<f32>; has_texture: u32; }; [[group(1), binding(1)]] var<uniform> u_material: Material;
From my experience you do not add padding to the wgsl size directly only in the data we pass to it. If you add the padding to make it 32bytes then the binding will expect 48 if you then add padding up to 48 it will expect it's size to be 64
This was fixed by #129
I can not run the lights example code
Your recent commit of
Fix Material Uniform alignment
, gives me issues ofI believe that this is because you have defined it as
However I believe it should be
From my experience you do not add padding to the wgsl size directly only in the data we pass to it. If you add the padding to make it 32bytes then the binding will expect 48 if you then add padding up to 48 it will expect it's size to be 64