vulkan: implement getRendererInfo

This commit is contained in:
niki
2022-07-10 19:13:10 +02:00
parent 565455c3ea
commit ef08282f0d
4 changed files with 153 additions and 116 deletions
+29
View File
@@ -1,5 +1,8 @@
#include "Vulkan.h"
#include <sstream>
namespace love {
namespace graphics {
namespace vulkan {
@@ -257,6 +260,32 @@ namespace love {
return textureFormat;
}
// values taken from https://pcisig.com/membership/member-companies
// as specified at https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceProperties.html
std::string Vulkan::getVendorName(uint32_t vendorId) {
switch (vendorId) {
case 4318:
return "Nvidia";
case 8086:
return "Intel";
case 4130:
return "Advanced Micro Devices";
default:
return "unknown";
}
}
std::string Vulkan::getVulkanApiVersion(uint32_t version) {
std::stringstream ss;
ss << VK_API_VERSION_VARIANT(version)
<< "." << VK_API_VERSION_MAJOR(version)
<< "." << VK_API_VERSION_MINOR(version)
<< "." << VK_API_VERSION_PATCH(version);
return ss.str();
}
}
}
}