mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Add a macro to validate a vendor value
This commit is contained in:
@ -92,8 +92,7 @@ int game_mode_initialise_gpu(GameModeConfig *config, GameModeGPUInfo **info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* verify GPU vendor */
|
/* verify GPU vendor */
|
||||||
if (!(new_info->vendor == Vendor_NVIDIA || new_info->vendor == Vendor_AMD ||
|
if (!GPUVendorValid(new_info->vendor)) {
|
||||||
new_info->vendor == Vendor_Intel)) {
|
|
||||||
LOG_ERROR(
|
LOG_ERROR(
|
||||||
"ERROR: Invalid gpu_vendor value (0x%04x) set in configuration, will not apply "
|
"ERROR: Invalid gpu_vendor value (0x%04x) set in configuration, will not apply "
|
||||||
"optimisations!\n",
|
"optimisations!\n",
|
||||||
|
@ -39,6 +39,9 @@ enum GPUVendor {
|
|||||||
Vendor_Intel = 0x8086
|
Vendor_Intel = 0x8086
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define GPUVendorValid(vendor) \
|
||||||
|
(vendor == Vendor_NVIDIA || vendor == Vendor_AMD || vendor == Vendor_Intel)
|
||||||
|
|
||||||
/* Storage for GPU info*/
|
/* Storage for GPU info*/
|
||||||
struct GameModeGPUInfo {
|
struct GameModeGPUInfo {
|
||||||
long vendor;
|
long vendor;
|
||||||
|
Reference in New Issue
Block a user