|
|
|
@ -34,9 +34,9 @@
@@ -34,9 +34,9 @@
|
|
|
|
|
#include <vulkan/vulkan.h> |
|
|
|
|
#ifdef _WIN64 |
|
|
|
|
#define NOMINMAX |
|
|
|
|
// Add windows.h to the include path firstly as dependency for other Windows headers
|
|
|
|
|
// Add windows.h to the include path
|
|
|
|
|
#include <windows.h> |
|
|
|
|
// Add other Windows headers
|
|
|
|
|
// Add vulkan_win32.h to the include path
|
|
|
|
|
#include <vulkan/vulkan_win32.h> |
|
|
|
|
#endif /* _WIN64 */ |
|
|
|
|
|
|
|
|
@ -56,7 +56,6 @@ public:
@@ -56,7 +56,6 @@ public:
|
|
|
|
|
void init(); |
|
|
|
|
void *getMemHandle(VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagBits handleType); |
|
|
|
|
void *getSemaphoreHandle(VkSemaphore semaphore, VkExternalSemaphoreHandleTypeFlagBits handleType); |
|
|
|
|
bool isVkPhysicalDeviceUuid(void *Uuid); |
|
|
|
|
void createExternalSemaphore(VkSemaphore &semaphore, VkExternalSemaphoreHandleTypeFlagBits handleType); |
|
|
|
|
void createBuffer(VkDeviceSize size, |
|
|
|
|
VkBufferUsageFlags usage, |
|
|
|
@ -88,7 +87,6 @@ protected:
@@ -88,7 +87,6 @@ protected:
|
|
|
|
|
VkDebugUtilsMessengerEXT m_debugMessenger; |
|
|
|
|
VkSurfaceKHR m_surface; |
|
|
|
|
VkPhysicalDevice m_physicalDevice; |
|
|
|
|
uint8_t m_deviceUUID[VK_UUID_SIZE]; |
|
|
|
|
VkDevice m_device; |
|
|
|
|
VkQueue m_graphicsQueue; |
|
|
|
|
VkQueue m_presentQueue; |
|
|
|
@ -109,15 +107,17 @@ protected:
@@ -109,15 +107,17 @@ protected:
|
|
|
|
|
std::vector<VkFence> m_inFlightFences; |
|
|
|
|
std::vector<VkBuffer> m_uniformBuffers; |
|
|
|
|
std::vector<VkDeviceMemory> m_uniformMemory; |
|
|
|
|
VkSemaphore m_vkPresentationSemaphore; |
|
|
|
|
VkSemaphore m_vkTimelineSemaphore; |
|
|
|
|
VkDescriptorSetLayout m_descriptorSetLayout; |
|
|
|
|
VkDescriptorPool m_descriptorPool; |
|
|
|
|
std::vector<VkDescriptorSet> m_descriptorSets; |
|
|
|
|
|
|
|
|
|
VkImage m_depthImage; |
|
|
|
|
VkDeviceMemory m_depthImageMemory; |
|
|
|
|
VkImageView m_depthImageView; |
|
|
|
|
size_t m_currentFrame; |
|
|
|
|
bool m_framebufferResized; |
|
|
|
|
VkImage m_depthImage; |
|
|
|
|
VkDeviceMemory m_depthImageMemory; |
|
|
|
|
VkImageView m_depthImageView; |
|
|
|
|
size_t m_currentFrame; |
|
|
|
|
bool m_framebufferResized; |
|
|
|
|
uint8_t m_vkDeviceUUID[VK_UUID_SIZE]; |
|
|
|
|
|
|
|
|
|
virtual void initVulkanApp() {} |
|
|
|
|
virtual void fillRenderingCommandBuffer(VkCommandBuffer &buffer) {} |
|
|
|
@ -130,7 +130,7 @@ protected:
@@ -130,7 +130,7 @@ protected:
|
|
|
|
|
std::vector<VkPipelineStageFlags> &waitStages) const; |
|
|
|
|
virtual void getSignalFrameSemaphores(std::vector<VkSemaphore> &signal) const; |
|
|
|
|
virtual VkDeviceSize getUniformSize() const; |
|
|
|
|
virtual void updateUniformBuffer(uint32_t imageIndex, size_t globalFrame); |
|
|
|
|
virtual void updateUniformBuffer(uint32_t imageIndex); |
|
|
|
|
virtual void drawFrame(); |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|