Latest chapter from vkguide but doesn't work yet.
This commit is contained in:
parent
40717cf8e4
commit
a5c13d8654
10 changed files with 321 additions and 7 deletions
35
vk_descriptors.h
Normal file
35
vk_descriptors.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include "vk_types.h"
|
||||
#include <vector>
|
||||
|
||||
struct DescriptorLayoutBuilder {
|
||||
std::vector<VkDescriptorSetLayoutBinding> bindings;
|
||||
|
||||
void add_binding(uint32_t binding, VkDescriptorType type);
|
||||
void clear();
|
||||
|
||||
VkDescriptorSetLayout build(VkDevice device,
|
||||
VkShaderStageFlags shaderStages,
|
||||
void* pNext = nullptr,
|
||||
VkDescriptorSetLayoutCreateFlags flags = 0);
|
||||
};
|
||||
|
||||
struct DescriptorAllocator {
|
||||
|
||||
struct PoolSizeRatio {
|
||||
VkDescriptorType type;
|
||||
float ratio;
|
||||
};
|
||||
|
||||
VkDescriptorPool pool;
|
||||
|
||||
void init_pool(VkDevice device, uint32_t maxSets,
|
||||
std::span<PoolSizeRatio> poolRatios);
|
||||
|
||||
void clear_descriptors(VkDevice device);
|
||||
void destroy_pool(VkDevice device);
|
||||
|
||||
VkDescriptorSet allocate(VkDevice device, VkDescriptorSetLayout layout);
|
||||
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue