GL: Detect Apple GPUs as a category

This commit is contained in:
Henrik Rydgård 2020-12-14 22:10:18 +01:00
parent 559ccd9f33
commit 2dcfa63498
5 changed files with 9 additions and 0 deletions

View File

@ -275,6 +275,8 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de
case 0x163C:
case 0x8086:
case 0x8087: caps_.vendor = GPUVendor::VENDOR_INTEL; break;
// TODO: There are Windows ARM devices that could have Qualcomm here too.
// Not sure where I'll find the vendor codes for those though...
default:
caps_.vendor = GPUVendor::VENDOR_UNKNOWN;
}

View File

@ -181,6 +181,8 @@ void CheckGLExtensions() {
// Just for reference: Galaxy Y has renderer == "VideoCore IV HW"
} else if (vendor == "Vivante Corporation") {
gl_extensions.gpuVendor = GPU_VENDOR_VIVANTE;
} else if (vendor == "Apple") {
gl_extensions.gpuVendor = GPU_VENDOR_APPLE;
} else {
gl_extensions.gpuVendor = GPU_VENDOR_UNKNOWN;
}

View File

@ -6,6 +6,7 @@
#include <string>
// TODO: Replace with thin3d's vendor enum.
enum {
GPU_VENDOR_NVIDIA = 1,
GPU_VENDOR_AMD = 2,
@ -15,6 +16,7 @@ enum {
GPU_VENDOR_QUALCOMM = 6, // Adreno
GPU_VENDOR_BROADCOM = 7, // Raspberry PI etc
GPU_VENDOR_VIVANTE = 8,
GPU_VENDOR_APPLE = 9,
GPU_VENDOR_UNKNOWN = 0,
};

View File

@ -442,6 +442,7 @@ public:
case GPUVendor::VENDOR_ARM: return "VENDOR_ARM";
case GPUVendor::VENDOR_BROADCOM: return "VENDOR_BROADCOM";
case GPUVendor::VENDOR_VIVANTE: return "VENDOR_VIVANTE";
case GPUVendor::VENDOR_APPLE: return "VENDOR_APPLE";
case GPUVendor::VENDOR_UNKNOWN:
default:
return "VENDOR_UNKNOWN";
@ -544,6 +545,7 @@ OpenGLContext::OpenGLContext() {
case GPU_VENDOR_INTEL: caps_.vendor = GPUVendor::VENDOR_INTEL; break;
case GPU_VENDOR_IMGTEC: caps_.vendor = GPUVendor::VENDOR_IMGTEC; break;
case GPU_VENDOR_VIVANTE: caps_.vendor = GPUVendor::VENDOR_VIVANTE; break;
case GPU_VENDOR_APPLE: caps_.vendor = GPUVendor::VENDOR_APPLE; break;
case GPU_VENDOR_UNKNOWN:
default:
caps_.vendor = GPUVendor::VENDOR_UNKNOWN;

View File

@ -222,6 +222,7 @@ enum class GPUVendor {
VENDOR_IMGTEC, // PowerVR
VENDOR_BROADCOM, // Raspberry
VENDOR_VIVANTE,
VENDOR_APPLE,
};
enum class NativeObject {