1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License 4 * as published by the Free Software Foundation; either version 2 5 * of the License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, 8 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * GNU General Public License for more details. 11 * 12 * You should have received a copy of the GNU General Public License 13 * along with this program; if not, write to the Free Software Foundation, 14 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 * 16 * The Original Code is Copyright (C) 2005 Blender Foundation. 17 * All rights reserved. 18 */ 19 20 /** \file 21 * \ingroup gpu 22 */ 23 24 #pragma once 25 26 #include "BLI_sys_types.h" 27 #include "BLI_utildefines.h" 28 29 /* GPU platform support */ 30 31 /* GPU Types */ 32 typedef enum eGPUDeviceType { 33 GPU_DEVICE_NVIDIA = (1 << 0), 34 GPU_DEVICE_ATI = (1 << 1), 35 GPU_DEVICE_INTEL = (1 << 2), 36 GPU_DEVICE_INTEL_UHD = (1 << 3), 37 GPU_DEVICE_SOFTWARE = (1 << 4), 38 GPU_DEVICE_UNKNOWN = (1 << 5), 39 GPU_DEVICE_ANY = (0xff), 40 } eGPUDeviceType; 41 42 ENUM_OPERATORS(eGPUDeviceType, GPU_DEVICE_ANY) 43 44 typedef enum eGPUOSType { 45 GPU_OS_WIN = (1 << 8), 46 GPU_OS_MAC = (1 << 9), 47 GPU_OS_UNIX = (1 << 10), 48 GPU_OS_ANY = (0xff00), 49 } eGPUOSType; 50 51 typedef enum eGPUDriverType { 52 GPU_DRIVER_OFFICIAL = (1 << 16), 53 GPU_DRIVER_OPENSOURCE = (1 << 17), 54 GPU_DRIVER_SOFTWARE = (1 << 18), 55 GPU_DRIVER_ANY = (0xff0000), 56 } eGPUDriverType; 57 58 typedef enum eGPUSupportLevel { 59 GPU_SUPPORT_LEVEL_SUPPORTED, 60 GPU_SUPPORT_LEVEL_LIMITED, 61 GPU_SUPPORT_LEVEL_UNSUPPORTED, 62 } eGPUSupportLevel; 63 64 #ifdef __cplusplus 65 extern "C" { 66 #endif 67 68 bool GPU_type_matches(eGPUDeviceType device, eGPUOSType os, eGPUDriverType driver); 69 eGPUSupportLevel GPU_platform_support_level(void); 70 const char *GPU_platform_support_level_key(void); 71 const char *GPU_platform_gpu_name(void); 72 73 #ifdef __cplusplus 74 } 75 #endif 76