Skip to content

Commit

Permalink
small Buffer docs fixes (vulkano-rs#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
2 people authored and hakolao committed Feb 20, 2024
1 parent ffe0237 commit 9724e09
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 9724e09

Please # to comment.