2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
2023-02-22 10:16:42 +01:00
|
|
|
* Copyright 2020 Blender Foundation */
|
2020-09-07 15:39:47 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "GPU_platform.h"
|
|
|
|
|
|
|
|
|
|
namespace blender::gpu {
|
|
|
|
|
|
|
|
|
|
class GPUPlatformGlobal {
|
|
|
|
|
public:
|
|
|
|
|
bool initialized = false;
|
|
|
|
|
eGPUDeviceType device;
|
|
|
|
|
eGPUOSType os;
|
|
|
|
|
eGPUDriverType driver;
|
|
|
|
|
eGPUSupportLevel support_level;
|
2021-05-14 11:15:00 -03:00
|
|
|
char *vendor = nullptr;
|
|
|
|
|
char *renderer = nullptr;
|
|
|
|
|
char *version = nullptr;
|
2020-09-07 15:39:47 +02:00
|
|
|
char *support_key = nullptr;
|
|
|
|
|
char *gpu_name = nullptr;
|
2022-03-22 12:38:28 +01:00
|
|
|
eGPUBackendType backend = GPU_BACKEND_NONE;
|
2020-09-07 15:39:47 +02:00
|
|
|
|
|
|
|
|
public:
|
2021-05-14 11:15:00 -03:00
|
|
|
void init(eGPUDeviceType gpu_device,
|
|
|
|
|
eGPUOSType os_type,
|
|
|
|
|
eGPUDriverType driver_type,
|
|
|
|
|
eGPUSupportLevel gpu_support_level,
|
2022-03-22 12:38:28 +01:00
|
|
|
eGPUBackendType backend,
|
2021-05-14 11:15:00 -03:00
|
|
|
const char *vendor_str,
|
|
|
|
|
const char *renderer_str,
|
|
|
|
|
const char *version_str);
|
2020-09-07 15:39:47 +02:00
|
|
|
|
2022-01-05 21:44:03 -05:00
|
|
|
void clear();
|
2020-09-07 15:39:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern GPUPlatformGlobal GPG;
|
|
|
|
|
|
2020-10-02 09:48:41 +10:00
|
|
|
} // namespace blender::gpu
|