Created
August 14, 2017 13:46
-
-
Save mdomrach/3fbb9e97c4f710bc7147aae6dbe369ff to your computer and use it in GitHub Desktop.
CreateDepthResources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void FVulkanApplication::CreateDepthResources() | |
{ | |
VkFormat depthFormat = FVulkanCalculator::FindDepthFormat(vulkanDevice.physicalDevice); | |
FVulkanImageCalculator::CreateImage(vulkanDevice, swapChain.extent.width, swapChain.extent.height, depthFormat, | |
VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, | |
depthImage, depthImageMemory); | |
depthImageView = FVulkanFactory::ImageView(vulkanDevice.logicalDevice, depthImage, depthFormat, VK_IMAGE_ASPECT_DEPTH_BIT); | |
FVulkanImageCalculator::TransitionImageLayout( | |
vulkanDevice.logicalDevice, commandPool, graphicsQueue, | |
depthImage, depthFormat, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment