From cb0b132486cae7407bf1ba7019f757ad090dff1d Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 31 Jul 2022 13:17:57 +0100 Subject: [PATCH] Allow supplying push constants to GetPipeline --- .../main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp | 4 +++- app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp index 55bb57f2..def06a71 100644 --- a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp +++ b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp @@ -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 layoutBindings) { + GraphicsPipelineCache::CompiledPipeline GraphicsPipelineCache::GetCompiledPipeline(const PipelineState &state, span layoutBindings, span 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(pushConstantRanges.size()), }}; boost::container::small_vector attachmentDescriptions; diff --git a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h index fa0d0801..fd7c9512 100644 --- a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h +++ b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h @@ -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 layoutBindings); + CompiledPipeline GetCompiledPipeline(const PipelineState& state, span layoutBindings, span pushConstantRanges = {}); }; }