mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 01:59:19 +01:00
Hash subpass dependencies in RP cache
This commit is contained in:
parent
99bf7dbb36
commit
bb20b145a8
@ -23,7 +23,8 @@ namespace skyline::gpu::cache {
|
|||||||
|
|
||||||
RenderPassCache::RenderPassMetadata::RenderPassMetadata(const vk::RenderPassCreateInfo &createInfo)
|
RenderPassCache::RenderPassMetadata::RenderPassMetadata(const vk::RenderPassCreateInfo &createInfo)
|
||||||
: attachments{createInfo.pAttachments, createInfo.pAttachments + createInfo.attachmentCount},
|
: attachments{createInfo.pAttachments, createInfo.pAttachments + createInfo.attachmentCount},
|
||||||
subpasses{createInfo.pSubpasses, createInfo.pSubpasses + createInfo.subpassCount} {}
|
subpasses{createInfo.pSubpasses, createInfo.pSubpasses + createInfo.subpassCount},
|
||||||
|
dependencies{createInfo.pDependencies, createInfo.pDependencies + createInfo.dependencyCount} {}
|
||||||
|
|
||||||
#define HASH(x) boost::hash_combine(hash, x)
|
#define HASH(x) boost::hash_combine(hash, x)
|
||||||
|
|
||||||
@ -71,6 +72,17 @@ namespace skyline::gpu::cache {
|
|||||||
HASH(index);
|
HASH(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HASH(key.dependencies.size());
|
||||||
|
for (const auto &dependency : key.dependencies) {
|
||||||
|
HASH(dependency.srcSubpass);
|
||||||
|
HASH(dependency.dstSubpass);
|
||||||
|
HASH(static_cast<VkDependencyFlags>(dependency.dependencyFlags));
|
||||||
|
HASH(static_cast<VkPipelineStageFlags>(dependency.srcStageMask));
|
||||||
|
HASH(static_cast<VkPipelineStageFlags>(dependency.dstStageMask));
|
||||||
|
HASH(static_cast<VkAccessFlags>(dependency.srcAccessMask));
|
||||||
|
HASH(static_cast<VkAccessFlags>(dependency.dstAccessMask));
|
||||||
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,6 +131,17 @@ namespace skyline::gpu::cache {
|
|||||||
HASH(index);
|
HASH(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HASH(key.dependencyCount);
|
||||||
|
for (const auto &dependency : span<const vk::SubpassDependency>{key.pDependencies, key.dependencyCount}) {
|
||||||
|
HASH(dependency.srcSubpass);
|
||||||
|
HASH(dependency.dstSubpass);
|
||||||
|
HASH(static_cast<VkDependencyFlags>(dependency.dependencyFlags));
|
||||||
|
HASH(static_cast<VkPipelineStageFlags>(dependency.srcStageMask));
|
||||||
|
HASH(static_cast<VkPipelineStageFlags>(dependency.dstStageMask));
|
||||||
|
HASH(static_cast<VkAccessFlags>(dependency.srcAccessMask));
|
||||||
|
HASH(static_cast<VkAccessFlags>(dependency.dstAccessMask));
|
||||||
|
}
|
||||||
|
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,6 +180,8 @@ namespace skyline::gpu::cache {
|
|||||||
vkSubpass++;
|
vkSubpass++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RETARRNEQ(lhs.dependencies, rhs.pDependencies, rhs.dependencyCount)
|
||||||
|
|
||||||
#undef RETF
|
#undef RETF
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -38,6 +38,7 @@ namespace skyline::gpu::cache {
|
|||||||
struct RenderPassMetadata {
|
struct RenderPassMetadata {
|
||||||
std::vector<vk::AttachmentDescription> attachments;
|
std::vector<vk::AttachmentDescription> attachments;
|
||||||
std::vector<SubpassDescription> subpasses;
|
std::vector<SubpassDescription> subpasses;
|
||||||
|
std::vector<vk::SubpassDependency> dependencies;
|
||||||
|
|
||||||
RenderPassMetadata(const vk::RenderPassCreateInfo &createInfo);
|
RenderPassMetadata(const vk::RenderPassCreateInfo &createInfo);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user