diff options
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/gpu.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/gpu_thread.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index cdb2f804e..278528618 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -69,7 +69,7 @@ const DmaPusher& GPU::DmaPusher() const { | |||
| 69 | 69 | ||
| 70 | void GPU::IncrementSyncPoint(const u32 syncpoint_id) { | 70 | void GPU::IncrementSyncPoint(const u32 syncpoint_id) { |
| 71 | syncpoints[syncpoint_id]++; | 71 | syncpoints[syncpoint_id]++; |
| 72 | sync_mutex.lock(); | 72 | std::lock_guard lock{sync_mutex}; |
| 73 | if (!syncpt_interrupts[syncpoint_id].empty()) { | 73 | if (!syncpt_interrupts[syncpoint_id].empty()) { |
| 74 | u32 value = syncpoints[syncpoint_id].load(); | 74 | u32 value = syncpoints[syncpoint_id].load(); |
| 75 | auto it = syncpt_interrupts[syncpoint_id].begin(); | 75 | auto it = syncpt_interrupts[syncpoint_id].begin(); |
| @@ -82,7 +82,6 @@ void GPU::IncrementSyncPoint(const u32 syncpoint_id) { | |||
| 82 | it++; | 82 | it++; |
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | sync_mutex.unlock(); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const { | 87 | u32 GPU::GetSyncpointValue(const u32 syncpoint_id) const { |
| @@ -98,7 +97,7 @@ void GPU::RegisterSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | |||
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | bool GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | 99 | bool GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { |
| 101 | sync_mutex.lock(); | 100 | std::lock_guard lock{sync_mutex}; |
| 102 | auto it = syncpt_interrupts[syncpoint_id].begin(); | 101 | auto it = syncpt_interrupts[syncpoint_id].begin(); |
| 103 | while (it != syncpt_interrupts[syncpoint_id].end()) { | 102 | while (it != syncpt_interrupts[syncpoint_id].end()) { |
| 104 | if (value == *it) { | 103 | if (value == *it) { |
| @@ -108,7 +107,6 @@ bool GPU::CancelSyncptInterrupt(const u32 syncpoint_id, const u32 value) { | |||
| 108 | it++; | 107 | it++; |
| 109 | } | 108 | } |
| 110 | return false; | 109 | return false; |
| 111 | sync_mutex.unlock(); | ||
| 112 | } | 110 | } |
| 113 | 111 | ||
| 114 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { | 112 | u32 RenderTargetBytesPerPixel(RenderTargetFormat format) { |
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index b87938fdd..b441e92b0 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp | |||
| @@ -21,7 +21,8 @@ static void RunThread(VideoCore::RendererBase& renderer, Tegra::DmaPusher& dma_p | |||
| 21 | MicroProfileOnThreadCreate("GpuThread"); | 21 | MicroProfileOnThreadCreate("GpuThread"); |
| 22 | 22 | ||
| 23 | // Wait for first GPU command before acquiring the window context | 23 | // Wait for first GPU command before acquiring the window context |
| 24 | while (state.queue.Empty()); | 24 | while (state.queue.Empty()) |
| 25 | ; | ||
| 25 | 26 | ||
| 26 | // If emulation was stopped during disk shader loading, abort before trying to acquire context | 27 | // If emulation was stopped during disk shader loading, abort before trying to acquire context |
| 27 | if (!state.is_running) { | 28 | if (!state.is_running) { |
| @@ -103,7 +104,8 @@ u64 ThreadManager::PushCommand(CommandData&& command_data) { | |||
| 103 | 104 | ||
| 104 | MICROPROFILE_DEFINE(GPU_wait, "GPU", "Wait for the GPU", MP_RGB(128, 128, 192)); | 105 | MICROPROFILE_DEFINE(GPU_wait, "GPU", "Wait for the GPU", MP_RGB(128, 128, 192)); |
| 105 | void SynchState::WaitForSynchronization(u64 fence) { | 106 | void SynchState::WaitForSynchronization(u64 fence) { |
| 106 | while (signaled_fence.load() < fence); | 107 | while (signaled_fence.load() < fence) |
| 108 | ; | ||
| 107 | } | 109 | } |
| 108 | 110 | ||
| 109 | } // namespace VideoCommon::GPUThread | 111 | } // namespace VideoCommon::GPUThread |