1
0
Fork 0
forked from wry/wry

vulkan: split renderer pipeline caches

This commit is contained in:
kossLAN 2026-05-29 21:12:22 -04:00
parent ed0dc3fbad
commit 795cc7d117
No known key found for this signature in database
2 changed files with 38 additions and 24 deletions

View file

@ -1,5 +1,6 @@
mod color;
mod op;
mod pipeline_cache;
mod paint_region;
use {
@ -9,6 +10,7 @@ use {
VulkanRoundedTexOp, VulkanTexOp,
},
paint_region::{PaintRegion, Point, constrain_to_fb},
pipeline_cache::{FillPipelines, OutPipelineKey, TexPipelineKey, TexPipelines},
crate::{
async_engine::{AsyncEngine, SpawnedFuture},
cmm::{
@ -220,30 +222,6 @@ pub(super) struct PendingFrame {
_used_buffers: ArrayVec<VulkanBuffer, 4>,
}
type FillPipelines = Rc<StaticMap<TexSourceType, Rc<VulkanPipeline>>>;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
struct TexPipelineKey {
tex_copy_type: TexCopyType,
tex_source_type: TexSourceType,
tex_alpha_mode: AlphaMode,
eotf: VulkanEotf,
has_color_management_data: bool,
}
pub(super) struct TexPipelines {
format: vk::Format,
eotf: VulkanEotf,
pipelines: CopyHashMap<TexPipelineKey, Rc<VulkanPipeline>>,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub(super) struct OutPipelineKey {
format: vk::Format,
eotf: VulkanEotf,
has_color_management_data: bool,
}
impl VulkanDevice {
pub fn create_renderer(
self: &Rc<Self>,

View file

@ -0,0 +1,36 @@
use {
super::op::{TexCopyType, TexSourceType},
crate::{
gfx_api::AlphaMode,
gfx_apis::vulkan::{eotfs::VulkanEotf, pipeline::VulkanPipeline},
utils::copyhashmap::CopyHashMap,
},
ash::vk,
linearize::StaticMap,
std::rc::Rc,
};
pub(in crate::gfx_apis::vulkan) type FillPipelines =
Rc<StaticMap<TexSourceType, Rc<VulkanPipeline>>>;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub(super) struct TexPipelineKey {
pub(super) tex_copy_type: TexCopyType,
pub(super) tex_source_type: TexSourceType,
pub(super) tex_alpha_mode: AlphaMode,
pub(super) eotf: VulkanEotf,
pub(super) has_color_management_data: bool,
}
pub(in crate::gfx_apis::vulkan) struct TexPipelines {
pub(super) format: vk::Format,
pub(super) eotf: VulkanEotf,
pub(super) pipelines: CopyHashMap<TexPipelineKey, Rc<VulkanPipeline>>,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub(in crate::gfx_apis::vulkan) struct OutPipelineKey {
pub(super) format: vk::Format,
pub(super) eotf: VulkanEotf,
pub(super) has_color_management_data: bool,
}