Vulkan: Implement a pipeline UID cache
This stores enough information to recreate the pipeline, including the shader UIDs, blend/depth/rasterization state, primitive and vertex format.
This commit is contained in:
1 parent
681294586b
commit
aac66a1b61
7 files changed
+227
-40
No files matched your search
@@ -53,6 +53,19 @@ VertexFormat::VertexFormat(const PortableVertexDeclaration& in_vtx_decl)
|
||||
SetupInputState();
|
||||
}
|
||||
|
||||
VertexFormat* VertexFormat::GetOrCreateMatchingFormat(const PortableVertexDeclaration& decl)
|
||||
{
|
||||
auto vertex_format_map = VertexLoaderManager::GetNativeVertexFormatMap();
|
||||
auto iter = vertex_format_map->find(decl);
|
||||
if (iter == vertex_format_map->end())
|
||||
{
|
||||
auto ipair = vertex_format_map->emplace(decl, std::make_unique<VertexFormat>(decl));
|
||||
iter = ipair.first;
|
||||
}
|
||||
|
||||
return static_cast<VertexFormat*>(iter->second.get());
|
||||
}
|
||||
|
||||
void VertexFormat::MapAttributes()
|
||||
{
|
||||
m_num_attributes = 0;
|
||||
|
||||
Reference in new issue
Block a user