Your application may contain inefficient transfer workloads.
Transfer workloads use the GPU to move data between resources.
Transfer operations require power and bandwidth. For this reason, they should be made as small and efficient as possible – or preferably, avoided entirely.
Transfer workloads are initiated by specific API calls. These include:
vkCmdCopyBuffer()
, which copies regions of a buffervkCmdClearColorImage()
, which clears an image.To find which API calls your application uses to start transfer workloads:
vkCmdClearColorImage()
is an inefficient way to clear an image.
A more efficient way to clear an image attachment is to clear the attachment at the start of a render pass. To do this:
loadOp
parameter in a VkAttachmentDescription
structure to VK_ATTACHMENT_LOAD_OP_CLEAR
VkAttachmentDescription
to a VkRenderPassCreateInfo
vkCreateRenderPass()
In the previous section, you saw an issue where unnecessarily large textures were inputs to a render pass. Similar problems can be seen in the context of transfer operations, which should operate over the smallest practicable area. To achieve this, change the values in the VkBufferCopy
structure passed to vkCmdCopyBuffer()
.