| 871 | } |
| 872 | |
| 873 | void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) { |
| 874 | VkCommandBuffer commandBuffer = beginSingleTimeCommands(); |
| 875 | |
| 876 | VkBufferImageCopy region{}; |
| 877 | region.bufferOffset = 0; |
| 878 | region.bufferRowLength = 0; |
| 879 | region.bufferImageHeight = 0; |
| 880 | region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 881 | region.imageSubresource.mipLevel = 0; |
| 882 | region.imageSubresource.baseArrayLayer = 0; |
| 883 | region.imageSubresource.layerCount = 1; |
| 884 | region.imageOffset = {0, 0, 0}; |
| 885 | region.imageExtent = { |
| 886 | width, |
| 887 | height, |
| 888 | 1 |
| 889 | }; |
| 890 | |
| 891 | vkCmdCopyBufferToImage(commandBuffer, buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); |
| 892 | |
| 893 | endSingleTimeCommands(commandBuffer); |
| 894 | } |
| 895 | |
| 896 | void createVertexBuffer() { |
| 897 | VkDeviceSize bufferSize = sizeof(vertices[0]) * vertices.size(); |
nothing calls this directly
no outgoing calls
no test coverage detected