Changeset f94eea9 in opengl-game for vulkan-ref.cpp


Ignore:
Timestamp:
Sep 27, 2019, 7:20:55 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
6fc24c7
Parents:
054d9ed
Message:

In vulkangame, add code to create image views

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-ref.cpp

    r054d9ed rf94eea9  
    173173      VkFormat swapChainImageFormat;
    174174      VkExtent2D swapChainExtent;
     175      vector<VkImageView> swapChainImageViews;
    175176/*** END OF REFACTORED CODE ***/
    176       vector<VkImageView> swapChainImageViews;
    177177      vector<VkFramebuffer> swapChainFramebuffers;
    178178
     
    317317         pickPhysicalDevice();
    318318         createLogicalDevice();
    319 /*** END OF REFACTORED CODE ***/
    320319         createSwapChain();
    321320         createImageViews();
     321/*** END OF REFACTORED CODE ***/
    322322         createRenderPass();
    323323
     
    685685         return details;
    686686      }
    687 /*** END OF REFACTORED CODE ***/
    688687
    689688      VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats) {
     
    735734         }
    736735      }
     736/*** END OF REFACTORED CODE ***/
    737737
    738738      void createRenderPass() {
     
    13301330      }
    13311331
     1332/*** START OF REFACTORED CODE ***/
    13321333      VkImageView createImageView(VkImage image, VkFormat format, VkImageAspectFlags aspectFlags) {
    13331334         VkImageViewCreateInfo viewInfo = {};
     
    13551356         return imageView;
    13561357      }
     1358/*** END OF REFACTORED CODE ***/
    13571359
    13581360      void createTextureSampler() {
     
    17081710         vkDeviceWaitIdle(device);
    17091711      }
     1712
     1713      void drawFrame() {
    17101714/*** END OF REFACTORED CODE ***/
    1711 
    1712       void drawFrame() {
    17131715         vkWaitForFences(device, 1, &inFlightFences[currentFrame], VK_TRUE, numeric_limits<uint64_t>::max());
    17141716
     
    17721774         currentFrame = (currentFrame + 1) % MAX_FRAMES_IN_FLIGHT;
    17731775         currentFrame = (currentFrame + 1) % MAX_FRAMES_IN_FLIGHT;
     1776/*** START OF REFACTORED CODE ***/
    17741777      }
    17751778
    17761779      void drawUI() {
     1780/*** END OF REFACTORED CODE ***/
    17771781         // TODO: Since I currently don't use any other render targets,
    17781782         // I may as well set this once before the render loop
     
    18011805
    18021806         populateImageFromSDLTexture(uiOverlay, sdlOverlayImage);
    1803       }
     1807/*** START OF REFACTORED CODE ***/
     1808      }
     1809/*** END OF REFACTORED CODE ***/
    18041810
    18051811      void updateUniformBuffer(uint32_t currentImage) {
     
    19441950         vkDestroyRenderPass(device, renderPass, nullptr);
    19451951
     1952/*** START OF REFACTORED CODE ***/
    19461953         for (auto imageView : swapChainImageViews) {
    19471954            vkDestroyImageView(device, imageView, nullptr);
    19481955         }
    19491956
    1950 /*** START OF REFACTORED CODE ***/
    19511957         vkDestroySwapchainKHR(device, swapChain, nullptr);
    19521958/*** END OF REFACTORED CODE ***/
Note: See TracChangeset for help on using the changeset viewer.