Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Lower command buffer/descriptor set allocator defaults #2369

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions vulkano/src/command_buffer/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,12 @@ pub struct StandardCommandBufferAllocatorCreateInfo {
/// would mean that the pool would have to be reset more often, or that more pools would need
/// to be created, depending on the lifetime of the command buffers.
///
/// The default value is `256`.
/// The default value is `32`.
pub primary_buffer_count: usize,

/// Same as `primary_buffer_count` except for secondary command buffers.
///
/// The default value is `256`.
/// The default value is `0`.
pub secondary_buffer_count: usize,

pub _ne: crate::NonExhaustive,
Expand All @@ -554,8 +554,8 @@ impl Default for StandardCommandBufferAllocatorCreateInfo {
#[inline]
fn default() -> Self {
StandardCommandBufferAllocatorCreateInfo {
primary_buffer_count: 256,
secondary_buffer_count: 256,
primary_buffer_count: 32,
secondary_buffer_count: 0,
_ne: crate::NonExhaustive(()),
}
}
Expand Down
22 changes: 17 additions & 5 deletions vulkano/src/command_buffer/auto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ mod tests {
use crate::{
buffer::{Buffer, BufferCreateInfo, BufferUsage},
command_buffer::{
allocator::StandardCommandBufferAllocator, AutoCommandBufferBuilder, BufferCopy,
CommandBufferUsage, CopyBufferInfoTyped, PrimaryCommandBufferAbstract,
allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo},
AutoCommandBufferBuilder, BufferCopy, CommandBufferUsage, CopyBufferInfoTyped,
PrimaryCommandBufferAbstract,
},
descriptor_set::{
allocator::StandardDescriptorSetAllocator,
Expand Down Expand Up @@ -447,7 +448,13 @@ mod tests {
fn secondary_nonconcurrent_conflict() {
let (device, queue) = gfx_dev_and_queue!();

let cb_allocator = StandardCommandBufferAllocator::new(device, Default::default());
let cb_allocator = StandardCommandBufferAllocator::new(
device,
StandardCommandBufferAllocatorCreateInfo {
secondary_buffer_count: 1,
..Default::default()
},
);

// Make a secondary CB that doesn't support simultaneous use.
let builder = AutoCommandBufferBuilder::secondary(
Expand Down Expand Up @@ -605,8 +612,13 @@ mod tests {
unsafe {
let (device, queue) = gfx_dev_and_queue!();

let cb_allocator =
StandardCommandBufferAllocator::new(device.clone(), Default::default());
let cb_allocator = StandardCommandBufferAllocator::new(
device.clone(),
StandardCommandBufferAllocatorCreateInfo {
secondary_buffer_count: 1,
..Default::default()
},
);
let cbb = AutoCommandBufferBuilder::primary(
&cb_allocator,
queue.queue_family_index(),
Expand Down
4 changes: 2 additions & 2 deletions vulkano/src/descriptor_set/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub struct StandardDescriptorSetAllocatorCreateInfo {
/// hand would mean that the pool would have to be reset more often, or that more pools would
/// need to be created, depending on the lifetime of the descriptor sets.
///
/// The default value is `256`.
/// The default value is `32`.
pub set_count: usize,

/// Whether to allocate descriptor pools with the
Expand All @@ -481,7 +481,7 @@ impl Default for StandardDescriptorSetAllocatorCreateInfo {
#[inline]
fn default() -> Self {
StandardDescriptorSetAllocatorCreateInfo {
set_count: 256,
set_count: 32,
update_after_bind: false,
_ne: crate::NonExhaustive(()),
}
Expand Down