vk: make frames in flight configurable
This commit is contained in:
parent
60f2ae6da8
commit
98e5070d81
|
@ -201,8 +201,13 @@ impl FilterChain {
|
||||||
let (passes, semantics) = FilterChain::load_preset(preset.shaders, &preset.textures)?;
|
let (passes, semantics) = FilterChain::load_preset(preset.shaders, &preset.textures)?;
|
||||||
let device = vulkan.try_into()?;
|
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
|
// 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 luts = FilterChain::load_luts(&device, &preset.textures)?;
|
||||||
let samplers = SamplerSet::new(&device.device)?;
|
let samplers = SamplerSet::new(&device.device)?;
|
||||||
|
|
|
@ -14,6 +14,8 @@ pub struct FrameOptions {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FilterChainOptions {
|
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.
|
/// Whether or not to explicitly disable mipmap generation regardless of shader preset settings.
|
||||||
pub force_no_mipmaps: bool,
|
pub force_no_mipmaps: bool,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue