MCPcopy Create free account
hub / github.com/InoriRus/Kyty / UtilCopyBuffer

Function UtilCopyBuffer

source/emulator/src/Graphics/Utils.cpp:474–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474void UtilCopyBuffer(VulkanBuffer* src_buffer, VulkanBuffer* dst_buffer, uint64_t size)
475{
476 EXIT_IF(src_buffer == nullptr);
477 EXIT_IF(src_buffer->buffer == nullptr);
478 EXIT_IF(dst_buffer == nullptr);
479 EXIT_IF(dst_buffer->buffer == nullptr);
480
481 CommandBuffer buffer(GraphicContext::QUEUE_UTIL);
482 // buffer.SetQueue(GraphicContext::QUEUE_UTIL);
483
484 EXIT_NOT_IMPLEMENTED(buffer.IsInvalid());
485
486 auto* vk_buffer = buffer.GetPool()->buffers[buffer.GetIndex()];
487
488 buffer.Begin();
489
490 VkBufferCopy copy_region {};
491 copy_region.srcOffset = 0;
492 copy_region.dstOffset = 0;
493 copy_region.size = size;
494
495 vkCmdCopyBuffer(vk_buffer, src_buffer->buffer, dst_buffer->buffer, 1, &copy_region);
496
497 buffer.End();
498 buffer.Execute();
499 buffer.WaitForFence();
500}
501
502} // namespace Kyty::Libs::Graphics
503

Callers 2

create_funcFunction · 0.85
update_funcFunction · 0.85

Calls 7

WaitForFenceMethod · 0.80
IsInvalidMethod · 0.45
GetPoolMethod · 0.45
GetIndexMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected