Allow supplying push constants to GetPipeline

This commit is contained in:
Billy Laws 2022-07-31 13:17:57 +01:00
parent 1c8863ec3b
commit cb0b132486
2 changed files with 4 additions and 2 deletions

View File

@ -315,7 +315,7 @@ namespace skyline::gpu::cache {
GraphicsPipelineCache::CompiledPipeline::CompiledPipeline(const PipelineCacheEntry &entry) : descriptorSetLayout(*entry.descriptorSetLayout), pipelineLayout(*entry.pipelineLayout), pipeline(*entry.pipeline) {}
GraphicsPipelineCache::CompiledPipeline GraphicsPipelineCache::GetCompiledPipeline(const PipelineState &state, span<vk::DescriptorSetLayoutBinding> layoutBindings) {
GraphicsPipelineCache::CompiledPipeline GraphicsPipelineCache::GetCompiledPipeline(const PipelineState &state, span<const vk::DescriptorSetLayoutBinding> layoutBindings, span<const vk::PushConstantRange> pushConstantRanges) {
std::unique_lock lock(mutex);
auto it{pipelineCache.find(state)};
@ -333,6 +333,8 @@ namespace skyline::gpu::cache {
vk::raii::PipelineLayout pipelineLayout{gpu.vkDevice, vk::PipelineLayoutCreateInfo{
.pSetLayouts = &*descriptorSetLayout,
.setLayoutCount = 1,
.pPushConstantRanges = pushConstantRanges.data(),
.pushConstantRangeCount = static_cast<u32>(pushConstantRanges.size()),
}};
boost::container::small_vector<vk::AttachmentDescription, 8> attachmentDescriptions;

View File

@ -155,6 +155,6 @@ namespace skyline::gpu::cache {
* @note Shader specializiation constants are **not** supported and will result in UB
* @note Input/Resolve attachments are **not** supported and using them with the supplied pipeline will result in UB
*/
CompiledPipeline GetCompiledPipeline(const PipelineState& state, span<vk::DescriptorSetLayoutBinding> layoutBindings);
CompiledPipeline GetCompiledPipeline(const PipelineState& state, span<const vk::DescriptorSetLayoutBinding> layoutBindings, span<const vk::PushConstantRange> pushConstantRanges = {});
};
}