| 346 | } |
| 347 | |
| 348 | void vkRenderer::createImageViews() { |
| 349 | swapChainImageViews.resize(swapChainImages.size()); |
| 350 | |
| 351 | for (size_t i = 0; i < swapChainImages.size(); i++) { |
| 352 | VkImageViewCreateInfo createInfo = {}; |
| 353 | createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; |
| 354 | createInfo.image = swapChainImages[i]; |
| 355 | createInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; |
| 356 | createInfo.format = swapChainImageFormat; |
| 357 | createInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 358 | createInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 359 | createInfo.components.b = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 360 | createInfo.components.a = VK_COMPONENT_SWIZZLE_IDENTITY; |
| 361 | createInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; |
| 362 | createInfo.subresourceRange.baseMipLevel = 0; |
| 363 | createInfo.subresourceRange.levelCount = 1; |
| 364 | createInfo.subresourceRange.baseArrayLayer = 0; |
| 365 | createInfo.subresourceRange.layerCount = 1; |
| 366 | |
| 367 | if (vkCreateImageView(device, &createInfo, nullptr, &swapChainImageViews[i]) != VK_SUCCESS) { |
| 368 | throw std::runtime_error("failed to create image views!"); |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | void vkRenderer::createRenderPass() { |
| 374 | VkAttachmentDescription colorAttachment = {}; |
nothing calls this directly
no outgoing calls
no test coverage detected