交换链同步改写,加入日志
This commit is contained in:
+17
-6
@@ -30,6 +30,8 @@ public:
|
||||
void recordCommandBuffer(VkCommandBuffer commandBuffer, uint32_t imageIndex);
|
||||
void createSyncObjects();
|
||||
void drawFrame();
|
||||
void drawLeft();
|
||||
void drawRight();
|
||||
bool isInited() { return inited; }
|
||||
private:
|
||||
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; // 物理设备
|
||||
@@ -48,12 +50,21 @@ private:
|
||||
VkQueue presentQueue; // 呈现队列
|
||||
|
||||
VkCommandPool commandPool;
|
||||
std::vector<VkCommandBuffer> commandBuffers;
|
||||
std::vector<VkSemaphore> imageAvailableSemaphores; // 每个交换链图像一个
|
||||
std::vector<VkSemaphore> renderFinishedSemaphores; // 每个交换链图像一个
|
||||
std::vector<VkFence> inFlightFences; // 每个帧在飞行一个
|
||||
std::vector<VkFence> imagesInFlight; // 跟踪每个图像的使用状态
|
||||
VkCommandBuffer commandBuffers_Left;
|
||||
VkCommandBuffer commandBuffers_Right;
|
||||
|
||||
VkSemaphore imageAvailableSemaphores_Left;
|
||||
VkSemaphore imageAvailableSemaphores_Right;
|
||||
|
||||
VkSemaphore renderFinishedSemaphores_Left;
|
||||
VkSemaphore renderFinishedSemaphores_Right;
|
||||
|
||||
VkFence inFlightFences_Left;
|
||||
VkFence inFlightFences_Right;
|
||||
|
||||
VkFence imagesInFlight_Left = VK_NULL_HANDLE;
|
||||
VkFence imagesInFlight_Right = VK_NULL_HANDLE;
|
||||
|
||||
int currentFrame = 0;
|
||||
int MAX_FRAMES_IN_FLIGHT = 2;
|
||||
bool inited = false;
|
||||
};
|
||||
Reference in New Issue
Block a user