video_core: vulkan_device: Disable timeline semaphore on Turnip, fix qcom version check.

This commit is contained in:
bunnei 2023-07-03 19:17:40 -07:00
parent 44af2e32a4
commit 1462db4694
2 changed files with 16 additions and 9 deletions

View file

@ -500,7 +500,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
} }
if (extensions.extended_dynamic_state2 && is_qualcomm) { if (extensions.extended_dynamic_state2 && is_qualcomm) {
const u32 version = (properties.properties.driverVersion << 3) >> 3; const u32 version = (properties.properties.driverVersion << 3) >> 3;
if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0)) { if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) &&
version < VK_MAKE_API_VERSION(0, 0, 680, 0)) {
// Qualcomm Adreno 7xx drivers do not properly support extended_dynamic_state2. // Qualcomm Adreno 7xx drivers do not properly support extended_dynamic_state2.
LOG_WARNING(Render_Vulkan, LOG_WARNING(Render_Vulkan,
"Qualcomm Adreno 7xx drivers have broken VK_EXT_extended_dynamic_state2"); "Qualcomm Adreno 7xx drivers have broken VK_EXT_extended_dynamic_state2");
@ -540,7 +541,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
} }
if (extensions.vertex_input_dynamic_state && is_qualcomm) { if (extensions.vertex_input_dynamic_state && is_qualcomm) {
const u32 version = (properties.properties.driverVersion << 3) >> 3; const u32 version = (properties.properties.driverVersion << 3) >> 3;
if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0)) { if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) &&
version < VK_MAKE_API_VERSION(0, 0, 680, 0)) {
// Qualcomm Adreno 7xx drivers do not properly support vertex_input_dynamic_state. // Qualcomm Adreno 7xx drivers do not properly support vertex_input_dynamic_state.
LOG_WARNING( LOG_WARNING(
Render_Vulkan, Render_Vulkan,
@ -798,6 +800,17 @@ bool Device::ShouldBoostClocks() const {
return validated_driver && !is_steam_deck && !is_debugging; return validated_driver && !is_steam_deck && !is_debugging;
} }
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).
return false;
}
return features.timeline_semaphore.timelineSemaphore;
}
bool Device::GetSuitability(bool requires_swapchain) { bool Device::GetSuitability(bool requires_swapchain) {
// Assume we will be suitable. // Assume we will be suitable.
bool suitable = true; bool suitable = true;

View file

@ -528,13 +528,7 @@ public:
return extensions.shader_atomic_int64; return extensions.shader_atomic_int64;
} }
bool HasTimelineSemaphore() const { bool HasTimelineSemaphore() const;
if (GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) {
// Timeline semaphores do not work properly on all Qualcomm drivers.
return false;
}
return features.timeline_semaphore.timelineSemaphore;
}
/// Returns the minimum supported version of SPIR-V. /// Returns the minimum supported version of SPIR-V.
u32 SupportedSpirvVersion() const { u32 SupportedSpirvVersion() const {