Changeset 90a424f in opengl-game for vulkan-utils.hpp


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-utils.hpp

    rc6fec84 r90a424f  
    22#define _VULKAN_UTILS_H
    33
     4#include <optional>
    45#include <vector>
    56
     
    78
    89using namespace std;
     10
     11struct QueueFamilyIndices {
     12   optional<uint32_t> graphicsFamily;
     13   optional<uint32_t> presentFamily;
     14
     15   bool isComplete() {
     16      return graphicsFamily.has_value() && presentFamily.has_value();
     17   }
     18};
     19
     20struct SwapChainSupportDetails {
     21   VkSurfaceCapabilitiesKHR capabilities;
     22   vector<VkSurfaceFormatKHR> formats;
     23   vector<VkPresentModeKHR> presentModes;
     24};
    925
    1026class VulkanUtils {
     
    2036            VkDebugUtilsMessengerEXT debugMessenger,
    2137            const VkAllocationCallbacks* pAllocator);
     38
     39      static QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device, VkSurfaceKHR surface);
     40      static bool checkDeviceExtensionSupport(VkPhysicalDevice device, const vector<const char*>& deviceExtensions);
     41      static SwapChainSupportDetails querySwapChainSupport(VkPhysicalDevice device, VkSurfaceKHR surface);
    2242};
    2343
Note: See TracChangeset for help on using the changeset viewer.