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


Ignore:
Timestamp:
Sep 23, 2019, 12:32:48 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
502bd0b
Parents:
a0c5f28
Message:

In vulkangame, add code to create a logical device

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-ref.cpp

    ra0c5f28 rc1c2021  
    164164
    165165      VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
    166 /*** END OF REFACTORED CODE ***/
    167166      VkDevice device;
    168167
    169168      VkQueue graphicsQueue;
    170169      VkQueue presentQueue;
     170/*** END OF REFACTORED CODE ***/
    171171
    172172      VkSwapchainKHR swapChain;
     
    316316         createSurface();
    317317         pickPhysicalDevice();
     318         createLogicalDevice();
    318319/*** END OF REFACTORED CODE ***/
    319          createLogicalDevice();
    320320         createSwapChain();
    321321         createImageViews();
     
    561561         return requiredExtensions.empty();
    562562      }
    563 /*** END OF REFACTORED CODE ***/
    564563
    565564      void createLogicalDevice() {
     
    609608         vkGetDeviceQueue(device, indices.presentFamily.value(), 0, &presentQueue);
    610609      }
     610/*** END OF REFACTORED CODE ***/
    611611
    612612      void createSwapChain() {
     
    16741674      }
    16751675
     1676/*** START OF REFACTORED CODE ***/
    16761677      void mainLoop() {
    16771678         // TODO: Create some generic event-handling functions in game-gui-*
     
    16901691                  quit = true;
    16911692               }
     1693/*** END OF REFACTORED CODE ***/
    16921694               if (e.type == SDL_WINDOWEVENT) {
    16931695                  if (e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED ||
     
    16961698                  }
    16971699               }
     1700/*** START OF REFACTORED CODE ***/
    16981701            }
    16991702
     
    17051708         vkDeviceWaitIdle(device);
    17061709      }
     1710/*** END OF REFACTORED CODE ***/
    17071711
    17081712      void drawFrame() {
     
    18531857      }
    18541858
     1859/*** START OF REFACTORED CODE ***/
    18551860      void cleanup() {
    18561861         cleanupSwapChain();
     1862/*** END OF REFACTORED CODE ***/
    18571863
    18581864         vkDestroySampler(device, textureSampler, nullptr);
     
    18801886
    18811887         vkDestroyCommandPool(device, commandPool, nullptr);
     1888/*** START OF REFACTORED CODE ***/
    18821889         vkDestroyDevice(device, nullptr);
    18831890         vkDestroySurfaceKHR(instance, surface, nullptr);
    18841891
    1885 /*** START OF REFACTORED CODE ***/
    18861892         if (enableValidationLayers) {
    18871893            DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr);
     
    19191925         gui->shutdown();
    19201926         delete gui;
     1927      }
     1928
     1929      void cleanupSwapChain() {
    19211930/*** END OF REFACTORED CODE ***/
    1922       }
    1923 
    1924       void cleanupSwapChain() {
    19251931         vkDestroyImageView(device, depthImageView, nullptr);
    19261932         vkDestroyImage(device, depthImage, nullptr);
     
    19481954            vkFreeMemory(device, uniformBuffersMemory[i], nullptr);
    19491955         }
    1950       }
     1956/*** START OF REFACTORED CODE ***/
     1957      }
     1958/*** END OF REFACTORED CODE ***/
    19511959
    19521960      void cleanupPipeline(GraphicsPipelineInfo& pipeline) {
Note: See TracChangeset for help on using the changeset viewer.