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

Method allocate_buffer

framework/rendering/render_frame.h:208–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207template <vkb::BindingType bindingType>
208inline 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
224template <vkb::BindingType bindingType>
225inline vkb::BufferAllocationCpp RenderFrame<bindingType>::allocate_buffer_impl(vk::BufferUsageFlags usage, vk::DeviceSize size, size_t thread_index)

Callers 11

update_buffersMethod · 0.80
drawMethod · 0.80
allocate_lightsMethod · 0.80
drawMethod · 0.80
update_uniform_implMethod · 0.80
drawMethod · 0.80
drawMethod · 0.80
update_uniformMethod · 0.80
drawMethod · 0.80
drawMethod · 0.80

Calls

no outgoing calls

Tested by 1