mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-16 19:13:40 +01:00
Improve Mali driver version detection
This commit is contained in:
1 parent
57c6ab7206
commit
025a9f4dae
4 files changed
+51
-27
No files matched your search
@@ -429,30 +429,6 @@ public:
|
||||
|
||||
void FlushState() override {}
|
||||
|
||||
// From Sascha's code
|
||||
static std::string FormatDriverVersion(const VkPhysicalDeviceProperties &props) {
|
||||
if (props.vendorID == VULKAN_VENDOR_NVIDIA) {
|
||||
// 10 bits = major version (up to r1023)
|
||||
// 8 bits = minor version (up to 255)
|
||||
// 8 bits = secondary branch version/build version (up to 255)
|
||||
// 6 bits = tertiary branch/build version (up to 63)
|
||||
uint32_t major = (props.driverVersion >> 22) & 0x3ff;
|
||||
uint32_t minor = (props.driverVersion >> 14) & 0x0ff;
|
||||
uint32_t secondaryBranch = (props.driverVersion >> 6) & 0x0ff;
|
||||
uint32_t tertiaryBranch = (props.driverVersion) & 0x003f;
|
||||
return StringFromFormat("%d.%d.%d.%d (%08x)", major, minor, secondaryBranch, tertiaryBranch, props.driverVersion);
|
||||
} else if (props.vendorID == VULKAN_VENDOR_ARM) {
|
||||
// ARM just puts a hash here, let's just output it as is.
|
||||
return StringFromFormat("%08x", props.driverVersion);
|
||||
} else {
|
||||
// Standard scheme, use the standard macros.
|
||||
uint32_t major = VK_VERSION_MAJOR(props.driverVersion);
|
||||
uint32_t minor = VK_VERSION_MINOR(props.driverVersion);
|
||||
uint32_t branch = VK_VERSION_PATCH(props.driverVersion);
|
||||
return StringFromFormat("%d.%d.%d (%08x)", major, minor, branch, props.driverVersion);
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetInfoString(InfoField info) const override {
|
||||
// TODO: Make these actually query the right information
|
||||
switch (info) {
|
||||
|
||||
Reference in new issue
Block a user