NkCGXDetect.h Détection GPU, APIs graphiques et calcul (CUDA/OpenCL/Vulkan/Metal/etc.)
Inclure
#include "NKPlatform/NkCGXDetect.h"
Espace de noms
nkentseu::graphics
Lier (Jenga)
nkentseudependson(["NKPlatform"])
Types Fonctions · 6 ToStringConvertit une enum NkGraphicsApi en chaîne de caractères ToStringConvertit une enum NkGPUVendor en chaîne de caractères ToStringConvertit une enum NkGPUType en chaîne de caractères IsAPIAvailableVérifie à la compilation si une API graphique est disponible GetDefaultAPIObtient l'API graphique par défaut recommandée pour la plateforme GetModernAPIObtient l'API graphique la plus moderne disponible sur la plateforme
Macros · 65 Détail des membres NKENTSEU_GRAPHICS_D3D11_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_D3D11_AVAILABLE
Direct3D 11 disponible sur Windows
NKENTSEU_GRAPHICS_D3D12_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_D3D12_AVAILABLE
Direct3D 12 disponible sur Windows 10+
NKENTSEU_GRAPHICS_OPENGL_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_OPENGL_AVAILABLE
OpenGL disponible sur Windows
NKENTSEU_GRAPHICS_VULKAN_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_VULKAN_AVAILABLE
Vulkan disponible sur Windows
NKENTSEU_GRAPHICS_OPENGL_DEPRECATED # macro
#define NKENTSEU_GRAPHICS_OPENGL_DEPRECATED
NKENTSEU_GRAPHICS_VULKAN_VIA_MOLTENVK # macro
#define NKENTSEU_GRAPHICS_VULKAN_VIA_MOLTENVK
NKENTSEU_GRAPHICS_GLES3_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_GLES3_AVAILABLE
NKENTSEU_GRAPHICS_WEBGL2_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_WEBGL2_AVAILABLE
WebGL 2.0 disponible via Emscripten
NKENTSEU_GRAPHICS_WEBGPU_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_WEBGPU_AVAILABLE
WebGPU disponible (support expérimental)
NKENTSEU_GRAPHICS_GNM_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_GNM_AVAILABLE
GNM (API Sony) disponible sur PS5
NKENTSEU_GRAPHICS_NVN_AVAILABLE # macro
#define NKENTSEU_GRAPHICS_NVN_AVAILABLE
NVN (API NVIDIA) disponible sur Nintendo Switch
ToString # fonction générique (template)
template <typename CharT = char > inline constexpr const CharT *ToString (NkGraphicsApi api) noexcept
Convertit une enum NkGraphicsApi en chaîne de caractères
Paramètres Nom Type Rôle Défaut apiNkGraphicsApiL'API graphique à convertir
Retour Pointeur vers chaîne statique représentant l'API
Note Retourne "Unknown" pour les valeurs hors plage
ToString # fonction générique (template)
template <typename CharT = char > inline constexpr const CharT *ToString (NkGPUVendor vendor) noexcept
Convertit une enum NkGPUVendor en chaîne de caractères
Paramètres Nom Type Rôle Défaut vendorNkGPUVendorLe fabricant de GPU à convertir
Retour Pointeur vers chaîne statique représentant le vendor
Note Retourne "Unknown" pour NK_UNKNOWN ou valeurs invalides
ToString # fonction générique (template)
template <typename CharT = char > inline constexpr const CharT *ToString (NkGPUType type) noexcept
Convertit une enum NkGPUType en chaîne de caractères
Paramètres Nom Type Rôle Défaut typeNkGPUTypeLe type de GPU à convertir
Retour Pointeur vers chaîne statique représentant le type
IsAPIAvailable # fonction générique (template)
template <NkGraphicsApi API> inline constexpr bool IsAPIAvailable () noexcept
Vérifie à la compilation si une API graphique est disponible
Retour true si l'API est disponible sur la plateforme cible, false sinon
Note Évaluation constexpr : résultat connu à la compilation
@code fragment, non compilé
// Sélection compile-time du backend
template <nkentseu::platform::graphics::NkGraphicsApi API>
void CreateRenderer () {
static_assert (
nkentseu::platform::graphics::IsAPIAvailable<API>(),
"Selected graphics API not available on this platform"
);
// ... initialisation spécifique à l'API
}GetDefaultAPI # fonction générique (template)
template <typename = void > inline constexpr NkGraphicsApi GetDefaultAPI () noexcept
Obtient l'API graphique par défaut recommandée pour la plateforme
Retour L'API graphique recommandée comme premier choix
Note Basé sur NKENTSEU_GRAPHICS_DEFAULT défini plus bas dans ce fichier
GetModernAPI # fonction générique (template)
template <typename = void > inline constexpr NkGraphicsApi GetModernAPI () noexcept
Obtient l'API graphique la plus moderne disponible sur la plateforme
Retour L'API graphique la plus récente supportée
Note Utile pour les applications voulant utiliser les dernières features
NKENTSEU_GRAPHICS_DEFAULT # macro
#define NKENTSEU_GRAPHICS_DEFAULT
NKENTSEU_GRAPHICS_MODERN # macro
#define NKENTSEU_GRAPHICS_MODERN
NKENTSEU_D3D11_ONLY # macro
#define NKENTSEU_D3D11_ONLY (...)
#define NKENTSEU_NOT_D3D11 (...)
NKENTSEU_D3D12_ONLY # macro
#define NKENTSEU_D3D12_ONLY (...)
#define NKENTSEU_NOT_D3D12 (...)
NKENTSEU_VULKAN_ONLY # macro
#define NKENTSEU_VULKAN_ONLY (...)
NKENTSEU_NOT_VULKAN # macro
#define NKENTSEU_NOT_VULKAN (...)
NKENTSEU_OPENGL_ONLY # macro
#define NKENTSEU_OPENGL_ONLY (...)
NKENTSEU_NOT_OPENGL # macro
#define NKENTSEU_NOT_OPENGL (...)
#define NKENTSEU_GLES_ONLY (...)
#define NKENTSEU_NOT_GLES (...)
NKENTSEU_WEBGL_ONLY # macro
#define NKENTSEU_WEBGL_ONLY (...)
#define NKENTSEU_NOT_WEBGL (...)
NKENTSEU_WEBGPU_ONLY # macro
#define NKENTSEU_WEBGPU_ONLY (...)
NKENTSEU_NOT_WEBGPU # macro
#define NKENTSEU_NOT_WEBGPU (...)
#define NKENTSEU_GNM_ONLY (...)
#define NKENTSEU_NOT_GNM (...)
#define NKENTSEU_NVN_ONLY (...)
#define NKENTSEU_NOT_NVN (...)
NKENTSEU_COMPUTE_CUDA_AVAILABLE # macro
#define NKENTSEU_COMPUTE_CUDA_AVAILABLE
CUDA Compiler detected - NVIDIA CUDA available
NKENTSEU_COMPUTE_AVAILABLE # macro
#define NKENTSEU_COMPUTE_AVAILABLE
NKENTSEU_COMPUTE_OPENCL_AVAILABLE # macro
#define NKENTSEU_COMPUTE_OPENCL_AVAILABLE
OpenCL C version macro detected - OpenCL available
NKENTSEU_COMPUTE_SYCL_AVAILABLE # macro
#define NKENTSEU_COMPUTE_SYCL_AVAILABLE
SYCL language macros detected - SYCL available
#define NKENTSEU_CUDA_ONLY (...)
#define NKENTSEU_NOT_CUDA (...)
NKENTSEU_OPENCL_ONLY # macro
#define NKENTSEU_OPENCL_ONLY (...)
NKENTSEU_NOT_OPENCL # macro
#define NKENTSEU_NOT_OPENCL (...)
#define NKENTSEU_SYCL_ONLY (...)
#define NKENTSEU_NOT_SYCL (...)
NKENTSEU_DISPLAY_WAYLAND # macro
#define NKENTSEU_DISPLAY_WAYLAND
Wayland display server detected
NKENTSEU_DISPLAY_XCB # macro
#define NKENTSEU_DISPLAY_XCB
XCB (X C Binding) detected - low-level X11 interface
NKENTSEU_DISPLAY_XLIB # macro
#define NKENTSEU_DISPLAY_XLIB
Xlib detected - traditional X11 interface
NKENTSEU_GPU_VENDOR_NVIDIA_ID # macro
#define NKENTSEU_GPU_VENDOR_NVIDIA_ID
NKENTSEU_GPU_VENDOR_AMD_ID # macro
#define NKENTSEU_GPU_VENDOR_AMD_ID
NKENTSEU_GPU_VENDOR_INTEL_ID # macro
#define NKENTSEU_GPU_VENDOR_INTEL_ID
NKENTSEU_GPU_VENDOR_ARM_ID # macro
#define NKENTSEU_GPU_VENDOR_ARM_ID
NKENTSEU_GPU_VENDOR_QUALCOMM_ID # macro
#define NKENTSEU_GPU_VENDOR_QUALCOMM_ID
NKENTSEU_GPU_VENDOR_APPLE_ID # macro
#define NKENTSEU_GPU_VENDOR_APPLE_ID
NKENTSEU_GPU_VENDOR_IMGTEC_ID # macro
#define NKENTSEU_GPU_VENDOR_IMGTEC_ID
Imagination Technologies (PowerVR)
NKENTSEU_GPU_VENDOR_MICROSOFT_ID # macro
#define NKENTSEU_GPU_VENDOR_MICROSOFT_ID
Microsoft (WARP software renderer)
#define NKENTSEU_GFX_NONE
Aucune API (état invalide)
NKENTSEU_GFX_VULKAN # macro
#define NKENTSEU_GFX_VULKAN
NKENTSEU_GFX_DIRECTX # macro
#define NKENTSEU_GFX_DIRECTX
NKENTSEU_GFX_OPENGL # macro
#define NKENTSEU_GFX_OPENGL
NKENTSEU_GFX_SOFTWARE # macro
#define NKENTSEU_GFX_SOFTWARE
Renderer logiciel (fallback)
NKENTSEU_GFX_VERSION_CALC # macro
#define NKENTSEU_GFX_VERSION_CALC (major, minor)
Encode une version (major, minor) en entier 32 bits
Retour Valeur encodée : (major << 16) | minor
NKENTSEU_GFX_ACTIVE # macro
#define NKENTSEU_GFX_ACTIVE
NKENTSEU_GFX_VERSION # macro
#define NKENTSEU_GFX_VERSION
© Rihen Générée par jenga docs depuis l'étiquette v0.1.0-beta.11 Cette page en Markdown Signaler un problème