Blender
V3.3
source
blender
gpu
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
{
16
GPU_BACKEND_NONE
= 0,
17
GPU_BACKEND_OPENGL
= 1 << 0,
18
GPU_BACKEND_METAL
= 1 << 1,
19
GPU_BACKEND_ANY
= 0xFFFFFFFFu
20
}
eGPUBackendType
;
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),
27
GPU_DEVICE_INTEL_UHD
= (1 << 3),
28
GPU_DEVICE_APPLE
= (1 << 4),
29
GPU_DEVICE_SOFTWARE
= (1 << 5),
30
GPU_DEVICE_UNKNOWN
= (1 << 6),
31
GPU_DEVICE_ANY
= (0xff),
32
}
eGPUDeviceType
;
33
34
ENUM_OPERATORS
(
eGPUDeviceType
,
GPU_DEVICE_ANY
)
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),
41
}
eGPUOSType
;
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),
48
}
eGPUDriverType
;
49
50
typedef
enum
eGPUSupportLevel
{
51
GPU_SUPPORT_LEVEL_SUPPORTED
,
52
GPU_SUPPORT_LEVEL_LIMITED
,
53
GPU_SUPPORT_LEVEL_UNSUPPORTED
,
54
}
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. */
63
bool
GPU_type_matches
(
eGPUDeviceType
device,
eGPUOSType
os,
eGPUDriverType
driver);
64
bool
GPU_type_matches_ex
(
eGPUDeviceType
device,
65
eGPUOSType
os,
66
eGPUDriverType
driver,
67
eGPUBackendType
backend);
68
69
eGPUSupportLevel
GPU_platform_support_level
(
void
);
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
BLI_sys_types.h
BLI_utildefines.h
ENUM_OPERATORS
#define ENUM_OPERATORS(_type, _max)
Definition:
BLI_utildefines.h:812
GPU_platform_gpu_name
const char * GPU_platform_gpu_name(void)
Definition:
gpu_platform.cc:140
eGPUBackendType
eGPUBackendType
Definition:
GPU_platform.h:15
GPU_BACKEND_NONE
@ GPU_BACKEND_NONE
Definition:
GPU_platform.h:16
GPU_BACKEND_ANY
@ GPU_BACKEND_ANY
Definition:
GPU_platform.h:19
GPU_BACKEND_METAL
@ GPU_BACKEND_METAL
Definition:
GPU_platform.h:18
GPU_BACKEND_OPENGL
@ GPU_BACKEND_OPENGL
Definition:
GPU_platform.h:17
GPU_platform_vendor
const char * GPU_platform_vendor(void)
Definition:
gpu_platform.cc:116
eGPUDriverType
eGPUDriverType
Definition:
GPU_platform.h:43
GPU_DRIVER_ANY
@ GPU_DRIVER_ANY
Definition:
GPU_platform.h:47
GPU_DRIVER_OFFICIAL
@ GPU_DRIVER_OFFICIAL
Definition:
GPU_platform.h:44
GPU_DRIVER_OPENSOURCE
@ GPU_DRIVER_OPENSOURCE
Definition:
GPU_platform.h:45
GPU_DRIVER_SOFTWARE
@ GPU_DRIVER_SOFTWARE
Definition:
GPU_platform.h:46
GPU_platform_support_level_key
const char * GPU_platform_support_level_key(void)
Definition:
gpu_platform.cc:134
GPU_type_matches_ex
bool GPU_type_matches_ex(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver, eGPUBackendType backend)
Definition:
gpu_platform.cc:151
eGPUSupportLevel
eGPUSupportLevel
Definition:
GPU_platform.h:50
GPU_SUPPORT_LEVEL_LIMITED
@ GPU_SUPPORT_LEVEL_LIMITED
Definition:
GPU_platform.h:52
GPU_SUPPORT_LEVEL_SUPPORTED
@ GPU_SUPPORT_LEVEL_SUPPORTED
Definition:
GPU_platform.h:51
GPU_SUPPORT_LEVEL_UNSUPPORTED
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
Definition:
GPU_platform.h:53
eGPUOSType
eGPUOSType
Definition:
GPU_platform.h:36
GPU_OS_WIN
@ GPU_OS_WIN
Definition:
GPU_platform.h:37
GPU_OS_UNIX
@ GPU_OS_UNIX
Definition:
GPU_platform.h:39
GPU_OS_ANY
@ GPU_OS_ANY
Definition:
GPU_platform.h:40
GPU_OS_MAC
@ GPU_OS_MAC
Definition:
GPU_platform.h:38
eGPUDeviceType
eGPUDeviceType
Definition:
GPU_platform.h:23
GPU_DEVICE_UNKNOWN
@ GPU_DEVICE_UNKNOWN
Definition:
GPU_platform.h:30
GPU_DEVICE_ATI
@ GPU_DEVICE_ATI
Definition:
GPU_platform.h:25
GPU_DEVICE_INTEL_UHD
@ GPU_DEVICE_INTEL_UHD
Definition:
GPU_platform.h:27
GPU_DEVICE_SOFTWARE
@ GPU_DEVICE_SOFTWARE
Definition:
GPU_platform.h:29
GPU_DEVICE_NVIDIA
@ GPU_DEVICE_NVIDIA
Definition:
GPU_platform.h:24
GPU_DEVICE_ANY
@ GPU_DEVICE_ANY
Definition:
GPU_platform.h:31
GPU_DEVICE_APPLE
@ GPU_DEVICE_APPLE
Definition:
GPU_platform.h:28
GPU_DEVICE_INTEL
@ GPU_DEVICE_INTEL
Definition:
GPU_platform.h:26
GPU_type_matches
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
Definition:
gpu_platform.cc:146
GPU_platform_version
const char * GPU_platform_version(void)
Definition:
gpu_platform.cc:128
GPU_platform_support_level
eGPUSupportLevel GPU_platform_support_level(void)
Definition:
gpu_platform.cc:110
GPU_platform_renderer
const char * GPU_platform_renderer(void)
Definition:
gpu_platform.cc:122
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1