Abstract out pipeline-compile-time GPU state accesses

Introduces the base abstractions that will be used for pipeline caching, with a 'PipelineStateBundle' that can be (de)serialised to/from disk and an abstract accessor class to allow switching between creating disk-cached pipelines and fresh ones.
This commit is contained in:
Billy Laws
2022-12-03 14:36:30 +00:00
parent 2e96248fb6
commit e849264028
10 changed files with 314 additions and 27 deletions

View File

@ -136,6 +136,7 @@ namespace skyline::gpu {
.scissorCount = 1
};
std::array<vk::Format, 1> colorFormats{colorAttachment ? colorAttachment->format->vkFormat : vk::Format::eUndefined};
return gpu.graphicsPipelineCache.GetCompiledPipeline(cache::GraphicsPipelineCache::PipelineState{
.shaderStages = shaderStages,
.vertexState = vertexState,
@ -147,8 +148,8 @@ namespace skyline::gpu {
.depthStencilState = depthStencilState,
.colorBlendState = blendState,
.dynamicState = {},
.colorAttachments = span<TextureView *>{colorAttachment},
.depthStencilAttachment = depthStencilAttachment,
.colorFormats = colorFormats,
.depthStencilFormat = depthStencilAttachment ? depthStencilAttachment->format->vkFormat : vk::Format::eUndefined,
}, layoutBindings, pushConstantRanges, true);
}