Changeset 7f60b28 in opengl-game for vulkan-utils.hpp


Ignore:
Timestamp:
Jan 24, 2021, 5:22:33 PM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
feature/imgui-sdl
Children:
3f32dfd
Parents:
6a39266
Message:

Split VulkanUtils::querySwapChainSupport into three separate functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-utils.hpp

    r6a39266 r7f60b28  
    88#include <vulkan/vulkan.h>
    99
     10// TODO: Ideally, vulkan-utils should not have things speciic to windowing apis (glfw, sdl, sfml, etc.).
     11// Check what these inclydes are for and if that functionality can be moved
    1012#include <SDL2/SDL.h>
    1113#include <SDL2/SDL_vulkan.h>
     
    2022      return graphicsFamily.has_value() && presentFamily.has_value();
    2123   }
    22 };
    23 
    24 struct SwapChainSupportDetails {
    25    VkSurfaceCapabilitiesKHR capabilities;
    26    vector<VkSurfaceFormatKHR> formats;
    27    vector<VkPresentModeKHR> presentModes;
    2824};
    2925
     
    5046      static bool checkDeviceExtensionSupport(VkPhysicalDevice physicalDevice,
    5147            const vector<const char*>& deviceExtensions);
    52       static SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice physicalDevice,
    53             VkSurfaceKHR surface);
    54       static VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats);
    55       static VkPresentModeKHR chooseSwapPresentMode(const vector<VkPresentModeKHR>& availablePresentModes);
     48      static VkSurfaceCapabilitiesKHR querySwapChainCapabilities(VkPhysicalDevice physicalDevice,
     49         VkSurfaceKHR surface);
     50      static vector<VkSurfaceFormatKHR> querySwapChainFormats(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface);
     51      static vector<VkPresentModeKHR> querySwapChainPresentModes(VkPhysicalDevice physicalDevice,
     52         VkSurfaceKHR surface);
     53      static VkSurfaceFormatKHR chooseSwapSurfaceFormat(const vector<VkSurfaceFormatKHR>& availableFormats,
     54         const vector<VkFormat>& requestedFormats, VkColorSpaceKHR requestedColorSpace);
     55      static VkPresentModeKHR chooseSwapPresentMode(const vector<VkPresentModeKHR>& availablePresentModes,
     56         const vector<VkPresentModeKHR>& requestedPresentModes);
    5657      static VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, int width, int height);
    5758      static VkImageView createImageView(VkDevice device, VkImage image, VkFormat format,
Note: See TracChangeset for help on using the changeset viewer.