physical device retrieval functions

This commit is contained in:
Gregory Wells
2025-09-10 13:46:49 -04:00
parent a446d6e75f
commit ef53ffd458
2 changed files with 14 additions and 5 deletions

View File

@@ -3,9 +3,13 @@
#include "utils/gryphn_string.h" #include "utils/gryphn_string.h"
#include "gryphn_handles.h" #include "gryphn_handles.h"
typedef enum gnDeviceType { typedef enum gnPhysicalDeviceType {
GN_DEDICATED_DEVICE, GN_INTEGRATED_DEVICE, GN_EXTERNAL_DEVICE GN_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU,
} gnDeviceType; GN_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU,
GN_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU,
GN_PHYSICAL_DEVICE_TYPE_FAKED_GPU,
GN_PHYSICAL_DEVICE_TYPE_CPU,
} gnPhysicalDeviceType;
typedef enum gnMultisampleCountFlags { typedef enum gnMultisampleCountFlags {
GN_SAMPLE_BIT_1 = 1 << 0, // 0x01 GN_SAMPLE_BIT_1 = 1 << 0, // 0x01
@@ -18,8 +22,10 @@ typedef enum gnMultisampleCountFlags {
} gnMultisampleCountFlags; } gnMultisampleCountFlags;
typedef struct gnPhysicalDeviceProperties { typedef struct gnPhysicalDeviceProperties {
gnString name; uint32_t driverVersion;
gnDeviceType deviceType; uint32_t deviceID;
gnString deviceName;
gnPhysicalDeviceType deviceType;
} gnPhysicalDeviceProperties; } gnPhysicalDeviceProperties;
typedef struct gnPhysicalDeviceFeatures { typedef struct gnPhysicalDeviceFeatures {

View File

@@ -9,6 +9,7 @@ typedef struct gnInstanceCreateInfo gnInstanceCreateInfo;
typedef struct gnSurfaceDetails gnSurfaceDetails; typedef struct gnSurfaceDetails gnSurfaceDetails;
typedef struct gnOutputDeviceInfo gnOutputDeviceInfo; typedef struct gnOutputDeviceInfo gnOutputDeviceInfo;
typedef enum gnSuitableField gnSuitableField; typedef enum gnSuitableField gnSuitableField;
typedef struct gnPhysicalDeviceProperties gnPhysicalDeviceProperties;
#ifdef GN_PLATFORM_LINUX #ifdef GN_PLATFORM_LINUX
#ifdef GN_WINDOW_X11 #ifdef GN_WINDOW_X11
@@ -25,6 +26,8 @@ typedef gnBool (*PFN_gnIsInstanceSuitable)(gnInstanceHandle, gnSuitableField, gr
typedef gnReturnCode (*PFN_gnInstanceQueryDevices)(gnInstanceHandle, uint32_t*, gnPhysicalDeviceHandle*, gryphnInstanceFunctionLayers*); typedef gnReturnCode (*PFN_gnInstanceQueryDevices)(gnInstanceHandle, uint32_t*, gnPhysicalDeviceHandle*, gryphnInstanceFunctionLayers*);
typedef void (*PFN_gnDestroyInstance)(gnInstanceHandle, gryphnInstanceFunctionLayers*, gnAllocators*); typedef void (*PFN_gnDestroyInstance)(gnInstanceHandle, gryphnInstanceFunctionLayers*, gnAllocators*);
typedef gnPhysicalDeviceProperties (*PFN_gnQueryPhysicalDeviceProperties)(gnInstance, gnPhysicalDeviceHandle);
typedef struct gnInstanceFunctions { typedef struct gnInstanceFunctions {
gnBool (*_gnPhysicalDeviceCanPresentToSurface)(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface); gnBool (*_gnPhysicalDeviceCanPresentToSurface)(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);