so i'm seeing this issue on metal iOS:
SIZEOF UNIFORM: 204
validateFunctionArguments:3478: failed assertion `Vertex Function(main0): argument uniforms[0] from buffer(0) with offset(0) and length(204) has space for 204 bytes, but argument has a length(208).'
when i print my uniform std::mem::size_of above, it's 204, but metal refuses to run with this assertion error, so something is adding 4 bytes to the uniform buffer argument? if i add 4 to the size here it proceeds without error (presumably because it has enough space for the 208 byte argument now):
let uniform_buf = device.create_buffer(
&wgpu::BufferDescriptor {
size: uniform_size + 4,
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::TRANSFER_DST,
}
);
this doesn't seem to happen on macOS only iOS; i'm guessing something is attempting to add padding so its mod sizeof(ptr) ?
so i'm seeing this issue on metal iOS:
when i print my uniform
std::mem::size_ofabove, it's 204, but metal refuses to run with this assertion error, so something is adding 4 bytes to the uniform buffer argument? if i add 4 to the size here it proceeds without error (presumably because it has enough space for the 208 byte argument now):this doesn't seem to happen on macOS only iOS; i'm guessing something is attempting to add padding so its
mod sizeof(ptr)?