MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / BuilderBase

Class BuilderBase

framework/builder_base.h:76–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 */
75template <vkb::BindingType bindingType, typename BuilderType, typename CreateInfoType>
76class BuilderBase
77{
78 public:
79 using MemoryPropertyFlagsType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::MemoryPropertyFlags, VkMemoryPropertyFlags>::type;
80 using SharingModeType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::SharingMode, VkSharingMode>::type;
81
82 public:
83 VmaAllocationCreateInfo const &get_allocation_create_info() const;
84 CreateInfoType const &get_create_info() const;
85 std::string const &get_debug_name() const;
86 BuilderType &with_debug_name(const std::string &name);
87 BuilderType &with_implicit_sharing_mode();
88 BuilderType &with_memory_type_bits(uint32_t type_bits);
89 BuilderType &with_queue_families(uint32_t count, const uint32_t *family_indices);
90 BuilderType &with_queue_families(std::vector<uint32_t> const &queue_families);
91 BuilderType &with_sharing_mode(SharingModeType sharing_mode);
92 BuilderType &with_vma_flags(VmaAllocationCreateFlags flags);
93 BuilderType &with_vma_pool(VmaPool pool);
94 BuilderType &with_vma_preferred_flags(MemoryPropertyFlagsType flags);
95 BuilderType &with_vma_required_flags(MemoryPropertyFlagsType flags);
96 BuilderType &with_vma_usage(VmaMemoryUsage usage);
97
98 protected:
99 BuilderBase(const BuilderBase &other) = delete;
100 BuilderBase(const CreateInfoType &create_info);
101
102 CreateInfoType &get_create_info();
103
104 private:
105 // we always want to store a vk::CreateInfo, so we have to figure out that type, depending on the BindingType!
106 using CreateInfoTypeCpp = typename vkb::VulkanTypeMapping<bindingType, CreateInfoType>::Type;
107
108 protected:
109 VmaAllocationCreateInfo alloc_create_info = {};
110 CreateInfoTypeCpp create_info = {};
111 std::string debug_name = {};
112};
113
114template <typename BuilderType, typename CreateInfoType>
115using BuilderBaseC = BuilderBase<vkb::BindingType::C, BuilderType, CreateInfoType>;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected