From 0428e8c7dacedfbd8ae4786b71f5b28f2a5dfeb5 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 9 Oct 2022 13:13:05 +0100 Subject: [PATCH] Support forcing regular descriptor sets in VK pipeline cache --- .../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, 3 insertions(+), 3 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 bb0cd105..1add7a6f 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 @@ -324,7 +324,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, span pushConstantRanges) { + GraphicsPipelineCache::CompiledPipeline GraphicsPipelineCache::GetCompiledPipeline(const PipelineState &state, span layoutBindings, span pushConstantRanges, bool noPushDescriptors) { std::unique_lock lock(mutex); auto it{pipelineCache.find(state)}; @@ -334,7 +334,7 @@ namespace skyline::gpu::cache { lock.unlock(); vk::raii::DescriptorSetLayout descriptorSetLayout{gpu.vkDevice, vk::DescriptorSetLayoutCreateInfo{ - .flags = vk::DescriptorSetLayoutCreateFlags{}, + .flags = vk::DescriptorSetLayoutCreateFlags{(!noPushDescriptors && gpu.traits.supportsPushDescriptors) ? vk::DescriptorSetLayoutCreateFlagBits::ePushDescriptorKHR : vk::DescriptorSetLayoutCreateFlags{}}, .pBindings = layoutBindings.data(), .bindingCount = static_cast(layoutBindings.size()), }}; 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 4f81de6b..215515b1 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 @@ -157,6 +157,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, span pushConstantRanges = {}); + CompiledPipeline GetCompiledPipeline(const PipelineState& state, span layoutBindings, span pushConstantRanges = {}, bool noPushDescriptors = false); }; }