diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:23 +0100 |
commit | c92ddd37d04ebc7fb5582edd399f607c542e5501 (patch) | |
tree | bea339649563f27a140e5c81f533325cf5580a20 /stockton-render/src/draw/texture | |
parent | 36fdf081022aae4b21758fe23422ead88c9ca9d6 (diff) |
fix(draw): better queue negotiator
Diffstat (limited to 'stockton-render/src/draw/texture')
-rw-r--r-- | stockton-render/src/draw/texture/mod.rs | 2 | ||||
-rw-r--r-- | stockton-render/src/draw/texture/repo.rs | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/stockton-render/src/draw/texture/mod.rs b/stockton-render/src/draw/texture/mod.rs index 62b28c5..5720349 100644 --- a/stockton-render/src/draw/texture/mod.rs +++ b/stockton-render/src/draw/texture/mod.rs @@ -12,7 +12,7 @@ pub use self::block::TexturesBlock; pub use self::image::LoadableImage; pub use self::load::TextureLoadConfig; pub use self::loader::BlockRef; -pub use self::repo::TextureRepo; +pub use self::repo::{TextureRepo, TexLoadQueue}; /// The size of each pixel in an image pub const PIXEL_SIZE: usize = std::mem::size_of::<u8>() * 4; diff --git a/stockton-render/src/draw/texture/repo.rs b/stockton-render/src/draw/texture/repo.rs index ef35610..d2aa9f2 100644 --- a/stockton-render/src/draw/texture/repo.rs +++ b/stockton-render/src/draw/texture/repo.rs @@ -4,6 +4,7 @@ use super::{ loader::{BlockRef, LoaderRequest, TextureLoader, TextureLoaderRemains, NUM_SIMULTANEOUS_CMDS}, resolver::TextureResolver, }; +use crate::draw::queue_negotiator::QueueFamilySelector; use crate::error::LockPoisoned; use crate::types::*; @@ -43,10 +44,6 @@ pub struct TextureRepo<'a> { } impl<'a> TextureRepo<'a> { - pub fn queue_family_filter(family: &&QueueFamilyT) -> bool { - family.queue_type().supports_transfer() && family.max_queues() >= NUM_SIMULTANEOUS_CMDS - } - pub fn new<R: 'static + TextureResolver + Send + Sync>( device_lock: Arc<RwLock<DeviceT>>, family: QueueFamilyId, @@ -198,3 +195,11 @@ impl<'a> TextureRepo<'a> { } } } + +pub struct TexLoadQueue; + +impl QueueFamilySelector for TexLoadQueue { + fn is_suitable(&self, family: &QueueFamilyT) -> bool { + family.queue_type().supports_transfer() && family.max_queues() >= NUM_SIMULTANEOUS_CMDS + } +}
\ No newline at end of file |