Skip to content

Commit

Permalink
Make IndexBuffer::as_bytes public (#2338)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rua authored Sep 27, 2023
1 parent a8ca0a7 commit 59d7c81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vulkano/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(),
Expand Down

0 comments on commit 59d7c81

Please # to comment.