| 969 | } |
| 970 | |
| 971 | void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) { |
| 972 | VkCommandBuffer commandBuffer = beginSingleTimeCommands(); |
| 973 | |
| 974 | VkBufferImageCopy region{}; |
| 975 | region.bufferOffset = 0; |
| 976 | region.bufferRowLength = 0; |
| 977 | region.bufferImageHeight = 0; |
| 978 | region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 979 | region.imageSubresource.mipLevel = 0; |
| 980 | region.imageSubresource.baseArrayLayer = 0; |
| 981 | region.imageSubresource.layerCount = 1; |
| 982 | region.imageOffset = {0, 0, 0}; |
| 983 | region.imageExtent = { |
| 984 | width, |
| 985 | height, |
| 986 | 1 |
| 987 | }; |
| 988 | |
| 989 | vkCmdCopyBufferToImage(commandBuffer, buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); |
| 990 | |
| 991 | endSingleTimeCommands(commandBuffer); |
| 992 | } |
| 993 | |
| 994 | void loadModel() { |
| 995 | tinyobj::attrib_t attrib; |
nothing calls this directly
no outgoing calls
no test coverage detected