Changeset f94eea9 in opengl-game for vulkan-ref.cpp
- Timestamp:
- Sep 27, 2019, 7:20:55 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 6fc24c7
- Parents:
- 054d9ed
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-ref.cpp
r054d9ed rf94eea9 173 173 VkFormat swapChainImageFormat; 174 174 VkExtent2D swapChainExtent; 175 vector<VkImageView> swapChainImageViews; 175 176 /*** END OF REFACTORED CODE ***/ 176 vector<VkImageView> swapChainImageViews;177 177 vector<VkFramebuffer> swapChainFramebuffers; 178 178 … … 317 317 pickPhysicalDevice(); 318 318 createLogicalDevice(); 319 /*** END OF REFACTORED CODE ***/320 319 createSwapChain(); 321 320 createImageViews(); 321 /*** END OF REFACTORED CODE ***/ 322 322 createRenderPass(); 323 323 … … 685 685 return details; 686 686 } 687 /*** END OF REFACTORED CODE ***/688 687 689 688 VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats) { … … 735 734 } 736 735 } 736 /*** END OF REFACTORED CODE ***/ 737 737 738 738 void createRenderPass() { … … 1330 1330 } 1331 1331 1332 /*** START OF REFACTORED CODE ***/ 1332 1333 VkImageView createImageView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags) { 1333 1334 VkImageViewCreateInfo viewInfo = {}; … … 1355 1356 return imageView; 1356 1357 } 1358 /*** END OF REFACTORED CODE ***/ 1357 1359 1358 1360 void createTextureSampler() { … … 1708 1710 vkDeviceWaitIdle(device); 1709 1711 } 1712 1713 void drawFrame() { 1710 1714 /*** END OF REFACTORED CODE ***/ 1711 1712 void drawFrame() {1713 1715 vkWaitForFences(device, 1, &inFlightFences[currentFrame], VK_TRUE, numeric_limits<uint64_t>::max()); 1714 1716 … … 1772 1774 currentFrame = (currentFrame + 1) % MAX_FRAMES_IN_FLIGHT; 1773 1775 currentFrame = (currentFrame + 1) % MAX_FRAMES_IN_FLIGHT; 1776 /*** START OF REFACTORED CODE ***/ 1774 1777 } 1775 1778 1776 1779 void drawUI() { 1780 /*** END OF REFACTORED CODE ***/ 1777 1781 // TODO: Since I currently don't use any other render targets, 1778 1782 // I may as well set this once before the render loop … … 1801 1805 1802 1806 populateImageFromSDLTexture(uiOverlay, sdlOverlayImage); 1803 } 1807 /*** START OF REFACTORED CODE ***/ 1808 } 1809 /*** END OF REFACTORED CODE ***/ 1804 1810 1805 1811 void updateUniformBuffer(uint32_t currentImage) { … … 1944 1950 vkDestroyRenderPass(device, renderPass, nullptr); 1945 1951 1952 /*** START OF REFACTORED CODE ***/ 1946 1953 for (auto imageView : swapChainImageViews) { 1947 1954 vkDestroyImageView(device, imageView, nullptr); 1948 1955 } 1949 1956 1950 /*** START OF REFACTORED CODE ***/1951 1957 vkDestroySwapchainKHR(device, swapChain, nullptr); 1952 1958 /*** END OF REFACTORED CODE ***/
Note:
See TracChangeset
for help on using the changeset viewer.