From dd315e50ff46f281a50e6bc207cf2593f71e4b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B3nimo=20S=C3=A1nchez?= Date: Fri, 3 Dec 2021 21:34:30 +0100 Subject: [PATCH] Extended Queue::write_* docs to reflect overrun error (#2250) * Extended Queue::write_buffer to reflect overrun error * Extended Queue::write_texture doc to reflect overrun error --- wgpu/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 82869e020a..3558cdc284 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -3157,6 +3157,8 @@ impl Queue { /// This method is intended to have low performance costs. /// As such, the write is not immediately submitted, and instead enqueued /// internally to happen at the start of the next `submit()` call. + /// + /// This method fails if `data` overruns the size of `buffer` starting at `offset`. pub fn write_buffer(&self, buffer: &Buffer, offset: BufferAddress, data: &[u8]) { Context::queue_write_buffer(&*self.context, &self.id, &buffer.id, offset, data) } @@ -3166,6 +3168,8 @@ impl Queue { /// This method is intended to have low performance costs. /// As such, the write is not immediately submitted, and instead enqueued /// internally to happen at the start of the next `submit()` call. + /// + /// This method fails if `data` overruns the size of fragment of `texture` specified with `size`. pub fn write_texture( &self, texture: ImageCopyTexture,