diff options
| author | 2022-12-02 17:04:28 -0500 | |
|---|---|---|
| committer | 2022-12-04 10:55:13 -0500 | |
| commit | e44a804ec75457457db1b4c439e4e5488e8e2f8e (patch) | |
| tree | a06c8730692e834bf604b41cb7197a51bf26982f /src/video_core/renderer_vulkan | |
| parent | vulkan_common: promote timeline semaphore usage to core (diff) | |
| download | yuzu-e44a804ec75457457db1b4c439e4e5488e8e2f8e.tar.gz yuzu-e44a804ec75457457db1b4c439e4e5488e8e2f8e.tar.xz yuzu-e44a804ec75457457db1b4c439e4e5488e8e2f8e.zip | |
vulkan_common: promote descriptor update template usage to core
Diffstat (limited to 'src/video_core/renderer_vulkan')
5 files changed, 16 insertions, 16 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index b7843e995..16c57aef7 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h | |||
| @@ -44,17 +44,17 @@ public: | |||
| 44 | }); | 44 | }); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | vk::DescriptorUpdateTemplateKHR CreateTemplate(VkDescriptorSetLayout descriptor_set_layout, | 47 | vk::DescriptorUpdateTemplate CreateTemplate(VkDescriptorSetLayout descriptor_set_layout, |
| 48 | VkPipelineLayout pipeline_layout, | 48 | VkPipelineLayout pipeline_layout, |
| 49 | bool use_push_descriptor) const { | 49 | bool use_push_descriptor) const { |
| 50 | if (entries.empty()) { | 50 | if (entries.empty()) { |
| 51 | return nullptr; | 51 | return nullptr; |
| 52 | } | 52 | } |
| 53 | const VkDescriptorUpdateTemplateType type = | 53 | const VkDescriptorUpdateTemplateType type = |
| 54 | use_push_descriptor ? VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR | 54 | use_push_descriptor ? VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR |
| 55 | : VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR; | 55 | : VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET; |
| 56 | return device->GetLogical().CreateDescriptorUpdateTemplateKHR({ | 56 | return device->GetLogical().CreateDescriptorUpdateTemplate({ |
| 57 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, | 57 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, |
| 58 | .pNext = nullptr, | 58 | .pNext = nullptr, |
| 59 | .flags = 0, | 59 | .flags = 0, |
| 60 | .descriptorUpdateEntryCount = static_cast<u32>(entries.size()), | 60 | .descriptorUpdateEntryCount = static_cast<u32>(entries.size()), |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.cpp b/src/video_core/renderer_vulkan/vk_compute_pass.cpp index 241d7573e..2c00979d7 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.cpp +++ b/src/video_core/renderer_vulkan/vk_compute_pass.cpp | |||
| @@ -93,7 +93,7 @@ constexpr DescriptorBankInfo ASTC_BANK_INFO{ | |||
| 93 | .score = 2, | 93 | .score = 2, |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | constexpr VkDescriptorUpdateTemplateEntryKHR INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE{ | 96 | constexpr VkDescriptorUpdateTemplateEntry INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMPLATE{ |
| 97 | .dstBinding = 0, | 97 | .dstBinding = 0, |
| 98 | .dstArrayElement = 0, | 98 | .dstArrayElement = 0, |
| 99 | .descriptorCount = 2, | 99 | .descriptorCount = 2, |
| @@ -102,7 +102,7 @@ constexpr VkDescriptorUpdateTemplateEntryKHR INPUT_OUTPUT_DESCRIPTOR_UPDATE_TEMP | |||
| 102 | .stride = sizeof(DescriptorUpdateEntry), | 102 | .stride = sizeof(DescriptorUpdateEntry), |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | constexpr std::array<VkDescriptorUpdateTemplateEntryKHR, ASTC_NUM_BINDINGS> | 105 | constexpr std::array<VkDescriptorUpdateTemplateEntry, ASTC_NUM_BINDINGS> |
| 106 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY{{ | 106 | ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY{{ |
| 107 | { | 107 | { |
| 108 | .dstBinding = ASTC_BINDING_INPUT_BUFFER, | 108 | .dstBinding = ASTC_BINDING_INPUT_BUFFER, |
| @@ -134,7 +134,7 @@ struct AstcPushConstants { | |||
| 134 | 134 | ||
| 135 | ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, | 135 | ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, |
| 136 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 136 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 137 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 137 | vk::Span<VkDescriptorUpdateTemplateEntry> templates, |
| 138 | const DescriptorBankInfo& bank_info, | 138 | const DescriptorBankInfo& bank_info, |
| 139 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code) | 139 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code) |
| 140 | : device{device_} { | 140 | : device{device_} { |
| @@ -155,13 +155,13 @@ ComputePass::ComputePass(const Device& device_, DescriptorPool& descriptor_pool, | |||
| 155 | .pPushConstantRanges = push_constants.data(), | 155 | .pPushConstantRanges = push_constants.data(), |
| 156 | }); | 156 | }); |
| 157 | if (!templates.empty()) { | 157 | if (!templates.empty()) { |
| 158 | descriptor_template = device.GetLogical().CreateDescriptorUpdateTemplateKHR({ | 158 | descriptor_template = device.GetLogical().CreateDescriptorUpdateTemplate({ |
| 159 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR, | 159 | .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO, |
| 160 | .pNext = nullptr, | 160 | .pNext = nullptr, |
| 161 | .flags = 0, | 161 | .flags = 0, |
| 162 | .descriptorUpdateEntryCount = templates.size(), | 162 | .descriptorUpdateEntryCount = templates.size(), |
| 163 | .pDescriptorUpdateEntries = templates.data(), | 163 | .pDescriptorUpdateEntries = templates.data(), |
| 164 | .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR, | 164 | .templateType = VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET, |
| 165 | .descriptorSetLayout = *descriptor_set_layout, | 165 | .descriptorSetLayout = *descriptor_set_layout, |
| 166 | .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, | 166 | .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS, |
| 167 | .pipelineLayout = *layout, | 167 | .pipelineLayout = *layout, |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pass.h b/src/video_core/renderer_vulkan/vk_compute_pass.h index dcc691a8e..5d32e3caf 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pass.h +++ b/src/video_core/renderer_vulkan/vk_compute_pass.h | |||
| @@ -29,14 +29,14 @@ class ComputePass { | |||
| 29 | public: | 29 | public: |
| 30 | explicit ComputePass(const Device& device, DescriptorPool& descriptor_pool, | 30 | explicit ComputePass(const Device& device, DescriptorPool& descriptor_pool, |
| 31 | vk::Span<VkDescriptorSetLayoutBinding> bindings, | 31 | vk::Span<VkDescriptorSetLayoutBinding> bindings, |
| 32 | vk::Span<VkDescriptorUpdateTemplateEntryKHR> templates, | 32 | vk::Span<VkDescriptorUpdateTemplateEntry> templates, |
| 33 | const DescriptorBankInfo& bank_info, | 33 | const DescriptorBankInfo& bank_info, |
| 34 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); | 34 | vk::Span<VkPushConstantRange> push_constants, std::span<const u32> code); |
| 35 | ~ComputePass(); | 35 | ~ComputePass(); |
| 36 | 36 | ||
| 37 | protected: | 37 | protected: |
| 38 | const Device& device; | 38 | const Device& device; |
| 39 | vk::DescriptorUpdateTemplateKHR descriptor_template; | 39 | vk::DescriptorUpdateTemplate descriptor_template; |
| 40 | vk::PipelineLayout layout; | 40 | vk::PipelineLayout layout; |
| 41 | vk::Pipeline pipeline; | 41 | vk::Pipeline pipeline; |
| 42 | vk::DescriptorSetLayout descriptor_set_layout; | 42 | vk::DescriptorSetLayout descriptor_set_layout; |
diff --git a/src/video_core/renderer_vulkan/vk_compute_pipeline.h b/src/video_core/renderer_vulkan/vk_compute_pipeline.h index 9879735fe..d70837fc5 100644 --- a/src/video_core/renderer_vulkan/vk_compute_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_compute_pipeline.h | |||
| @@ -55,7 +55,7 @@ private: | |||
| 55 | vk::DescriptorSetLayout descriptor_set_layout; | 55 | vk::DescriptorSetLayout descriptor_set_layout; |
| 56 | DescriptorAllocator descriptor_allocator; | 56 | DescriptorAllocator descriptor_allocator; |
| 57 | vk::PipelineLayout pipeline_layout; | 57 | vk::PipelineLayout pipeline_layout; |
| 58 | vk::DescriptorUpdateTemplateKHR descriptor_update_template; | 58 | vk::DescriptorUpdateTemplate descriptor_update_template; |
| 59 | vk::Pipeline pipeline; | 59 | vk::Pipeline pipeline; |
| 60 | 60 | ||
| 61 | std::condition_variable build_condvar; | 61 | std::condition_variable build_condvar; |
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h index 6bf577d25..1ed2967be 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.h +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.h | |||
| @@ -151,7 +151,7 @@ private: | |||
| 151 | vk::DescriptorSetLayout descriptor_set_layout; | 151 | vk::DescriptorSetLayout descriptor_set_layout; |
| 152 | DescriptorAllocator descriptor_allocator; | 152 | DescriptorAllocator descriptor_allocator; |
| 153 | vk::PipelineLayout pipeline_layout; | 153 | vk::PipelineLayout pipeline_layout; |
| 154 | vk::DescriptorUpdateTemplateKHR descriptor_update_template; | 154 | vk::DescriptorUpdateTemplate descriptor_update_template; |
| 155 | vk::Pipeline pipeline; | 155 | vk::Pipeline pipeline; |
| 156 | 156 | ||
| 157 | std::condition_variable build_condvar; | 157 | std::condition_variable build_condvar; |