| 1113 | } |
| 1114 | |
| 1115 | void copyBufferToImage(VkBuffer buffer, VkImage image, uint32_t width, uint32_t height) { |
| 1116 | VkCommandBuffer commandBuffer = beginSingleTimeCommands(); |
| 1117 | |
| 1118 | VkBufferImageCopy region{}; |
| 1119 | region.bufferOffset = 0; |
| 1120 | region.bufferRowLength = 0; |
| 1121 | region.bufferImageHeight = 0; |
| 1122 | region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 1123 | region.imageSubresource.mipLevel = 0; |
| 1124 | region.imageSubresource.baseArrayLayer = 0; |
| 1125 | region.imageSubresource.layerCount = 1; |
| 1126 | region.imageOffset = {0, 0, 0}; |
| 1127 | region.imageExtent = { |
| 1128 | width, |
| 1129 | height, |
| 1130 | 1 |
| 1131 | }; |
| 1132 | |
| 1133 | vkCmdCopyBufferToImage(commandBuffer, buffer, image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion); |
| 1134 | |
| 1135 | endSingleTimeCommands(commandBuffer); |
| 1136 | } |
| 1137 | |
| 1138 | void loadModel() { |
| 1139 | tinyobj::attrib_t attrib; |
nothing calls this directly
no outgoing calls
no test coverage detected