Blender  V3.3
GPU_platform.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "BLI_sys_types.h"
11 #include "BLI_utildefines.h"
12 
13 /* GPU platform support */
14 
15 typedef enum eGPUBackendType {
19  GPU_BACKEND_ANY = 0xFFFFFFFFu
21 
22 /* GPU Types */
23 typedef enum eGPUDeviceType {
24  GPU_DEVICE_NVIDIA = (1 << 0),
25  GPU_DEVICE_ATI = (1 << 1),
26  GPU_DEVICE_INTEL = (1 << 2),
28  GPU_DEVICE_APPLE = (1 << 4),
29  GPU_DEVICE_SOFTWARE = (1 << 5),
30  GPU_DEVICE_UNKNOWN = (1 << 6),
31  GPU_DEVICE_ANY = (0xff),
33 
35 
36 typedef enum eGPUOSType {
37  GPU_OS_WIN = (1 << 8),
38  GPU_OS_MAC = (1 << 9),
39  GPU_OS_UNIX = (1 << 10),
40  GPU_OS_ANY = (0xff00),
42 
43 typedef enum eGPUDriverType {
44  GPU_DRIVER_OFFICIAL = (1 << 16),
45  GPU_DRIVER_OPENSOURCE = (1 << 17),
46  GPU_DRIVER_SOFTWARE = (1 << 18),
47  GPU_DRIVER_ANY = (0xff0000),
49 
50 typedef enum eGPUSupportLevel {
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /* GPU Types */
61 /* TODO: Verify all use-cases of GPU_type_matches to determine which graphics API it should apply
62  * to, and replace with `GPU_type_matches_ex` where appropriate. */
65  eGPUOSType os,
66  eGPUDriverType driver,
67  eGPUBackendType backend);
68 
70 const char *GPU_platform_vendor(void);
71 const char *GPU_platform_renderer(void);
72 const char *GPU_platform_version(void);
73 const char *GPU_platform_support_level_key(void);
74 const char *GPU_platform_gpu_name(void);
75 
76 #ifdef __cplusplus
77 }
78 #endif
#define ENUM_OPERATORS(_type, _max)
const char * GPU_platform_gpu_name(void)
eGPUBackendType
Definition: GPU_platform.h:15
@ GPU_BACKEND_NONE
Definition: GPU_platform.h:16
@ GPU_BACKEND_ANY
Definition: GPU_platform.h:19
@ GPU_BACKEND_METAL
Definition: GPU_platform.h:18
@ GPU_BACKEND_OPENGL
Definition: GPU_platform.h:17
const char * GPU_platform_vendor(void)
eGPUDriverType
Definition: GPU_platform.h:43
@ GPU_DRIVER_ANY
Definition: GPU_platform.h:47
@ GPU_DRIVER_OFFICIAL
Definition: GPU_platform.h:44
@ GPU_DRIVER_OPENSOURCE
Definition: GPU_platform.h:45
@ GPU_DRIVER_SOFTWARE
Definition: GPU_platform.h:46
const char * GPU_platform_support_level_key(void)
bool GPU_type_matches_ex(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver, eGPUBackendType backend)
eGPUSupportLevel
Definition: GPU_platform.h:50
@ GPU_SUPPORT_LEVEL_LIMITED
Definition: GPU_platform.h:52
@ GPU_SUPPORT_LEVEL_SUPPORTED
Definition: GPU_platform.h:51
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
Definition: GPU_platform.h:53
eGPUOSType
Definition: GPU_platform.h:36
@ GPU_OS_WIN
Definition: GPU_platform.h:37
@ GPU_OS_UNIX
Definition: GPU_platform.h:39
@ GPU_OS_ANY
Definition: GPU_platform.h:40
@ GPU_OS_MAC
Definition: GPU_platform.h:38
eGPUDeviceType
Definition: GPU_platform.h:23
@ GPU_DEVICE_UNKNOWN
Definition: GPU_platform.h:30
@ GPU_DEVICE_ATI
Definition: GPU_platform.h:25
@ GPU_DEVICE_INTEL_UHD
Definition: GPU_platform.h:27
@ GPU_DEVICE_SOFTWARE
Definition: GPU_platform.h:29
@ GPU_DEVICE_NVIDIA
Definition: GPU_platform.h:24
@ GPU_DEVICE_ANY
Definition: GPU_platform.h:31
@ GPU_DEVICE_APPLE
Definition: GPU_platform.h:28
@ GPU_DEVICE_INTEL
Definition: GPU_platform.h:26
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
const char * GPU_platform_version(void)
eGPUSupportLevel GPU_platform_support_level(void)
const char * GPU_platform_renderer(void)