vulkan: split renderer pipeline caches
This commit is contained in:
parent
ed0dc3fbad
commit
795cc7d117
2 changed files with 38 additions and 24 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
mod color;
|
mod color;
|
||||||
mod op;
|
mod op;
|
||||||
|
mod pipeline_cache;
|
||||||
mod paint_region;
|
mod paint_region;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
|
|
@ -9,6 +10,7 @@ use {
|
||||||
VulkanRoundedTexOp, VulkanTexOp,
|
VulkanRoundedTexOp, VulkanTexOp,
|
||||||
},
|
},
|
||||||
paint_region::{PaintRegion, Point, constrain_to_fb},
|
paint_region::{PaintRegion, Point, constrain_to_fb},
|
||||||
|
pipeline_cache::{FillPipelines, OutPipelineKey, TexPipelineKey, TexPipelines},
|
||||||
crate::{
|
crate::{
|
||||||
async_engine::{AsyncEngine, SpawnedFuture},
|
async_engine::{AsyncEngine, SpawnedFuture},
|
||||||
cmm::{
|
cmm::{
|
||||||
|
|
@ -220,30 +222,6 @@ pub(super) struct PendingFrame {
|
||||||
_used_buffers: ArrayVec<VulkanBuffer, 4>,
|
_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 {
|
impl VulkanDevice {
|
||||||
pub fn create_renderer(
|
pub fn create_renderer(
|
||||||
self: &Rc<Self>,
|
self: &Rc<Self>,
|
||||||
|
|
|
||||||
36
src/gfx_apis/vulkan/renderer/pipeline_cache.rs
Normal file
36
src/gfx_apis/vulkan/renderer/pipeline_cache.rs
Normal 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,
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue