Permalink
Browse files

Show textual names of Vulkan GPU vendors

  • Loading branch information...
hrydgard committed Nov 9, 2017
1 parent c6c90d4 commit ba846fdbc5ed82a0aa3c595488776b40575f63d9
View
@@ -36,4 +36,4 @@ class DummyGraphicsContext : public GraphicsContext {
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 @@ class VKContext : public DrawContext {
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:

0 comments on commit ba846fd

Please sign in to comment.