From 40fa5e4d714944ad92815dbc31ceea607947a5a1 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 13 Sep 2020 00:10:06 -0400 Subject: [PATCH] Document the bind buffer alignment --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 2a4ad8114..599a7022d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -860,6 +860,8 @@ pub enum BindingResource<'a> { buffer: &'a Buffer, /// Base offset of the buffer. For bindings with `dynamic == true`, this offset /// will be added to the dynamic offset provided in [`RenderPass::set_bind_group`]. + /// + /// The offset has to be aligned to [`BIND_BUFFER_ALIGNMENT`]. offset: BufferAddress, /// Size of the binding, or `None` for using the rest of the buffer. size: Option, @@ -1948,6 +1950,7 @@ impl<'a> RenderPass<'a> { /// in the active pipeline when any `draw()` function is called must match the layout of this bind group. /// /// If the bind group have dynamic offsets, provide them in order of their declaration. + /// These offsets have to be aligned to [`BIND_BUFFER_ALIGNMENT`]. pub fn set_bind_group( &mut self, index: u32, @@ -2319,6 +2322,7 @@ impl<'a> ComputePass<'a> { /// in the active pipeline when the `dispatch()` function is called must match the layout of this bind group. /// /// If the bind group have dynamic offsets, provide them in order of their declaration. + /// These offsets have to be aligned to [`BIND_BUFFER_ALIGNMENT`]. pub fn set_bind_group( &mut self, index: u32,