Blender V4.3
GPU_platform.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include <string>
12
13#include "BLI_span.hh"
14#include "BLI_sys_types.h"
15#include "BLI_utildefines.h"
16
18
19/* GPU platform support */
20
21/* GPU Types */
33
35
37 GPU_OS_WIN = (1 << 8),
38 GPU_OS_MAC = (1 << 9),
39 GPU_OS_UNIX = (1 << 10),
40 GPU_OS_ANY = (0xff00),
41};
42
47 GPU_DRIVER_ANY = (0xff0000),
48};
49
55
57 /* Immediate Mode Renderer (IMR).
58 * Typically, an IMR architecture will execute GPU work in sequence, rasterizing primitives in
59 * order. */
61
62 /* Tile-Based-Deferred-Renderer (TBDR).
63 * A TBDR architecture will typically execute the vertex stage up-front for all primitives,
64 * binning geometry into distinct tiled regions. Fragments will then be rasterized within
65 * the bounds of one tile at a time. */
67};
68
69typedef struct GPUDevice {
70 std::string identifier;
71 int index;
74 std::string name;
75} GPUDevice;
76
77/* GPU Types */
78/* TODO: Verify all use-cases of GPU_type_matches to determine which graphics API it should apply
79 * to, and replace with `GPU_type_matches_ex` where appropriate. */
82 eGPUOSType os,
83 eGPUDriverType driver,
84 eGPUBackendType backend);
85
87const char *GPU_platform_vendor();
88const char *GPU_platform_renderer();
89const char *GPU_platform_version();
91const char *GPU_platform_gpu_name();
#define ENUM_OPERATORS(_type, _max)
eGPUDriverType
@ GPU_DRIVER_ANY
@ GPU_DRIVER_OFFICIAL
@ GPU_DRIVER_OPENSOURCE
@ GPU_DRIVER_SOFTWARE
struct GPUDevice GPUDevice
const char * GPU_platform_vendor()
const char * GPU_platform_gpu_name()
bool GPU_type_matches_ex(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver, eGPUBackendType backend)
const char * GPU_platform_support_level_key()
GPUArchitectureType
@ GPU_ARCHITECTURE_TBDR
@ GPU_ARCHITECTURE_IMR
eGPUSupportLevel
@ GPU_SUPPORT_LEVEL_LIMITED
@ GPU_SUPPORT_LEVEL_SUPPORTED
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
const char * GPU_platform_renderer()
eGPUOSType
@ GPU_OS_WIN
@ GPU_OS_UNIX
@ GPU_OS_ANY
@ GPU_OS_MAC
eGPUDeviceType
@ GPU_DEVICE_UNKNOWN
@ GPU_DEVICE_ATI
@ GPU_DEVICE_INTEL_UHD
@ GPU_DEVICE_QUALCOMM
@ GPU_DEVICE_SOFTWARE
@ GPU_DEVICE_NVIDIA
@ GPU_DEVICE_ANY
@ GPU_DEVICE_APPLE
@ GPU_DEVICE_INTEL
const char * GPU_platform_version()
bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver)
blender::Span< GPUDevice > GPU_platform_devices_list()
eGPUSupportLevel GPU_platform_support_level()
GPUArchitectureType GPU_platform_architecture()
unsigned int uint32_t
Definition stdint.h:80
uint32_t device_id
std::string identifier
std::string name
uint32_t vendor_id