Closed kvark closed 3 years ago
@cwfitzgerald It occurred to me that DX11 backend can hide this limitation internally. It can basically create a 16-byte buffer with this data and issue a buffer-buffer copy for the unaligned part.
I'd be quite worried about the performance of this. Maybe expose a "performance only" limit so that wgpu can always properly align it, and if the value is unaligned we can fall back to this workaround.
I mean, there is clearly a naive path here. We can do better by making a pool of, say 256 byte buffers that are re-used, in which case the major cost - allocating a new buffer - goes away. The point is that it's possible to implement, and similar workarounds are already employed in other places (unfortunately, I suppose?).
Maybe when we finally change the direction to #2249, we can remove the workarounds.
See https://github.com/gfx-rs/wgpu/issues/1303#issuecomment-813756734 We may need to expose a limit for this. cc @cwfitzgerald