MCPcopy Create free account
hub / github.com/defold/defold / CreateMainScratchBuffers

Function CreateMainScratchBuffers

engine/graphics/src/vulkan/graphics_vulkan.cpp:313–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 static VkResult CreateMainScratchBuffers(VkPhysicalDevice vk_physical_device, VkDevice vk_device,
314 uint8_t swap_chain_image_count, uint32_t scratch_buffer_size, uint16_t descriptor_count,
315 DescriptorAllocator* descriptor_allocators_out, ScratchBuffer* scratch_buffers_out)
316 {
317 memset(scratch_buffers_out, 0, sizeof(ScratchBuffer) * swap_chain_image_count);
318 memset(descriptor_allocators_out, 0, sizeof(DescriptorAllocator) * swap_chain_image_count);
319 for(uint8_t i=0; i < swap_chain_image_count; i++)
320 {
321 VkResult res = CreateDescriptorAllocator(vk_device, descriptor_count, &descriptor_allocators_out[i]);
322 if (res != VK_SUCCESS)
323 {
324 return res;
325 }
326
327 res = CreateScratchBuffer(vk_physical_device, vk_device, scratch_buffer_size, true, &descriptor_allocators_out[i], &scratch_buffers_out[i]);
328 if (res != VK_SUCCESS)
329 {
330 return res;
331 }
332 }
333
334 return VK_SUCCESS;
335 }
336
337 static VkSamplerAddressMode GetVulkanSamplerAddressMode(TextureWrap wrap)
338 {

Callers 1

Calls 2

CreateScratchBufferFunction · 0.85

Tested by

no test coverage detected