vk: make frames in flight configurable

This commit is contained in:
chyyran 2023-01-13 04:13:16 -05:00
parent 60f2ae6da8
commit 98e5070d81
2 changed files with 8 additions and 1 deletions

View file

@ -201,8 +201,13 @@ impl FilterChain {
let (passes, semantics) = FilterChain::load_preset(preset.shaders, &preset.textures)?;
let device = vulkan.try_into()?;
let mut frames_in_flight = options.map(|o| o.frames_in_flight).unwrap_or(0);
if frames_in_flight == 0 {
frames_in_flight = 3;
}
// initialize passes
let filters = Self::init_passes(&device, passes, &semantics, 3)?;
let filters = Self::init_passes(&device, passes, &semantics, frames_in_flight)?;
let luts = FilterChain::load_luts(&device, &preset.textures)?;
let samplers = SamplerSet::new(&device.device)?;

View file

@ -14,6 +14,8 @@ pub struct FrameOptions {
#[repr(C)]
#[derive(Debug, Clone)]
pub struct FilterChainOptions {
/// The number of frames in flight to keep. If zero, defaults to three.
pub frames_in_flight: u32,
/// Whether or not to explicitly disable mipmap generation regardless of shader preset settings.
pub force_no_mipmaps: bool,
}