Cleanup helper pipeline cache code

This commit is contained in:
Billy Laws 2023-01-08 21:06:56 +00:00
parent 1f99d63a80
commit a8b32c3cef
2 changed files with 10 additions and 7 deletions

View File

@ -258,8 +258,9 @@ namespace skyline::gpu {
},
GetPipeline(gpu,
{dstImageView->format->vkFormat,
vk::Format::eUndefined, false, false, 0,
VkColorComponentFlags{vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA}},
vk::Format::eUndefined, 0,
VkColorComponentFlags{vk::ColorComponentFlagBits::eR | vk::ColorComponentFlagBits::eG | vk::ColorComponentFlagBits::eB | vk::ColorComponentFlagBits::eA},
false, false},
{blit::SamplerLayoutBinding}, blit::PushConstantRanges),
dstImageDimensions
)};
@ -358,9 +359,9 @@ namespace skyline::gpu {
GetPipeline(gpu,
{writeColor ? dstImageView->format->vkFormat : vk::Format::eUndefined,
(writeDepth || writeStencil) ? dstImageView->format->vkFormat : vk::Format::eUndefined,
writeDepth, writeStencil,
value.depthStencil.stencil,
VkColorComponentFlags{components}},
VkColorComponentFlags{components},
writeDepth, writeStencil},
{}, clear::PushConstantRanges),
dstImageView->texture->dimensions
)};

View File

@ -26,12 +26,14 @@ namespace skyline::gpu {
struct PipelineState {
vk::Format colorFormat;
vk::Format depthFormat;
bool depthWrite;
bool stencilWrite;
u32 stencilValue;
VkColorComponentFlags colorWriteMask;
bool depthWrite;
bool stencilWrite;
bool operator<=>(const PipelineState &) const = default;
bool operator==(const PipelineState &input) const {
return std::memcmp(this, &input, sizeof(PipelineState)) == 0;
}
};
std::unordered_map<PipelineState, cache::GraphicsPipelineCache::CompiledPipeline, util::ObjectHash<PipelineState>> pipelineCache;