Blender V5.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
8
9#pragma once
10
11#include <cstdint>
12#include <optional>
13#include <string>
14
15#include "BLI_enum_flags.hh"
16#include "BLI_span.hh"
17
18#include "GPU_platform_backend_enum.h" // IWYU pragma: export
19
20namespace blender {
21
22/* GPU platform support */
23
24/* GPU Types */
36
38
40 GPU_OS_WIN = (1 << 8),
41 GPU_OS_MAC = (1 << 9),
42 GPU_OS_UNIX = (1 << 10),
43 GPU_OS_ANY = (0xff00),
44};
45
50 GPU_DRIVER_ANY = (0xff0000),
51};
52
58
60 /* Immediate Mode Renderer (IMR).
61 * Typically, an IMR architecture will execute GPU work in sequence, rasterizing primitives in
62 * order. */
64
65 /* Tile-Based-Deferred-Renderer (TBDR).
66 * A TBDR architecture will typically execute the vertex stage up-front for all primitives,
67 * binning geometry into distinct tiled regions. Fragments will then be rasterized within
68 * the bounds of one tile at a time. */
70};
71
72struct GPUDevice {
73 std::string identifier;
74 int index;
77 std::string name;
78};
79
80/* GPU Types */
81/* TODO: Verify all use-cases of GPU_type_matches to determine which graphics API it should apply
82 * to, and replace with `GPU_type_matches_ex` where appropriate. */
85 GPUOSType os,
86 GPUDriverType driver,
87 GPUBackendType backend);
88
90const char *GPU_platform_vendor();
91const char *GPU_platform_renderer();
92const char *GPU_platform_version();
94const char *GPU_platform_gpu_name();
97
98/* The UUID of the device. Can be an empty array, since it is not supported on all platforms. */
100/* The LUID of the device. Can be an empty array, since it is not supported on all platforms. */
102/* A bit field with the nth bit active identifying the nth device with the same LUID. Only matters
103 * if LUID is defined. */
105
106/* Intel GPU architecture. */
115
117
118} // namespace blender
#define ENUM_OPERATORS(_enum_type)
BMesh Iterators.
uint32_t GPU_platform_luid_node_mask()
bool GPU_type_matches_ex(GPUDeviceType device, GPUOSType os, GPUDriverType driver, GPUBackendType backend)
const char * GPU_platform_version()
Span< GPUDevice > GPU_platform_devices_list()
const char * GPU_platform_gpu_name()
@ GPU_DRIVER_OFFICIAL
@ GPU_DRIVER_SOFTWARE
@ GPU_DRIVER_OPENSOURCE
@ GPU_SUPPORT_LEVEL_UNSUPPORTED
@ GPU_SUPPORT_LEVEL_LIMITED
@ GPU_SUPPORT_LEVEL_SUPPORTED
GPUSupportLevel GPU_platform_support_level()
unsigned int uint32_t
Definition BKE_text.h:81
bool GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver)
Span< uint8_t > GPU_platform_luid()
const char * GPU_platform_renderer()
@ GPU_ARCHITECTURE_TBDR
@ GPU_ARCHITECTURE_IMR
GPUArchitectureType GPU_platform_architecture()
GPUIntelGpuArch GPU_platform_get_intel_arch(uint32_t device_id)
const char * GPU_platform_vendor()
const char * GPU_platform_support_level_key()
Span< uint8_t > GPU_platform_uuid()
@ GPU_DEVICE_QUALCOMM
@ GPU_DEVICE_SOFTWARE
@ GPU_DEVICE_INTEL_UHD
@ GPU_DEVICE_UNKNOWN
@ GPU_DEVICE_INTEL
@ GPU_DEVICE_NVIDIA
@ GPU_DEVICE_APPLE
std::string identifier