Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fill_buffer start has to be 16-byte aligned on DX11 #3718

Closed
kvark opened this issue Apr 6, 2021 · 3 comments · Fixed by #3738
Closed

fill_buffer start has to be 16-byte aligned on DX11 #3718

kvark opened this issue Apr 6, 2021 · 3 comments · Fixed by #3738

Comments

@kvark
Copy link
Member

kvark commented Apr 6, 2021

See gfx-rs/wgpu#1303 (comment)
We may need to expose a limit for this.
cc @cwfitzgerald

@kvark
Copy link
Member Author

kvark commented Apr 18, 2021

@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.

@kvark kvark removed the type: api label Apr 18, 2021
@cwfitzgerald
Copy link
Member

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.

@kvark
Copy link
Member Author

kvark commented Apr 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants