Changeset 90a424f in opengl-game for vulkan-ref.cpp


Ignore:
Timestamp:
Sep 16, 2019, 7:04:53 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
fe5c3ba
Parents:
c6fec84
Message:

In vulkangame, add code to create a Vulkan surface and pick a physical device

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-ref.cpp

    rc6fec84 r90a424f  
    3232const int MAX_FRAMES_IN_FLIGHT = 2;
    3333
     34/*** START OF REFACTORED CODE ***/
    3435#ifdef NDEBUG
    3536   const bool enableValidationLayers = false;
     
    6061    vector<VkPresentModeKHR> presentModes;
    6162};
     63/*** END OF REFACTORED CODE ***/
    6264
    6365struct Vertex {
     
    159161      VkInstance instance;
    160162      VkDebugUtilsMessengerEXT debugMessenger;
     163      VkSurfaceKHR surface;
     164
     165      VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
    161166/*** END OF REFACTORED CODE ***/
    162       VkSurfaceKHR surface;
    163 
    164       VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
    165167      VkDevice device;
    166168
     
    312314         createInstance();
    313315         setupDebugMessenger();
    314 /*** END OF REFACTORED CODE ***/
    315316         createSurface();
    316317         pickPhysicalDevice();
     318/*** END OF REFACTORED CODE ***/
    317319         createLogicalDevice();
    318320         createSwapChain();
     
    491493         createInfo.pfnUserCallback = debugCallback;
    492494      }
    493       /*** END OF REFACTORED CODE ***/
    494495
    495496      void createSurface() {
     
    560561         return requiredExtensions.empty();
    561562      }
     563/*** END OF REFACTORED CODE ***/
    562564
    563565      void createLogicalDevice() {
     
    661663      }
    662664
     665/*** START OF REFACTORED CODE ***/
    663666      SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device) {
    664667         SwapChainSupportDetails details;
     
    684687         return details;
    685688      }
     689/*** END OF REFACTORED CODE ***/
    686690
    687691      VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats) {
     
    10341038      }
    10351039
     1040/*** START OF REFACTORED CODE ***/
    10361041      QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device) {
    10371042         QueueFamilyIndices indices;
     
    10651070         return indices;
    10661071      }
     1072/*** END OF REFACTORED CODE ***/
    10671073
    10681074      void createDepthResources() {
Note: See TracChangeset for help on using the changeset viewer.