mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Let's try a mutex. Doesn't completely solve the problem though..
This commit is contained in:
parent
d3672d9e57
commit
72a41cd524
2 changed files with 5 additions and 0 deletions
|
@ -215,9 +215,11 @@ void VulkanRenderManager::ThreadFunc() {
|
|||
condVar_.wait(lock);
|
||||
if (frameAvailable_) {
|
||||
int frame = threadFrame_;
|
||||
frameData_[frame].mutex.lock();
|
||||
frameAvailable_ = false;
|
||||
Run(frame);
|
||||
EndFrame(frame);
|
||||
frameData_[frame].mutex.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -236,6 +238,7 @@ void VulkanRenderManager::BeginFrame() {
|
|||
;
|
||||
}
|
||||
frameData.readyForFence = false;
|
||||
frameData.mutex.lock();
|
||||
}
|
||||
|
||||
ILOG("Fencing %d", curFrame);
|
||||
|
@ -656,6 +659,7 @@ void VulkanRenderManager::Flush() {
|
|||
Run(curFrame);
|
||||
EndFrame(curFrame);
|
||||
} else {
|
||||
frameData.mutex.unlock();
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(mutex_);
|
||||
frameAvailable_ = true;
|
||||
|
|
|
@ -335,6 +335,7 @@ private:
|
|||
|
||||
// Per-frame data, round-robin so we can overlap submission with execution of the previous frame.
|
||||
struct FrameData {
|
||||
std::mutex mutex;
|
||||
bool readyForFence = true;
|
||||
VkFence fence;
|
||||
// These are on different threads so need separate pools.
|
||||
|
|
Loading…
Add table
Reference in a new issue