Skip to content

Commit

Permalink
Make IndexBuffer::as_bytes public (vulkano-rs#2338)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rua authored and hakolao committed Feb 20, 2024
1 parent 3a69554 commit 50a38b5
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 50a38b5

Please # to comment.