diff options
| author | Dentomologist <dentomologist@gmail.com> | 2026-04-28 17:50:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-28 17:50:51 -0700 |
| commit | 2b743639d825eeca76fd7ada96ec463a8add9628 (patch) | |
| tree | d75232ec71d0a1bfb151cc2014f2d1fe5b6e9584 /Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | |
| parent | 725a726174757af5bc8fdd6f8b92c24e88d08768 (diff) | |
| parent | 9ae9c129383c71fc8f943d56a5f5d65b8d5c7078 (diff) | |
Merge pull request #13505 from tygyh/Replace-find-with-contains
Source/Core: Replace `find(x) != npos` with `contains(x)`
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/VulkanContext.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Vulkan/VulkanContext.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp index 2d302c0f38..d388300b6e 100644 --- a/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp +++ b/Source/Core/VideoBackends/Vulkan/VulkanContext.cpp @@ -988,12 +988,11 @@ void VulkanContext::InitDriverDetails() vendor = DriverDetails::VENDOR_NVIDIA; driver = DriverDetails::DRIVER_NVIDIA; } - else if (vendor_id == 0x1002 || vendor_id == 0x1022 || - device_name.find("AMD") != std::string::npos) + else if (vendor_id == 0x1002 || vendor_id == 0x1022 || device_name.contains("AMD")) { // RADV always advertises its name in the device string. // If not RADV, assume the AMD binary driver. - if (device_name.find("RADV") != std::string::npos) + if (device_name.contains("RADV")) { vendor = DriverDetails::VENDOR_MESA; driver = DriverDetails::DRIVER_R600; @@ -1004,8 +1003,7 @@ void VulkanContext::InitDriverDetails() driver = DriverDetails::DRIVER_ATI; } } - else if (vendor_id == 0x8086 || vendor_id == 0x8087 || - device_name.find("Intel") != std::string::npos) + else if (vendor_id == 0x8086 || vendor_id == 0x8087 || device_name.contains("Intel")) { // Apart from the driver version, Intel does not appear to provide a way to // differentiate between anv and the binary driver (Skylake+). Assume to be @@ -1018,25 +1016,25 @@ void VulkanContext::InitDriverDetails() driver = DriverDetails::DRIVER_I965; #endif } - else if (vendor_id == 0x5143 || device_name.find("Adreno") != std::string::npos) + else if (vendor_id == 0x5143 || device_name.contains("Adreno")) { // Currently only the Qualcomm binary driver exists for Adreno. vendor = DriverDetails::VENDOR_QUALCOMM; driver = DriverDetails::DRIVER_QUALCOMM; } - else if (vendor_id == 0x13B6 || device_name.find("Mali") != std::string::npos) + else if (vendor_id == 0x13B6 || device_name.contains("Mali")) { // Currently only the ARM binary driver exists for Mali. vendor = DriverDetails::VENDOR_ARM; driver = DriverDetails::DRIVER_ARM; } - else if (vendor_id == 0x1010 || device_name.find("PowerVR") != std::string::npos) + else if (vendor_id == 0x1010 || device_name.contains("PowerVR")) { // Currently only the binary driver exists for PowerVR. vendor = DriverDetails::VENDOR_IMGTEC; driver = DriverDetails::DRIVER_IMGTEC; } - else if (device_name.find("Apple") != std::string::npos) + else if (device_name.contains("Apple")) { vendor = DriverDetails::VENDOR_APPLE; driver = DriverDetails::DRIVER_PORTABILITY; |
