mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Show textual names of Vulkan GPU vendors
This commit is contained in:
parent
c6c90d4cbc
commit
ba846fdbc5
4 changed files with 21 additions and 3 deletions
|
@ -36,4 +36,4 @@ public:
|
|||
void Resize() override {}
|
||||
|
||||
Draw::DrawContext *GetDrawContext() override { return nullptr; }
|
||||
};
|
||||
};
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "base/basictypes.h"
|
||||
#include "VulkanContext.h"
|
||||
#include "GPU/Common/ShaderCommon.h"
|
||||
#include "Common/StringUtils.h"
|
||||
|
||||
#ifdef USE_CRT_DBG
|
||||
#undef new
|
||||
|
@ -50,6 +51,20 @@ static const char *validationLayers[] = {
|
|||
*/
|
||||
};
|
||||
|
||||
std::string VulkanVendorString(uint32_t vendorId) {
|
||||
switch (vendorId) {
|
||||
case VULKAN_VENDOR_INTEL: return "Intel";
|
||||
case VULKAN_VENDOR_NVIDIA: return "nVidia";
|
||||
case VULKAN_VENDOR_AMD: return "AMD";
|
||||
case VULKAN_VENDOR_ARM: return "ARM";
|
||||
case VULKAN_VENDOR_QUALCOMM: return "Qualcomm";
|
||||
case VULKAN_VENDOR_IMGTEC: return "Imagination";
|
||||
|
||||
default:
|
||||
return StringFromFormat("%08x", vendorId);
|
||||
}
|
||||
}
|
||||
|
||||
VulkanContext::VulkanContext() {
|
||||
if (!VulkanLoad()) {
|
||||
init_error_ = "Failed to load Vulkan driver library";
|
||||
|
@ -361,7 +376,7 @@ int VulkanContext::GetBestPhysicalDevice() {
|
|||
score += 5;
|
||||
}
|
||||
if (score > maxScore) {
|
||||
best = i;
|
||||
best = (int)i;
|
||||
maxScore = score;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,9 @@ enum {
|
|||
VULKAN_VENDOR_IMGTEC = 0x00001010, // PowerVR
|
||||
};
|
||||
|
||||
std::string VulkanVendorString(uint32_t vendorId);
|
||||
|
||||
|
||||
struct VulkanPhysicalDeviceInfo {
|
||||
VkFormat preferredDepthStencilFormat;
|
||||
};
|
||||
|
|
|
@ -429,7 +429,7 @@ public:
|
|||
switch (info) {
|
||||
case APINAME: return "Vulkan";
|
||||
case VENDORSTRING: return vulkan_->GetPhysicalDeviceProperties().deviceName;
|
||||
case VENDOR: return StringFromFormat("%08x", vulkan_->GetPhysicalDeviceProperties().vendorID);
|
||||
case VENDOR: return VulkanVendorString(vulkan_->GetPhysicalDeviceProperties().vendorID);
|
||||
case DRIVER: return StringFromFormat("%08x", vulkan_->GetPhysicalDeviceProperties().driverVersion);
|
||||
case SHADELANGVERSION: return "N/A";;
|
||||
case APIVERSION:
|
||||
|
|
Loading…
Add table
Reference in a new issue