runtime pipeline
This commit is contained in:
parent
75c9ae5087
commit
415e523a45
20 changed files with 480 additions and 45 deletions
|
|
@ -26,6 +26,7 @@ export module Crafter.Graphics:DescriptorPoolVulkan;
|
|||
import std;
|
||||
import :VulkanDevice;
|
||||
import :Types;
|
||||
import :DescriptorSetLayoutVulkan;
|
||||
import Crafter.Event;
|
||||
|
||||
export namespace Crafter {
|
||||
|
|
@ -97,6 +98,25 @@ export namespace Crafter {
|
|||
|
||||
return types;
|
||||
}
|
||||
|
||||
constexpr static std::vector<VkDescriptorPoolSize> GetPoolSizes(const std::span<const DescriptorSetLayoutVulkan> shaders) {
|
||||
std::vector<VkDescriptorPoolSize> types;
|
||||
|
||||
for(const DescriptorSetLayoutVulkan& shader : shaders) {
|
||||
for (const VkDescriptorSetLayoutBinding& binding : shader.descriptors) {
|
||||
for(VkDescriptorPoolSize& type : types) {
|
||||
if(type.type == binding.descriptorType) {
|
||||
type.descriptorCount += binding.descriptorCount;
|
||||
goto inner;
|
||||
}
|
||||
}
|
||||
types.emplace_back(binding.descriptorType, binding.descriptorCount);
|
||||
inner:;
|
||||
}
|
||||
}
|
||||
|
||||
return types;
|
||||
}
|
||||
|
||||
public:
|
||||
void BuildPool(std::span<const VkDescriptorPoolSize> poolSizes, std::span<const VkDescriptorSetLayout> setLayouts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue