2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
2019-10-03 16:21:23 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "BLI_sys_types.h"
|
2020-07-25 18:41:55 +02:00
|
|
|
#include "BLI_utildefines.h"
|
2019-10-03 16:21:23 +02:00
|
|
|
|
|
|
|
|
/* GPU platform support */
|
|
|
|
|
|
2022-03-22 12:38:28 +01:00
|
|
|
typedef enum eGPUBackendType {
|
|
|
|
|
GPU_BACKEND_NONE = 0,
|
|
|
|
|
GPU_BACKEND_OPENGL = 1 << 0,
|
|
|
|
|
GPU_BACKEND_METAL = 1 << 1,
|
|
|
|
|
GPU_BACKEND_ANY = 0xFFFFFFFFu
|
|
|
|
|
} eGPUBackendType;
|
|
|
|
|
|
2019-10-03 16:21:23 +02:00
|
|
|
/* GPU Types */
|
|
|
|
|
typedef enum eGPUDeviceType {
|
|
|
|
|
GPU_DEVICE_NVIDIA = (1 << 0),
|
|
|
|
|
GPU_DEVICE_ATI = (1 << 1),
|
|
|
|
|
GPU_DEVICE_INTEL = (1 << 2),
|
|
|
|
|
GPU_DEVICE_INTEL_UHD = (1 << 3),
|
2022-04-04 16:33:33 +02:00
|
|
|
GPU_DEVICE_APPLE = (1 << 4),
|
|
|
|
|
GPU_DEVICE_SOFTWARE = (1 << 5),
|
|
|
|
|
GPU_DEVICE_UNKNOWN = (1 << 6),
|
2019-10-03 16:21:23 +02:00
|
|
|
GPU_DEVICE_ANY = (0xff),
|
|
|
|
|
} eGPUDeviceType;
|
|
|
|
|
|
2020-10-01 23:51:01 +05:30
|
|
|
ENUM_OPERATORS(eGPUDeviceType, GPU_DEVICE_ANY)
|
2020-07-25 18:41:55 +02:00
|
|
|
|
2019-10-03 16:21:23 +02:00
|
|
|
typedef enum eGPUOSType {
|
|
|
|
|
GPU_OS_WIN = (1 << 8),
|
|
|
|
|
GPU_OS_MAC = (1 << 9),
|
|
|
|
|
GPU_OS_UNIX = (1 << 10),
|
|
|
|
|
GPU_OS_ANY = (0xff00),
|
|
|
|
|
} eGPUOSType;
|
|
|
|
|
|
|
|
|
|
typedef enum eGPUDriverType {
|
|
|
|
|
GPU_DRIVER_OFFICIAL = (1 << 16),
|
|
|
|
|
GPU_DRIVER_OPENSOURCE = (1 << 17),
|
|
|
|
|
GPU_DRIVER_SOFTWARE = (1 << 18),
|
|
|
|
|
GPU_DRIVER_ANY = (0xff0000),
|
|
|
|
|
} eGPUDriverType;
|
|
|
|
|
|
|
|
|
|
typedef enum eGPUSupportLevel {
|
|
|
|
|
GPU_SUPPORT_LEVEL_SUPPORTED,
|
|
|
|
|
GPU_SUPPORT_LEVEL_LIMITED,
|
|
|
|
|
GPU_SUPPORT_LEVEL_UNSUPPORTED,
|
|
|
|
|
} eGPUSupportLevel;
|
|
|
|
|
|
2020-07-27 11:40:47 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2021-12-09 20:01:47 +11:00
|
|
|
/* GPU Types */
|
2022-03-22 13:44:15 +01:00
|
|
|
/* TODO: Verify all use-cases of GPU_type_matches to determine which graphics API it should apply
|
|
|
|
|
* to, and replace with `GPU_type_matches_ex` where appropriate. */
|
2019-10-03 16:21:23 +02:00
|
|
|
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver);
|
2022-03-22 13:44:15 +01:00
|
|
|
bool GPU_type_matches_ex(eGPUDeviceType device,
|
|
|
|
|
eGPUOSType os,
|
|
|
|
|
eGPUDriverType driver,
|
|
|
|
|
eGPUBackendType backend);
|
2021-12-09 20:01:47 +11:00
|
|
|
|
2019-10-03 16:21:23 +02:00
|
|
|
eGPUSupportLevel GPU_platform_support_level(void);
|
2021-05-14 11:15:00 -03:00
|
|
|
const char *GPU_platform_vendor(void);
|
|
|
|
|
const char *GPU_platform_renderer(void);
|
|
|
|
|
const char *GPU_platform_version(void);
|
2019-10-03 16:21:23 +02:00
|
|
|
const char *GPU_platform_support_level_key(void);
|
|
|
|
|
const char *GPU_platform_gpu_name(void);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|