- add vk_submit_multithread for doing command buffer submit calls on a worker thread
- add vk_submit_size for testing various command buffer sizes before flushing them - add submitted command buffer count to renderstats
This commit is contained in:
parent
3957a19bd0
commit
458da39c39
4 changed files with 121 additions and 22 deletions
|
|
@ -3,6 +3,9 @@
|
|||
#include "gl_sysfb.h"
|
||||
#include "vk_device.h"
|
||||
#include "vk_objects.h"
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
struct FRenderViewpoint;
|
||||
class VkSamplerManager;
|
||||
|
|
@ -111,6 +114,10 @@ private:
|
|||
void CopyScreenToBuffer(int w, int h, void *data);
|
||||
void UpdateShadowMap();
|
||||
void DeleteFrameObjects();
|
||||
void StartSubmitThread();
|
||||
void StopSubmitThread();
|
||||
void SubmitThreadMain();
|
||||
void FlushCommands(VulkanCommandBuffer **commands, size_t count);
|
||||
|
||||
std::unique_ptr<VkShaderManager> mShaderManager;
|
||||
std::unique_ptr<VkSamplerManager> mSamplerManager;
|
||||
|
|
@ -134,6 +141,14 @@ private:
|
|||
std::unique_ptr<VulkanFence> mRenderFinishedFence;
|
||||
|
||||
VkRenderBuffers *mActiveRenderBuffers = nullptr;
|
||||
|
||||
std::thread mSubmitThread;
|
||||
std::condition_variable mSubmitCondVar;
|
||||
std::condition_variable mSubmitDone;
|
||||
std::mutex mSubmitMutex;
|
||||
std::vector<VulkanCommandBuffer*> mSubmitQueue;
|
||||
size_t mSubmitItemsActive = 0;
|
||||
bool mSubmitExitFlag = false;
|
||||
};
|
||||
|
||||
inline VulkanFrameBuffer *GetVulkanFrameBuffer() { return static_cast<VulkanFrameBuffer*>(screen); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue