Create Vulkan semaphores for swapchain synchronization

This commit is contained in:
2021-08-12 22:40:40 -07:00
parent 0285e734bc
commit 1114210039
4 changed files with 86 additions and 7 deletions

View File

@@ -128,7 +128,6 @@ public:
static void activateStreamerContext();
static void activateRenderContext();
typedef struct {
VkPhysicalDevice device;
@@ -146,7 +145,6 @@ public:
} DeviceInfo;
typedef struct {
KrSurfaceHandle surfaceHandle;
KrDeviceHandle deviceHandle;
VkSurfaceKHR surface;
VkSwapchainKHR swapChain;
@@ -155,11 +153,16 @@ public:
VkExtent2D swapChainExtent;
std::vector<VkImageView> swapChainImageViews;
std::vector<VkFramebuffer> swapChainFramebuffers;
VkSemaphore imageAvailableSemaphore;
VkSemaphore renderFinishedSemaphore;
#ifdef WIN32
HWND hWnd;
#endif
} SurfaceInfo;
static std::mutex g_SurfaceInfoMutex;
static std::mutex g_DeviceInfoMutex;
DeviceInfo& GetDeviceInfo(KrDeviceHandle handle);
SurfaceInfo& GetSurfaceInfo(KrSurfaceHandle handle);