novidia: add nv check so plugin can be enabled by default

This commit is contained in:
somewhatlurker
2020-11-20 12:56:34 +11:00
parent 5a6cece1a6
commit f2510ed6b1
5 changed files with 23 additions and 10 deletions
@@ -1,6 +1,7 @@
#include "framework.h"
#include "glStuff.h"
#include <PluginConfigApi.h>
#include <GPUModel.h>
extern "C" {
// well, only good for 64 bit now, ont that is matters lol
@@ -381,6 +382,17 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
{
loadConfig();
if (!disable_nvidia_check)
{
std::string gpuName = GPUModel::getGpuName();
if (gpuName != "Other" && gpuName != "Unknown")
{
// detected Nvidia GPU
printf("[Novidia] Detected Nvidia GPU! Quitting!\n");
return TRUE;
}
}
DisableThreadLibraryCalls(hModule);
DetourTransactionBegin();
@@ -432,6 +444,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv
using namespace PluginConfig;
PluginConfigOption config[] = {
{ CONFIG_BOOLEAN, new PluginConfigBooleanData{ L"disable_nvidia_check", L"general", CONFIG_FILE, L"Disable Nvidia Check", L"On systems with both AMD and Nvidia graphics, the plugin may disable functionality due to detecting the Nvidia GPU. Set this to forcefully enable functionality.", false, false } },
{ CONFIG_BOOLEAN, new PluginConfigBooleanData{ L"enable_chara_skinning", L"general", CONFIG_FILE, L"Enable Chara Skinning", L"If you really need to get extra performance, you can disable uploading skinning data. (character models will disappear)", true, false } },
{ CONFIG_BOOLEAN, new PluginConfigBooleanData{ L"use_TexSubImage", L"general", CONFIG_FILE, L"Use glTexSubImage", L"glTexSubImage should offer higher performance, but stuttering has been reported when it is used.\nTry disabling this if you have issues.", true, false } },
{ CONFIG_BOOLEAN, new PluginConfigBooleanData{ L"force_BGRA_upload", L"general", CONFIG_FILE, L"Force BGRA Texture Uploads", L"BGRA format uploads seem to run faster (on some hardware), but drivers may suggest RGBA instead.\nUsing this forces uploads to use the BGRA format.\n\nDisabling this may decrease or improve performance.", true, false } },