| 324 | } |
| 325 | |
| 326 | void createImageViews() { |
| 327 | swapChainImageViews.resize(swapChainImages.size()); |
| 328 | |
| 329 | for (size_t i = 0; i < swapChainImages.size(); i++) { |
| 330 | VkImageViewCreateInfo createInfo{}; |
| 331 | createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; |
| 332 | createInfo.image = swapChainImages[i]; |
| 333 | createInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; |
| 334 | createInfo.format = swapChainImageFormat; |
| 335 | createInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 336 | createInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 337 | createInfo.components.b = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 338 | createInfo.components.a = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 339 | createInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 340 | createInfo.subresourceRange.baseMipLevel = 0; |
| 341 | createInfo.subresourceRange.levelCount = 1; |
| 342 | createInfo.subresourceRange.baseArrayLayer = 0; |
| 343 | createInfo.subresourceRange.layerCount = 1; |
| 344 | |
| 345 | if (vkCreateImageView(device, &createInfo, nullptr, &swapChainImageViews[i]) != VK_SUCCESS) { |
| 346 | throw std::runtime_error("failed to create image views!"); |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void createGraphicsPipeline() { |
| 352 | auto vertShaderCode = readFile("shaders/vert.spv"); |
nothing calls this directly
no outgoing calls
no test coverage detected