-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathconfig.h
More file actions
1913 lines (1677 loc) · 66 KB
/
config.h
File metadata and controls
1913 lines (1677 loc) · 66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* This file is part of Special K.
*
* Special K is free software : you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by The Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Special K is distributed in the hope that it will be useful,
*
* But WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Special K.
*
* If not, see <http://www.gnu.org/licenses/>.
*
**/
#ifndef __SK__CONFIG_H__
#define __SK__CONFIG_H__
#include <Unknwnbase.h>
#include <Windows.h>
#include <powerbase.h>
#include <string>
#include <set>
#include <unordered_set>
#include <concurrent_unordered_set.h>
#include <concurrent_unordered_map.h>
#include <filesystem>
#include <intsafe.h>
#include <SpecialK/diagnostics/cpu.h>
#include <SpecialK/render/backend.h>
#include <SpecialK/window.h>
#include <SpecialK/core.h>
static constexpr int SK_NoPreference = -1;
static constexpr int SK_Disabled = 0;
static constexpr int SK_Enabled = 1;
enum {
SK_HDR_CLIPBOARD_FORMAT_PNG = 1,
SK_HDR_CLIPBOARD_FORMAT_AVIF = 2,
};
struct SK_Keybind
{
const char* bind_name = nullptr;
std::wstring human_readable = L"";
struct {
BOOL ctrl = FALSE,
shift = FALSE,
alt = FALSE;
};
SHORT vKey = 0;
UINT masked_code = 0x0; // For fast comparison
void parse (void);
void update (void);
};
namespace sk
{
class ParameterStringW;
};
void SK_ImGui_BeginKeybindEditorFrame (void);
ULONG64 SK_ImGui_GetLastKeybindEditorFrame (void);
// Adds a parameter to store and retrieve the keybind in an INI / XML file
struct SK_ConfigSerializedKeybind : public SK_Keybind
{
SK_ConfigSerializedKeybind ( SK_Keybind&& bind,
const wchar_t* cfg_name) :
SK_Keybind (bind)
{
if (cfg_name != nullptr)
{
wcsncpy_s ( short_name, 32,
cfg_name, _TRUNCATE );
}
}
bool assigning = false;
wchar_t short_name [32] = L"Uninitialized";
sk::ParameterStringW* param = nullptr;
};
namespace skif
{
enum class AutoStopBehavior {
Never = 0,
AtStart = 1,
AtExit = 2
};
}
enum SK_FrametimeMethod
{
SK_FrametimeMeasures_LimiterPacing = 0,
SK_FrametimeMeasures_PresentSubmit = 1,
SK_FrametimeMeasures_NewFrameBegin = 2
};
struct sk_config_t
{
sk_config_t (void)
{
// This struct is one of the earliest non-static initalized
// parts of the DLL, so important early init is best performed
// in the constructor of sk_config_t
//
LARGE_INTEGER liQpcFreq = { };
QueryPerformanceFrequency (&liQpcFreq);
SK_QpcFreq = liQpcFreq.QuadPart;
SK_QpcTicksPerMs = SK_QpcFreq / 1000LL;
SK_PerfFreq = SK_QpcFreq;
PROCESSOR_POWER_INFORMATION pwi [64] = { };
int cpuid [ 4] = { }; // Store eax,ebx,ecx,edx
// Setup TSC-based timing instead of QPC when applicable
// (i.e. CPU has invariant timestamps)
if ( 0x0 ==
CallNtPowerInformation (ProcessorInformation, nullptr, 0, pwi, sizeof (pwi)) )
{
ZeroMemory (cpuid, sizeof (int) * 4);
#ifndef SK_BUILT_BY_CLANG
__cpuid (cpuid, 0x80000007);
#else
__llvm_cpuid (0x80000007, cpuid [0], cpuid [1],
cpuid [1], cpuid [2]);
#endif
SK_TscFreq =
(1000LL * 1000LL * static_cast <int64_t> (pwi [0].MaxMhz));
SK_QpcFreqInTsc = (DWORD)(SK_TscFreq / SK_QpcFreq);
SK_TscInvariant = false;
//(cpuid [3] & (1 << 8)) != 0;
SK_PerfFreqInTsc = 1;
// Using Tsc instead of QPC was experimented with a few years ago (~2023),
// but it broke Latent Sync at the time... it may be worth revisiting.
#if 0
if (SK_TscInvariant)
SK_PerfFreq = SK_TscFreq;
else
#endif
SK_PerfFreqInTsc = SK_QpcFreqInTsc;
}
// Determine number of CPU cores total, and then the subset of those
// cores that the process is allowed to run threads on.
SYSTEM_INFO si = { };
SK_GetSystemInfo (&si);
DWORD cpu_pop = std::max (1UL, si.dwNumberOfProcessors);
DWORD_PTR process_affinity = 0,
system_affinity = 0;
if (GetProcessAffinityMask (GetCurrentProcess (), &process_affinity,
&system_affinity))
{
cpu_pop = 0;
for ( DWORD_PTR i = 0 ; i < (DWORD_PTR)SK_GetBitness () ; ++i )
{
if ((process_affinity >> i) & 0x1)
++cpu_pop;
}
}
priority.available_cpu_cores =
std::max (1UL, std::min (cpu_pop, si.dwNumberOfProcessors));
screenshots.avif.max_threads =
std::max (2, static_cast <int> (priority.available_cpu_cores) / 3);
ZeroMemory (cpuid, sizeof (int) * 4);
#ifndef SK_BUILT_BY_CLANG
__cpuid (cpuid, 0x80000001);
#else
__llvm_cpuid (0x80000001, cpuid [0], cpuid [1],
cpuid [1], cpuid [2]);
#endif
// MWAITX = ECX Bit 29 (8000_0001h)
SK_CPU_HasMWAITX = (cpuid [2] & (1 << 28)) != 0;
if (! SK_CPU_HasMWAITX)
SK_CPU_HasMWAITX =
SK_CPU_TestForMWAITX ();
SK_PerfTicksPerMs = SK_PerfFreq / 1000LL;
if (! SK_GetHostAppUtil ()->isBlacklisted ())
{
utility.hSignalAsyncSave =
SK_CreateEvent (nullptr, FALSE, FALSE, nullptr);
}
}
struct whats_new_s {
float duration = 20.0F;
} version_banner;
struct time_osd_s {
LONG format = LOCALE_USER_DEFAULT;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'T', 0 };
} keys;
bool show = true;
} time;
struct title_s {
bool show = true;
} title;
struct mem_osd_s {
float reserve = 0.0F;// Unused / Unlimited
float interval = 0.25F;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'M', 0 };
} keys;
bool show = false;
} mem;
struct io_osd_s {
float interval = 0.25F; // 250 msecs (4 Hz)
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'I', 0 };
} keys;
bool show = false;
} io;
struct sli_s {
bool show = false;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'S', 0 };
} keys;
} sli;
struct basic_osd_s {
int red = MAXDWORD32;
int green = MAXDWORD32;
int blue = MAXDWORD32;
float scale = 1.0F;
int pos_x = 0;
int pos_y = 0;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'O', 0 };
BYTE shrink [4] = { VK_CONTROL, VK_SHIFT, VK_OEM_MINUS, 0 };
BYTE expand [4] = { VK_CONTROL, VK_SHIFT, VK_OEM_PLUS, 0 };
SK_ConfigSerializedKeybind
console_toggle = {
SK_Keybind {
"Toggle SK's Command Console", L"Ctrl+Shift+Tab",
true, true, false, VK_TAB
}, L"ConsoleToggle"
};
} keys;
bool remember_state = false;
bool show = false;
} osd;
struct cpu_osd_s {
GUID power_scheme_guid = { };
GUID power_scheme_guid_orig = { };
float interval = 0.33333333f;
bool simple = true;
bool show = false;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'C', 0 };
} keys;
} cpu;
struct fps_osd_s {
bool show = true;
bool compact = false;
bool advanced = false;
bool frametime = true;
bool framenumber = false;
bool compact_vrr = false;
int timing_method = SK_FrametimeMeasures_LimiterPacing;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'F', 0 };
} keys;
//float fps_interval = 1.0F;
} fps;
struct gpu_osd_s {
bool show = true;
bool print_slowdown = false;
float interval = 0.333333F;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_SHIFT, 'G', 0 };
} keys;
} gpu;
struct disk_osd_s {
bool show = false;
float interval = 0.333333F;
int type = 0; // Physical = 0,
// Logical = 1
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_MENU, VK_SHIFT, 'D' };
} keys;
} disk;
struct pagefile_osd_s {
bool show = false;
float interval = 2.5F;
struct keybinds_s {
BYTE toggle [4] = { VK_CONTROL, VK_MENU, VK_SHIFT, 'P' };
} keys;
} pagefile;
struct dlss_osd_s {
bool show = false;
bool show_output_res = false;
bool show_quality = true;
bool show_fg = true;
bool show_preset = false;
struct keybinds_s {
BYTE toggle [4] = { VK_MENU, VK_SHIFT, 'D', 0 };
} keys;
} dlss;
struct cegui_s {
ULONG frames_drawn = 0; // Count the number of frames drawn using it
bool enable = true;
bool orig_enable = false; // Since CEGUI is a frequent source of crashes.
bool safe_init = true;
} cegui;
struct imgui_s {
float scale = 1.0F;
bool show_eula = false; // Will be flipped on if no AppCache is present
bool show_input_apis = true;
bool use_mac_style_menu = false;
struct font_s {
struct font_params_s {
std::string file = "";
float size = 7.0F;
} chinese { "msyh.ttc", 18.0f },
cyrillic { "arial.ttf", 18.0f },
default_font { "arial.ttf", 18.0f },
japanese { "msgothic.ttc", 18.0f },
korean { "malgun.ttf", 18.0f };
} font;
// Per-game (mostly compatibility) settings
struct render_s
{
bool strip_alpha = false; // Alpha is forcefully stripped
bool disable_alpha = false; // Window backgrounds are opaque
bool antialias_lines = true;
bool antialias_contours = true;
} render;
} imgui;
struct notifications_s
{
int location = 2; // 0=Top-Left,
// 1=Top-Right,
// 2=Bottom-Left,
// 3=Bottom-Right,
// 4=Don't Care
bool silent = false;
} notifications;
struct steam_s {
struct callback_cache_s {
HMODULE
module = nullptr;
uintptr_t
offset = 0;
void* resolved = nullptr;
} cached_overlay_callback;
struct cloud_s {
std::set <std::string> blacklist;
} cloud;
std::wstring
dll_path = L"";
int64_t appid = 0LL;
int online_status = SK_NoPreference;
// Force a certain online status at all times
int init_delay = 0UL; // Disable to prevent crashing in many games
int callback_throttle = SK_NoPreference;
bool preload_client = false;
bool preload_overlay = false; // For input processing, this is important
bool force_load_steamapi = false; // Load steam_api{64}.dll even in games
bool auto_pump_callbacks = true;
bool block_stat_callback = false;
bool filter_stat_callback = false;
bool spoof_BLoggedOn = false;
bool auto_inject = true; // Control implicit steam_api.dll bootstrapping
bool disable_overlay = false; // Sets an Env. Var to prevent drawing
bool crapcom_mode = false; // Workaround for CAPCOM DRM
struct screenshot_handler_s {
bool enable_hook = true;
} screenshots;
} steam;
struct platform_s {
struct achievements_s {
std::wstring
sound_file = L"";
struct popup_s {
float inset = 0.005F;
int origin = 0;
int duration = 5000UL;
bool show = true;
bool show_title = true;
bool animate = true;
int max_columns = 2;
int max_on_screen = 5;
} popup;
bool take_screenshot = false;
bool play_sound = true;
bool pull_friend_stats = true;
bool pull_global_stats = true; // N/A for EOS
} achievements;
float overlay_hdr_luminance = 4.37F; // 350 nits
// that do not use it
int notify_corner = 4; // 0=Top-Left,
// 1=Top-Right,
// 2=Bottom-Left,
// 3=Bottom-Right,
// 4=Don't Care
bool show_playtime = true; // In the control panel title
bool overlay_hides_sk_osd = true;
bool reuse_overlay_pause = false;// Use Steam's overlay pause mode for our own
// control panel
bool silent = false;
bool steam_is_b0rked = false; // Need to swallow some exceptions or Streamline may crash games
} platform;
struct epic_s {
std::string app_name = "";
float overlay_luminance = 4.375F; // 350 nits
bool present = false; // Is the overlay detected?
bool warned_online = false;
} epic;
struct uplay_s {
float overlay_luminance = 4.375F; // 350 nits
bool present = false; // Is the overlay detected?
} uplay;
struct discord_s {
float overlay_luminance = 4.375F; // 350 nits
bool present = false; // Is the overlay detected?
} discord;
struct rtss_s {
float overlay_luminance = 4.375F; // 350 nits
bool present = false; // Is the overlay detected?
} rtss;
struct reshade_s {
bool draw_first = true;
bool is_addon = false; // True if ReShade AddOn registration succeeded
bool is_addon_hookless = false; // True if ReShade has no hooked effect runtimes
bool has_local_ini = false; // Using local ReShade.ini instead of SK's
bool allow_unsafe_addons = false;
SK_ConfigSerializedKeybind
toggle_overlay_keybind= {
SK_Keybind {
"Toggle ReShade Overlay", L"Shift+Home",
true, false, false, VK_HOME
}, L"ToggleReShadeOverlay"
};
SK_ConfigSerializedKeybind
inject_reshade_keybind = {
SK_Keybind {
"Inject ReShade (6.0+)", L"Ctrl+Alt+Shift+R",
true, true, true, 'R'
}, L"InjectReShade"
};
} reshade;
struct sound_s {
SK_ConfigSerializedKeybind
game_mute_keybind = {
SK_Keybind {
"Mute the Game", L"Ctrl+Shift+Home",
true, true, false, VK_HOME
}, L"MuteGame"
};
SK_ConfigSerializedKeybind
game_volume_up_keybind = {
SK_Keybind {
"Increase Volume 10%", L"Ctrl+Shift+Insert",
true, true, false, VK_INSERT
}, L"VolumePlus10%"
};
SK_ConfigSerializedKeybind
game_volume_down_keybind = {
SK_Keybind {
"Decrease Volume 10%", L"Ctrl+Shift+Delete",
true, true, false, VK_DELETE
}, L"VolumeMinus10%"
};
bool minimize_latency = false;
} sound;
struct screenshots_s {
bool use_avif = false;
bool use_hdr_png = false;
int max_st2084_bits = 11;
bool use_jxl = false;
bool png_compress = true;
bool show_osd_by_default = true;
bool play_sound = true;
bool copy_to_clipboard = true;
bool allow_hdr_clipboard = true;
int clipboard_hdr_format = 1; // 1 = PNG, 2 = AVIF
int snipboard_hdr_format = 0; // 0 = No override
ULONG64 reset_snipboard_frame = 0; // Frame when clipboard overrides reset
bool embed_nickname = false;
std::wstring override_path = L"";
std::wstring filename_format = L"%G %F %T";
struct avif_s {
int scrgb_bit_depth = 10;
int yuv_subsampling = 444;
bool full_range = true;
int compression_speed = 8;
int max_threads = 5;
} avif;
int jpeg_not_quality = 96;
int compression_quality = 90; // For the newer file formats
bool compatibility_mode = true;
SK_ConfigSerializedKeybind
game_hud_free_keybind = {
SK_Keybind {
"Take Screenshot without Game's HUD", L"Num -",
false, false, false, VK_OEM_MINUS
}, L"HUDFree"
};
SK_ConfigSerializedKeybind
sk_osd_free_keybind = {
SK_Keybind {
"Take Screenshot without Special K's OSD", L"F9",
false, false, false, VK_F9
}, L"WithoutOSD"
};
SK_ConfigSerializedKeybind
no_3rd_party_keybind = {
SK_Keybind {
"Take Screenshot without Third-Party Overlays", L"",
false, false, false, 0
}, L"Without3rdParty"
};
SK_ConfigSerializedKeybind
sk_osd_insertion_keybind = {
SK_Keybind {
"Take Screenshot and insert Special K's OSD", L"F8",
false, false, false, VK_F8
}, L"InsertOSD"
};
SK_ConfigSerializedKeybind
clipboard_only_keybind = {
SK_Keybind {
"Copy a Screenshot to Clipboard Only", L"",
false, false, false, VK_PRINT
}, L"ClipboardOnly"
};
SK_ConfigSerializedKeybind
snipping_keybind = {
SK_Keybind {
"Snip a Screenshot to the Clipboard", L"",
true, false, false, VK_PRINT
}, L"Snipping"
};
} screenshots;
struct monitor_s {
SK_ConfigSerializedKeybind
monitor_primary_keybind = {
SK_Keybind {
"Move Game to Primary Monitor", L"<Not Bound>",
false, false, false, 0,
}, L"MoveToPrimaryMonitor"
};
SK_ConfigSerializedKeybind
monitor_next_keybind = {
SK_Keybind {
"Move Game to Next Monitor", L"<Not Bound>",
false, false, false, 0,
}, L"MoveToNextMonitor"
};
SK_ConfigSerializedKeybind
monitor_prev_keybind = {
SK_Keybind {
"Move Game to Previous Monitor", L"<Not Bound>",
false, false, false, 0,
}, L"MoveToPrevMonitor"
};
SK_ConfigSerializedKeybind
monitor_toggle_hdr = {
SK_Keybind {
"Toggle HDR on Active Monitor", L"<Not Bound>",
false, false, false, 0
}, L"ToggleHDR"
};
SK_ConfigSerializedKeybind
multimonitor_focus_keybind = {
SK_Keybind {
"Toggle ADHD Multi-Monitor Mode", L"<Not Bound>",
false, false, false, 0
}, L"ToggleADHDMultiMonitor"
};
} monitors;
struct widget_s {
SK_ConfigSerializedKeybind
hide_all_widgets_keybind = {
SK_Keybind {
"Hide All Widgets", L"Ctrl+Alt+Shift+H",
true, true, true, 'H'
}, L"HideAllWidgets"
};
} widgets;
struct render_s {
struct framerate_s {
float target_fps = 0.0F;
float target_fps_bg = 0.0F;
float last_refresh_rate = 0.0F;
std::wstring
last_monitor_path = L"";
int override_num_cpus = SK_NoPreference;
int pre_render_limit = SK_NoPreference;
int present_interval = SK_NoPreference;
int sync_interval_clamp = SK_NoPreference;
int buffer_count = SK_NoPreference;
int max_delta_time = 0; // Bad old setting; needs to be phased
int swapchain_wait = 0;
float refresh_rate = -1.0F;
std::wstring rescan_ratio =L"-1/1";
struct rescan_s {
UINT Denom = 1;
UINT Numerator =
sk::narrow_cast <UINT> (SK_NoPreference);
} rescan_;
int refresh_denom = 1;
int pin_render_thread = SK_NoPreference;
bool flip_discard = true; // Enabled by default (7/6/21)
bool flip_sequential = false;
bool disable_flip = false;
bool drop_late_flips = true;
bool wait_for_vblank = false;
bool sleepless_render = false;
bool sleepless_window = false;
bool enable_mmcss = true;
bool force_vk_mailbox = false;
bool force_vk_adaptive = false;
int enforcement_policy = 4; // Refer to framerate.cpp
struct {
bool waiting = true; // VRR users have the limiter default to low-latency
bool triggered = false; // The limiter was VRR-optimized once
struct {
bool ultra_low_latency = false; // VRR auto-optimization goes further (potential stutter)
bool global_opt = true; // Opt-In for Auto Low Latency as default policy
bool auto_reapply = true; // Opt-In to have Auto Low Latency re-apply if display / refresh rate changes
} policy;
} auto_low_latency;
bool enable_etw_tracing = true;
bool supports_etw_trace = false;// Not stored in config file
struct latent_sync_s {
SK_ConfigSerializedKeybind
tearline_move_up_keybind = {
SK_Keybind {
"Move Tear Location Up 5 Scanlines", L"<Not Bound>",
false, false, false, 0,
}, L"MoveTearlineUp"
};
SK_ConfigSerializedKeybind
tearline_move_down_keybind = {
SK_Keybind {
"Move Tear Location Down 5 Scanlines", L"<Not Bound>",
false, false, false, 0,
}, L"MoveTearlineDown"
};
SK_ConfigSerializedKeybind
timing_resync_keybind = {
SK_Keybind {
"Force a Timing Resync", L"<Not Bound>",
false, false, false, 0,
}, L"ManualResync"
};
SK_ConfigSerializedKeybind
toggle_fcat_bars_keybind = {
SK_Keybind {
"Toggle Tearline Visualizer", L"<Not Bound>",
false, false, false, 0,
}, L"ToggleFCATBars"
};
int scanline_offset = -1;
int scanline_resync = 750;
int scanline_error = 1;
float delay_bias = 0.0f;
bool auto_bias = false;
float max_auto_bias = 0.75f;
struct auto_bias_target_s {
float ms = 0.85f;
float percent = 0.00f;
} auto_bias_target;
bool show_fcat_bars = false; // Not INI-persistent
bool flush_before_present = true;
bool finish_before_present = false;
bool flush_after_present = false;
bool finish_after_present = true;
} latent_sync;
bool use_amd_mwaitx = true;
struct {
bool enable_native_limit = false;
float target_fps = 0.0f;
int enforcement_policy = 4;
} streamline;
} framerate;
struct d3d9_s {
bool force_d3d9ex = false;
bool force_impure = false;
bool enable_flipex = false;
bool use_d3d9on12 = false;
} d3d9;
struct dxgi_s {
int adapter_override = SK_NoPreference;
struct resolution_s {
struct minimum_s {
unsigned int x = 0;
unsigned int y = 0;
bool isZero (void) noexcept { return x == 0 && y == 0; };
} min;
struct maximum_s {
unsigned int x = 0;
unsigned int y = 0;
bool isZero (void) noexcept { return x == 0 && y == 0; };
} max;
} res;
struct refresh_s {
float min = 0.0f;
float max = 0.0f;
} refresh;
int exception_mode = SK_NoPreference; // -1 = Don't Care
int scaling_mode = SK_NoPreference; // -1 = Don't Care
int scanline_order = SK_NoPreference; // -1 = Don't Care
int msaa_samples = SK_NoPreference;
// DXGI 1.1 (Ignored for now)
int rotation = SK_NoPreference; // -1 = Don't Care
int srgb_behavior = -2; // -2 = sRGB Not Encountered Yet
// -1 = Passthrough,
// 0 = Strip,
// 1 = Apply
bool test_present = false;
bool full_state_cache = false;
bool debug_layer = false;
bool low_spec_mode = true; // Disable D3D11 Render Mods
bool allow_tearing = true;
bool safe_fullscreen = false;
bool enhanced_depth = false;
bool deferred_isolation = false;
bool present_test_skip = false;
bool hide_hdr_support = false; // Games won't know HDR is supported
int hdr_metadata_override=
SK_NoPreference; // -1 = Don't Care, -2 Disable outright
bool use_factory_cache = true; // Fix performance issues in Resident Evil 8
bool skip_mode_changes = true; // Try to skip rendundant resolution changes
bool temporary_dwm_hdr = false; // Always turns HDR on and off for this game
bool disable_virtual_vbi = true; // Disable Windows 11 Dynamic Refresh Rate
bool ignore_thread_flags = false; // Remove threading flags from D3D11 devices
bool clear_flipped_chain = false; // Clear buffers on present? (non-compliant)
float chain_clear_color[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
bool suppress_resize_fail = true; // Workaround DLSS FrameGen compat. issues in D3D12
bool suppress_rtv_mismatch= false; // Hide SwapChain RTV format warnings for buggy games
float warn_if_vram_exceeds = 95.f; // Warn if VRAM usage exceeds % of available
bool warned_low_vram = false; // NOT SAVED: State of warn_if_vram_exceeds
bool allow_d3d12_footguns = false; // Allow overrides that are unsafe in D3D12
bool fake_fullscreen_mode = false; // Trick APIs like NvAPI into thinking FSE is on
float vram_budget_scale = 1.0f; // Over- or under-report VRAM capabilities.
DXGI_FORMAT // Report this value when the game calls GetDesc (...)
fake_swapchain_desc = DXGI_FORMAT_UNKNOWN;
struct hooks_s {
bool create_swapchain = true;
bool create_swapchain4hwnd= true;
} hooks;
bool always_allow_quickhook=false;
} dxgi;
struct {
bool wrap_d3d11_dev_ctx = false;
bool track_map_and_unmap = true;
bool track_set_shader_res = true; // Required for used texture determination in mod tools
bool trace_sampler_init = false;
} d3d11;
struct {
bool disable_bypass_io = false;
bool disable_telemetry = false;
bool disable_gpu_decomp = false;
bool force_file_buffering = false;
int submit_threads = -1;
int cpu_decomp_threads = -1;
bool enable_hooks = true;
bool use_dummy_d3d12_dev = true;
} dstorage;
struct {
bool disable_fullscreen = true;
bool enable_16bit_hdr = false;
bool enable_10bit_hdr = false;
bool upgrade_zbuffer = true;
bool prefer_10bpc = true;
struct {
#ifdef _DEBUG
bool enable = true;
#else
bool enable = false;
#endif
bool break_on_error = true;
} debug;
} gl;
struct osd_s {
ULONG64 _last_vidcap_frame = 0;
ULONG64 _last_normal_frame = 0;
float hdr_luminance = 4.375F; // 350 nits
// Required by default for compatibility with Mirillis Action!
bool draw_in_vidcap = true;
} osd;
// OSD Render Stats
bool show = false;
struct keybinds_s {
SK_ConfigSerializedKeybind
hud_toggle = {
SK_Keybind {
"Toggle Game's HUD", L"Alt+Shift+H",
false, true, true, 'H'
}, L"HUDToggle"
};
} keys;
struct output_format_s {
bool force_8bpc = false; ///< UNUSED
bool force_10bpc = false; ///< D3D9/11/12
bool force_16bpc = false; ///< UNUSED
} output;
struct {
bool enable_32bpc = false;
bool remaster_8bpc_as_unorm = false;
bool remaster_subnative_as_unorm = false;
int last_used_colorspace = 0;
} hdr;
struct {
bool force_anisotropic = false;
int max_anisotropy = -1;
float force_lod_bias = 0.0f;
} d3d12;
} render;
struct display_s {
std::wstring
monitor_path_ccd = L"";
int monitor_idx = 0;
HMONITOR monitor_handle = 0;
int monitor_default = MONITOR_DEFAULTTONEAREST;
float refresh_rate = 0.0F;
bool force_fullscreen = false;
bool force_windowed = false;
bool allow_refresh_change = true;
bool aspect_ratio_stretch = false;
bool focus_mode = false;
bool focus_mode_if_focused= true;
bool confirm_mode_changes = true;
bool save_monitor_prefs = true;
bool warn_no_mpo_planes = false;
struct resolution_s {
bool save = true;
bool applied = false;
struct desktop_override_s {
unsigned int x = 0;
unsigned int y = 0;
bool isZero (void) noexcept { return x == 0 && y == 0; };
} override, original;
// TODO
std::wstring monitor_path_ccd = L"";
} resolution;
} display;
struct textures_s {
struct d3d11_s {
std::wstring
res_root = L"SK_Res";
bool precise_hash = false;
bool use_l3_hash = true;
bool dump = false;
bool inject = true;
bool cache = true;
bool orig_cache = true;// The initial setting when the game started
bool highlight_debug = true;
bool injection_keeps_fmt = false;
bool generate_mips = false;
bool cache_gen_mips = true;
bool uncompressed_mips = false;
} d3d11;
struct cache_s {
int min_evict = 64;
int max_evict = 1024;
int min_entries = 512;
int max_entries = 65536; // Bump max up from 8192 since the hashmap
// is now segmented by number of mipmap LODs;
//
// Overhead of managing a large hashmap is
// much lower.
int min_size = 384L;
int max_size = 4096L;
bool ignore_nonmipped = false;
bool allow_staging = false;
bool allow_unsafe_refs = false; // Allow texture caching even in engines that
// are not correctly keeping track of resources
bool residency_managemnt = false;// true;
bool vibrate_on_miss = false;
} cache;
bool highlight_debug_tex = true;
bool on_demand_dump = false;
bool d3d9_mod = false; // Causing compat issues in some D3D9Ex games ATM