From 9a9947076c1d3a4a43db9f9ca6114d238d4e5184 Mon Sep 17 00:00:00 2001 From: Rua Date: Wed, 27 Sep 2023 16:10:49 +0200 Subject: [PATCH] Make `IndexBuffer::as_bytes` public --- vulkano/src/buffer/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vulkano/src/buffer/mod.rs b/vulkano/src/buffer/mod.rs index 5b4605e693..df538f0839 100644 --- a/vulkano/src/buffer/mod.rs +++ b/vulkano/src/buffer/mod.rs @@ -995,6 +995,7 @@ pub enum IndexBuffer { } impl IndexBuffer { + /// Returns an `IndexType` value corresponding to the type of the buffer. #[inline] pub fn index_type(&self) -> IndexType { match self { @@ -1004,8 +1005,9 @@ impl IndexBuffer { } } + /// Returns the buffer reinterpreted as a buffer of bytes. #[inline] - pub(crate) fn as_bytes(&self) -> &Subbuffer<[u8]> { + pub fn as_bytes(&self) -> &Subbuffer<[u8]> { match self { IndexBuffer::U8(buffer) => buffer.as_bytes(), IndexBuffer::U16(buffer) => buffer.as_bytes(),