Browse Source
[vk, qcom] TimelineSemaphore syncs to GPUTick.
eds-true-adreno-fixes
CamilleLaVey
3 weeks ago
committed by
Caio Oliveira
No known key found for this signature in database
GPG Key ID: AAAE6C7FD4186B0C
4 changed files with
18 additions and
8 deletions
-
src/video_core/renderer_opengl/gl_fence_manager.h
-
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
-
src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp
-
src/video_core/vulkan_common/vulkan_device.cpp
|
|
|
@ -1,3 +1,6 @@ |
|
|
|
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project |
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later |
|
|
|
|
|
|
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project |
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later |
|
|
|
|
|
|
|
|
|
|
|
@ -309,9 +309,8 @@ size_t GetTotalPipelineWorkers() { |
|
|
|
const size_t max_core_threads = |
|
|
|
std::max<size_t>(static_cast<size_t>(std::thread::hardware_concurrency()), 2ULL) - 1ULL; |
|
|
|
#ifdef ANDROID
|
|
|
|
// Leave at least one core free on Android. Previously we reserved two, but
|
|
|
|
// shipping builds benefit from one extra compilation worker.
|
|
|
|
constexpr size_t free_cores = 1ULL; |
|
|
|
// Leave at least two cores free on Android to reduce thermal pressure.
|
|
|
|
constexpr size_t free_cores = 2ULL; |
|
|
|
if (max_core_threads <= free_cores) { |
|
|
|
return 1ULL; |
|
|
|
} |
|
|
|
|
|
|
|
@ -147,6 +147,7 @@ StagingBufferRef StagingBufferPool::GetStreamBuffer(size_t size) { |
|
|
|
} |
|
|
|
|
|
|
|
bool StagingBufferPool::AreRegionsActive(size_t region_begin, size_t region_end) const { |
|
|
|
scheduler.GetMasterSemaphore().Refresh(); |
|
|
|
const u64 gpu_tick = scheduler.GetMasterSemaphore().KnownGpuTick(); |
|
|
|
return std::any_of(sync_ticks.begin() + region_begin, sync_ticks.begin() + region_end, |
|
|
|
[gpu_tick](u64 sync_tick) { return gpu_tick < sync_tick; }); |
|
|
|
|
|
|
|
@ -978,13 +978,20 @@ bool Device::ShouldBoostClocks() const { |
|
|
|
} |
|
|
|
|
|
|
|
bool Device::HasTimelineSemaphore() const { |
|
|
|
if (GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || |
|
|
|
GetDriverID() == VK_DRIVER_ID_MESA_TURNIP) { |
|
|
|
// Timeline semaphores do not work properly on all Qualcomm drivers.
|
|
|
|
// They generally work properly with Turnip drivers, but are problematic on some devices
|
|
|
|
// (e.g. ZTE handsets with Snapdragon 870).
|
|
|
|
const VkDriverIdKHR driver_id = GetDriverID(); |
|
|
|
if (driver_id == VK_DRIVER_ID_MESA_TURNIP) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) { |
|
|
|
// Drop the variant bits before comparing to the minimum supported timeline build.
|
|
|
|
const u32 driver_version = (GetDriverVersion() << 3) >> 3; |
|
|
|
constexpr u32 min_timeline_driver = VK_MAKE_API_VERSION(0, 500, 800, 51); |
|
|
|
if (driver_version < min_timeline_driver) { |
|
|
|
// Older Qualcomm stacks still need binary fences for stability.
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
return features.timeline_semaphore.timelineSemaphore; |
|
|
|
} |
|
|
|
|
|
|
|
|