Changeset e83b155 in opengl-game
- Timestamp:
- Oct 18, 2019, 2:40:47 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 603b5bc
- Parents:
- b794178
- git-author:
- Dmitry Portnoy <dmitry.portnoy@…> (10/18/19 14:38:29)
- git-committer:
- Dmitry Portnoy <dmitry.portnoy@…> (10/18/19 14:40:47)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
rb794178 re83b155 231 231 cleanupSwapChain(); 232 232 233 VulkanUtils::destroyVulkanImage(device, floorTextureImage); 234 VulkanUtils::destroyVulkanImage(device, sdlOverlayImage); 235 236 vkDestroySampler(device, textureSampler, nullptr); 237 233 238 for (GraphicsPipeline_Vulkan pipeline : graphicsPipelines) { 234 239 pipeline.cleanupBuffers(); … … 660 665 661 666 vkDestroySwapchainKHR(device, swapChain, nullptr); 662 } 667 668 for (size_t i = 0; i < swapChainImages.size(); i++) { 669 vkDestroyBuffer(device, uniformBuffers[i], nullptr); 670 vkFreeMemory(device, uniformBuffersMemory[i], nullptr); 671 } 672 } -
vulkan-ref.cpp
rb794178 re83b155 1965 1965 createGraphicsPipeline("shaders/scene-vert.spv", "shaders/scene-frag.spv", scenePipeline); 1966 1966 createDescriptorPool(scenePipeline); 1967 /*** END OF REFACTORED CODE ***/1968 1967 createDescriptorSets(scenePipeline); 1969 1968 1970 /*** START OF REFACTORED CODE ***/1971 1969 createGraphicsPipeline("shaders/overlay-vert.spv", "shaders/overlay-frag.spv", overlayPipeline); 1972 1970 createDescriptorPool(overlayPipeline); 1973 /*** END OF REFACTORED CODE ***/1974 1971 createDescriptorSets(overlayPipeline); 1972 /*** END OF REFACTORED CODE ***/ 1975 1973 1976 1974 createCommandBuffers(); … … 1980 1978 /*** START OF REFACTORED CODE ***/ 1981 1979 cleanupSwapChain(); 1982 /*** END OF REFACTORED CODE ***/1983 1980 1984 1981 vkDestroySampler(device, textureSampler, nullptr); … … 1992 1989 vkFreeMemory(device, sdlOverlayImageMemory, nullptr); 1993 1990 1994 /*** START OF REFACTORED CODE ***/1995 1991 cleanupPipelineBuffers(scenePipeline); 1996 1992 cleanupPipelineBuffers(overlayPipeline); … … 2068 2064 2069 2065 vkDestroySwapchainKHR(device, swapChain, nullptr); 2070 /*** END OF REFACTORED CODE ***/2071 2066 2072 2067 for (size_t i = 0; i < swapChainImages.size(); i++) { … … 2076 2071 } 2077 2072 2078 /*** START OF REFACTORED CODE ***/2079 2073 void cleanupPipeline(GraphicsPipelineInfo& pipeline) { 2080 2074 vkDestroyPipeline(device, pipeline.pipeline, nullptr); … … 2082 2076 vkDestroyPipelineLayout(device, pipeline.pipelineLayout, nullptr); 2083 2077 } 2084 /*** END OF REFACTORED CODE ***/2085 2078 2086 2079 void cleanupPipelineBuffers(GraphicsPipelineInfo& pipeline) { 2087 /*** START OF REFACTORED CODE ***/2088 2080 vkDestroyDescriptorSetLayout(device, pipeline.descriptorSetLayout, nullptr); 2089 2081 /*** END OF REFACTORED CODE ***/ -
vulkan-utils.cpp
rb794178 re83b155 475 475 return format == VK_FORMAT_D32_SFLOAT_S8_UINT || format == VK_FORMAT_D24_UNORM_S8_UINT; 476 476 } 477 478 void VulkanUtils::destroyVulkanImage(VkDevice& device, VulkanImage& image) { 479 vkDestroyImageView(device, image.imageView, nullptr); 480 vkDestroyImage(device, image.image, nullptr); 481 vkFreeMemory(device, image.imageMemory, nullptr); 482 } -
vulkan-utils.hpp
rb794178 re83b155 83 83 84 84 static bool hasStencilComponent(VkFormat format); 85 86 static void destroyVulkanImage(VkDevice& device, VulkanImage& image); 85 87 }; 86 88
Note:
See TracChangeset
for help on using the changeset viewer.