| 206 | |
| 207 | template <vkb::BindingType bindingType> |
| 208 | inline BufferAllocation<bindingType> RenderFrame<bindingType>::allocate_buffer(BufferUsageFlagsType usage, DeviceSizeType size, size_t thread_index) |
| 209 | { |
| 210 | assert(thread_index < thread_count && "Thread index is out of bounds"); |
| 211 | |
| 212 | if constexpr (bindingType == vkb::BindingType::Cpp) |
| 213 | { |
| 214 | return allocate_buffer_impl(usage, size, thread_index); |
| 215 | } |
| 216 | else |
| 217 | { |
| 218 | vkb::BufferAllocationCpp buffer_allocation = |
| 219 | allocate_buffer_impl(static_cast<vk::BufferUsageFlags>(usage), static_cast<vk::DeviceSize>(size), thread_index); |
| 220 | return *reinterpret_cast<vkb::BufferAllocationC *>(&buffer_allocation); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | template <vkb::BindingType bindingType> |
| 225 | inline vkb::BufferAllocationCpp RenderFrame<bindingType>::allocate_buffer_impl(vk::BufferUsageFlags usage, vk::DeviceSize size, size_t thread_index) |
no outgoing calls