| 832 | } |
| 833 | |
| 834 | void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) { |
| 835 | VkCommandBuffer commandBuffer = beginSingleTimeCommands(); |
| 836 | |
| 837 | VkBufferImageCopy region{}; |
| 838 | region.bufferOffset = 0; |
| 839 | region.bufferRowLength = 0; |
| 840 | region.bufferImageHeight = 0; |
| 841 | region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 842 | region.imageSubresource.mipLevel = 0; |
| 843 | region.imageSubresource.baseArrayLayer = 0; |
| 844 | region.imageSubresource.layerCount = 1; |
| 845 | region.imageOffset = {0, 0, 0}; |
| 846 | region.imageExtent = { |
| 847 | width, |
| 848 | height, |
| 849 | 1 |
| 850 | }; |
| 851 | |
| 852 | vkCmdCopyBufferToImage(commandBuffer, buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); |
| 853 | |
| 854 | endSingleTimeCommands(commandBuffer); |
| 855 | } |
| 856 | |
| 857 | void createVertexBuffer() { |
| 858 | VkDeviceSize bufferSize = sizeof(vertices[0]) * vertices.size(); |
nothing calls this directly
no outgoing calls
no test coverage detected