summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/pipeline_helper.h58
1 files changed, 25 insertions, 33 deletions
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h
index a39459b2e..e2167dc4b 100644
--- a/src/video_core/renderer_vulkan/pipeline_helper.h
+++ b/src/video_core/renderer_vulkan/pipeline_helper.h
@@ -85,42 +85,34 @@ public:
85 } 85 }
86 86
87 void Add(const Shader::Info& info, VkShaderStageFlags stage) { 87 void Add(const Shader::Info& info, VkShaderStageFlags stage) {
88 for ([[maybe_unused]] const auto& desc : info.constant_buffer_descriptors) { 88 Add(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, stage, info.constant_buffer_descriptors.size());
89 Add(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, stage); 89 Add(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, stage, info.storage_buffers_descriptors.size());
90 } 90 Add(VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, stage, info.texture_buffer_descriptors.size());
91 for ([[maybe_unused]] const auto& desc : info.storage_buffers_descriptors) { 91 Add(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, stage, info.texture_descriptors.size());
92 Add(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, stage); 92 Add(VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, stage, info.image_descriptors.size());
93 }
94 for ([[maybe_unused]] const auto& desc : info.texture_buffer_descriptors) {
95 Add(VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER, stage);
96 }
97 for ([[maybe_unused]] const auto& desc : info.texture_descriptors) {
98 Add(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, stage);
99 }
100 for ([[maybe_unused]] const auto& desc : info.image_descriptors) {
101 Add(VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, stage);
102 }
103 } 93 }
104 94
105private: 95private:
106 void Add(VkDescriptorType type, VkShaderStageFlags stage) { 96 void Add(VkDescriptorType type, VkShaderStageFlags stage, size_t num) {
107 bindings.push_back({ 97 for (size_t i = 0; i < num; ++i) {
108 .binding = binding, 98 bindings.push_back({
109 .descriptorType = type, 99 .binding = binding,
110 .descriptorCount = 1, 100 .descriptorType = type,
111 .stageFlags = stage, 101 .descriptorCount = 1,
112 .pImmutableSamplers = nullptr, 102 .stageFlags = stage,
113 }); 103 .pImmutableSamplers = nullptr,
114 entries.push_back(VkDescriptorUpdateTemplateEntryKHR{ 104 });
115 .dstBinding = binding, 105 entries.push_back({
116 .dstArrayElement = 0, 106 .dstBinding = binding,
117 .descriptorCount = 1, 107 .dstArrayElement = 0,
118 .descriptorType = type, 108 .descriptorCount = 1,
119 .offset = offset, 109 .descriptorType = type,
120 .stride = sizeof(DescriptorUpdateEntry), 110 .offset = offset,
121 }); 111 .stride = sizeof(DescriptorUpdateEntry),
122 ++binding; 112 });
123 offset += sizeof(DescriptorUpdateEntry); 113 ++binding;
114 offset += sizeof(DescriptorUpdateEntry);
115 }
124 } 116 }
125 117
126 const vk::Device* device{}; 118 const vk::Device* device{};