From a4216507d65dfde1410869177e20dd3b873c620a Mon Sep 17 00:00:00 2001 From: nastys Date: Wed, 8 Jan 2025 20:18:47 +0100 Subject: [PATCH] [ShaderPatch] GB = NVIDIA Blackwell --- source-code/data/plugins/ShaderPatch.ini | 8 ++++---- source-code/data/plugins/config_template.bin | 2 +- source-code/dependencies/GPUModel/GPUModel.h | 5 ++++- source-code/source/plugins/Launcher/framework.h | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source-code/data/plugins/ShaderPatch.ini b/source-code/data/plugins/ShaderPatch.ini index e83537e..eb11f27 100644 --- a/source-code/data/plugins/ShaderPatch.ini +++ b/source-code/data/plugins/ShaderPatch.ini @@ -37,13 +37,13 @@ Toon_Lines_Improve_Val3=0.75 [Patches] # Compatibility patches: # Star Story (and etc.) stage corruption (Maxwell+) -blinn_per_vert\.0010010[23]00[01]\.fp=arch:AD,GA,GV,TU,GP,GM||cfg:compat||from:TEX tex_col, a_tex_color0, texture\[0\], 2D; ALIAS||to:TEX tex_col, a_tex_color0, texture[0], 2D; MUL tex_col, 1, tex_col; ALIAS +blinn_per_vert\.0010010[23]00[01]\.fp=arch:GB,AD,GA,GV,TU,GP,GM||cfg:compat||from:TEX tex_col, a_tex_color0, texture\[0\], 2D; ALIAS||to:TEX tex_col, a_tex_color0, texture[0], 2D; MUL tex_col, 1, tex_col; ALIAS # Turing shading lines (new patch by samyuu, hopefully ported to here correctly) -.*=arch:AD,GA,GV,TU||cfg:compat||from:SHORT ||to: +.*=arch:GB,AD,GA,GV,TU||cfg:compat||from:SHORT ||to: # Turing NPR cloth noise -cloth_npr1.*=arch:AD,GA,GV,TU||cfg:compat||from:SSG _tmp0.yw, ybr.xxzz;||to:TEMP _tmpForSSG; SGE _tmpForSSG.xz, ybr.xxzz, 0; SUB _tmpForSSG.xz, _tmpForSSG.xxzz, 1; SGT _tmpForSSG.yw, ybr.xxzz, 0; ADD _tmp0.yw, _tmpForSSG.xxzz, _tmpForSSG.yyww; +cloth_npr1.*=arch:GB,AD,GA,GV,TU||cfg:compat||from:SSG _tmp0.yw, ybr.xxzz;||to:TEMP _tmpForSSG; SGE _tmpForSSG.xz, ybr.xxzz, 0; SUB _tmpForSSG.xz, _tmpForSSG.xxzz, 1; SGT _tmpForSSG.yw, ybr.xxzz, 0; ADD _tmp0.yw, _tmpForSSG.xxzz, _tmpForSSG.yyww; # Turing auto-exposure fix by samyuu -stage_blinn.*\.fp=arch:AD,GA,GV,TU||cfg:compat||from:NRMH normal, a_normal;||to:NRM normal, a_normal; +stage_blinn.*\.fp=arch:GB,AD,GA,GV,TU||cfg:compat||from:NRMH normal, a_normal;||to:NRM normal, a_normal; # Lyb's toon shader improvements: cloth_npr1.*=cfg:toon_improve||from:MAD tmp.y, lc.z, 1.2, -0.5;||to:MAD tmp.y, lc.z, , ; diff --git a/source-code/data/plugins/config_template.bin b/source-code/data/plugins/config_template.bin index 7df3d38..bf1f8ce 100644 --- a/source-code/data/plugins/config_template.bin +++ b/source-code/data/plugins/config_template.bin @@ -7,7 +7,7 @@ Enable=1 [GPU] -# Force GPU model -- -1=auto, 0=Kepler, 1=Maxwell/Pascal, 2=Turing, 3=Ampere, 4=Ada Lovelace +# Force GPU model -- -1=auto, 0=Kepler, 1=Maxwell/Pascal, 2=Turing, 3=Ampere, 4=Ada Lovelace, 5=Blackwell Model=-1 [Launcher] diff --git a/source-code/dependencies/GPUModel/GPUModel.h b/source-code/dependencies/GPUModel/GPUModel.h index 5cf3772..5024f23 100644 --- a/source-code/dependencies/GPUModel/GPUModel.h +++ b/source-code/dependencies/GPUModel/GPUModel.h @@ -34,7 +34,7 @@ namespace GPUModel // note that the used GL context may differ std::string getGpuName() { - // detected model can be overridden -- 0: Kepler, 1: Maxwell, 2: Turing, 3: Ampere, 4: Ada Lovelace + // detected model can be overridden -- 0: Kepler, 1: Maxwell, 2: Turing, 3: Ampere, 4: Ada Lovelace, 5: Blackwell int nGPUModel = GetPrivateProfileIntW(L"gpu", L"model", -1, CONFIG_FILE); if (nGPUModel >= 0 && nGPUModel <= 4) { @@ -56,6 +56,9 @@ namespace GPUModel case 4: arch = "AD000"; break; + case 5: + arch = "GB000"; + break; } printf("[GPUModel] GPU Model override: %s\n", arch.c_str()); diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 018a07c..ef5c195 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -166,7 +166,7 @@ ConfigOptionBase* internalResolutionArray[] = { }; ConfigOptionBase* graphicsArray[] = { - new DropdownOption(L"model", L"GPU", CONFIG_FILE, L"Nvidia GPU:", L"Select your Nvidia GPU's architecture to apply the necessary workarounds.\n\nNOTE: Automatic detection does not currently work on GNU/Linux.", -1, std::vector({ L"Automatic", L"Kepler", L"Maxwell/Pascal", L"Turing", L"Ampere", L"Ada or newer"}), -1), + new DropdownOption(L"model", L"GPU", CONFIG_FILE, L"Nvidia GPU:", L"Select your Nvidia GPU's architecture to apply the necessary workarounds.\n\nNOTE: Automatic detection does not currently work on GNU/Linux.", -1, std::vector({ L"Automatic", L"Kepler", L"Maxwell/Pascal", L"Turing", L"Ampere", L"Ada Lovelace", L"Blackwell or newer"}), -1), new BooleanOption(L"TAA", GRAPHICS_SECTION, CONFIG_FILE, L"TAA", L"Temporal Anti-Aliasing", true, false), new BooleanOption(L"MLAA", GRAPHICS_SECTION, CONFIG_FILE, L"MLAA", L"Morphological Anti-Aliasing", true, false), new DropdownOption(L"MAG", GRAPHICS_SECTION, CONFIG_FILE, L"Filter:", L"Image filter.\n\nBilinear: default filter\nNearest-neighbour: sharpest, but blocky\nSharpen: sharp filter\nCone: smooth filter", 0, std::vector({ L"Bilinear", L"Nearest-neighbour", L"Sharpen", L"Cone" })),