Skip to content

Commit

Permalink
small Buffer docs fixes (#2328)
Browse files Browse the repository at this point in the history
* fixed Buffer::new* docs still referring to buffer_info instead of create_info

* fixed line length

---------

Co-authored-by: Firestar99 <4696087-firestar99@users.noreply.gitlab.com>
  • Loading branch information
Firestar99 and Firestar99 authored Sep 14, 2023
1 parent f0a6ce1 commit 86f63ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vulkano/src/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl Buffer {
///
/// # Panics
///
/// - Panics if `buffer_info.size` is not zero.
/// - Panics if `create_info.size` is not zero.
pub fn new_sized<T>(
allocator: Arc<dyn MemoryAllocator>,
create_info: BufferCreateInfo,
Expand All @@ -330,7 +330,7 @@ impl Buffer {
///
/// # Panics
///
/// - Panics if `buffer_info.size` is not zero.
/// - Panics if `create_info.size` is not zero.
/// - Panics if `len` is zero.
pub fn new_slice<T>(
allocator: Arc<dyn MemoryAllocator>,
Expand All @@ -349,7 +349,7 @@ impl Buffer {
///
/// # Panics
///
/// - Panics if `buffer_info.size` is not zero.
/// - Panics if `create_info.size` is not zero.
/// - Panics if `len` is zero.
pub fn new_unsized<T>(
allocator: Arc<dyn MemoryAllocator>,
Expand All @@ -376,7 +376,7 @@ impl Buffer {
///
/// # Panics
///
/// - Panics if `buffer_info.size` is not zero.
/// - Panics if `create_info.size` is not zero.
/// - Panics if `layout.alignment()` is greater than 64.
pub fn new(
allocator: Arc<dyn MemoryAllocator>,
Expand All @@ -388,10 +388,10 @@ impl Buffer {
// TODO: Enable once sparse binding materializes
// assert!(!allocate_info.flags.contains(BufferCreateFlags::SPARSE_BINDING));

assert!(
create_info.size == 0,
"`Buffer::new*` functions set the `buffer_info.size` field themselves, you should not \
set it yourself",
assert_eq!(
create_info.size, 0,
"`Buffer::new*` functions set the `create_info.size` field themselves, you should not \
set it yourself"
);

create_info.size = layout.size();
Expand Down

0 comments on commit 86f63ac

Please sign in to comment.