| 35 | |
| 36 | template <vkb::BindingType bindingType> |
| 37 | struct BufferBuilder |
| 38 | : public vkb::allocated::BuilderBase<bindingType, |
| 39 | BufferBuilder<bindingType>, |
| 40 | typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::BufferCreateInfo, VkBufferCreateInfo>::type> |
| 41 | { |
| 42 | public: |
| 43 | using BufferCreateFlagsType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::BufferCreateFlags, VkBufferCreateFlags>::type; |
| 44 | using BufferCreateInfoType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::BufferCreateInfo, VkBufferCreateInfo>::type; |
| 45 | using BufferUsageFlagsType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::BufferUsageFlags, VkBufferUsageFlags>::type; |
| 46 | using DeviceSizeType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::DeviceSize, VkDeviceSize>::type; |
| 47 | using SharingModeType = typename std::conditional<bindingType == vkb::BindingType::Cpp, vk::SharingMode, VkSharingMode>::type; |
| 48 | |
| 49 | private: |
| 50 | using ParentType = vkb::allocated::BuilderBase<bindingType, BufferBuilder<bindingType>, BufferCreateInfoType>; |
| 51 | |
| 52 | public: |
| 53 | BufferBuilder(DeviceSizeType size); |
| 54 | |
| 55 | Buffer<bindingType> build(vkb::core::Device<bindingType> &device) const; |
| 56 | BufferPtr<bindingType> build_unique(vkb::core::Device<bindingType> &device) const; |
| 57 | BufferBuilder &with_flags(BufferCreateFlagsType flags); |
| 58 | BufferBuilder &with_usage(BufferUsageFlagsType usage); |
| 59 | BufferBuilder &with_alignment(DeviceSizeType align); |
| 60 | DeviceSizeType get_alignment() const |
| 61 | { |
| 62 | return alignment; |
| 63 | } |
| 64 | |
| 65 | private: |
| 66 | DeviceSizeType alignment{0}; |
| 67 | }; |
| 68 | |
| 69 | using BufferBuilderC = BufferBuilder<vkb::BindingType::C>; |
| 70 | using BufferBuilderCpp = BufferBuilder<vkb::BindingType::Cpp>; |
nothing calls this directly
no outgoing calls
no test coverage detected