mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-22 17:19:58 -04:00
Triforce v0.7.0 "Sage Of Courage"
The 0.6 crashes after warps and area changes fixed (no write-back into memory the capture leaves out), invisible objects fixed (occlusion gate), DLSS frame generation flicker fixed, achievements, the renderer built with a play profile, faster translated game code, helper threads judged on settled scenes, memory, shader preparation, audio effects, launcher, controls and Linux fixes.
This commit is contained in:
@@ -46,6 +46,45 @@ int main() {
|
||||
CHECK("wider than the output", !dc::scene_size_fits(1537, 864, 1536, 864));
|
||||
CHECK("no 32-bit overflow in the third", dc::scene_size_fits(0x60000000u, 1, 0xFFFFFFFFu, 3));
|
||||
|
||||
// ---- ((Triforce, 11-22, the performance audit's PRESENT-38) the quality mode that takes a render size ----
|
||||
{
|
||||
// (NGX's ranges for 2560x1440, in vk_dlss.cpp's order: MaxQuality with its dynamic range, DLAA, Balanced and MaxPerf
|
||||
// inside MaxQuality's, Ultra Performance one size)
|
||||
const dc::ModeRange r1440[5] = {{1280, 720, 2560, 1440, true}, {2560, 1440, 2560, 1440, true}, {1280, 720, 2560, 1440, true},
|
||||
{1280, 720, 2560, 1440, true}, {853, 480, 853, 480, true}};
|
||||
bool wide = true;
|
||||
CHECK("Quality's share is in the first range", dc::mode_for(r1440, 5, 1707, 960, 2560, 1440, true, &wide) == 0 && !wide);
|
||||
CHECK("a range that holds the size needs no slack", dc::mode_for(r1440, 5, 1707, 960, 2560, 1440, false, &wide) == 0 && !wide);
|
||||
CHECK("the row's 33% (854x480) is Ultra Performance's by a rounding", dc::mode_for(r1440, 5, 854, 480, 2560, 1440, true, &wide) == 4 && wide);
|
||||
CHECK("without the slack it is no mode's, as before", dc::mode_for(r1440, 5, 854, 480, 2560, 1440, false, &wide) == -1 && !wide);
|
||||
CHECK("NGX's own 853x480 is taken strictly", dc::mode_for(r1440, 5, 853, 480, 2560, 1440, false, &wide) == 4 && !wide);
|
||||
CHECK("42% is between the ranges: no mode's", dc::mode_for(r1440, 5, 1075, 605, 2560, 1440, true, &wide) == -1);
|
||||
CHECK("under a third of the output is not DLSS's at all", dc::mode_for(r1440, 5, 851, 478, 2560, 1440, true, &wide) == -1);
|
||||
CHECK("a size just under the dynamic range's floor is taken by the slack", dc::mode_for(r1440, 5, 1278, 719, 2560, 1440, true, &wide) == 0 && wide);
|
||||
CHECK("the slack is a 64th of the range's largest size", dc::mode_slack(2560) == 40 && dc::mode_slack(853) == 13 && dc::mode_slack(100) == 2 && dc::mode_slack(0) == 2);
|
||||
CHECK("past the slack on one axis is refused", dc::mode_for(r1440, 5, 867, 480, 2560, 1440, true, &wide) == -1);
|
||||
CHECK("14 pixels over Ultra Performance's height is refused", dc::mode_for(r1440, 5, 854, 494, 2560, 1440, true, &wide) == -1);
|
||||
// (5120x2160: the row's 33% is 1707x720, NGX's 1706x720; 42% is in no range)
|
||||
const dc::ModeRange r2160[5] = {{2560, 1080, 5120, 2160, true}, {5120, 2160, 5120, 2160, true}, {2560, 1080, 5120, 2160, true},
|
||||
{2560, 1080, 5120, 2160, true}, {1706, 720, 1706, 720, true}};
|
||||
CHECK("5120x2160 at 33%", dc::mode_for(r2160, 5, 1707, 720, 5120, 2160, true, &wide) == 4 && wide);
|
||||
CHECK("5120x2160 at 42%", dc::mode_for(r2160, 5, 2150, 907, 5120, 2160, true, &wide) == -1);
|
||||
// (a mode NGX did not answer is never taken, and the first that fits wins)
|
||||
dc::ModeRange gaps[5] = {{}, {}, {1280, 720, 2560, 1440, true}, {1280, 720, 2560, 1440, true}, {}};
|
||||
CHECK("an unanswered mode is skipped", dc::mode_for(gaps, 5, 1707, 960, 2560, 1440, true, &wide) == 2 && !wide);
|
||||
CHECK("no mode answered", dc::mode_for(gaps, 2, 1707, 960, 2560, 1440, true, &wide) == -1);
|
||||
// (every twelfth of every output the menu offers is some mode's with the slack, where NGX's sizes are the share rounded down)
|
||||
const uint32_t outs[][2] = {{1920, 1080}, {2048, 1152}, {2560, 1440}, {3840, 2160}, {3440, 1440}, {5120, 2160}, {1536, 864}, {4416, 1864}};
|
||||
for (const auto& o : outs) {
|
||||
const dc::ModeRange r[5] = {{o[0] / 2, o[1] / 2, o[0], o[1], true}, {o[0], o[1], o[0], o[1], true}, {o[0] / 2, o[1] / 2, o[0], o[1], true},
|
||||
{o[0] / 2, o[1] / 2, o[0], o[1], true}, {o[0] / 3, o[1] / 3, o[0] / 3, o[1] / 3, true}};
|
||||
for (const uint32_t twelfths : {4u, 6u, 7u, 8u}) {
|
||||
const uint32_t w = (o[0] * twelfths + 11) / 12, h = (o[1] * twelfths + 11) / 12;
|
||||
CHECK("a share of the row at an output of the menu", dc::mode_for(r, 5, w, h, o[0], o[1], true, &wide) >= 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- UTF-8 paths as NGX's wide strings, in the C locale (the decoding must not depend on it) ----
|
||||
std::setlocale(LC_ALL, "C");
|
||||
// (which paths NGX's Linux library takes as they are: ASCII only. The others go to it as /proc/self/fd/<n>)
|
||||
@@ -80,6 +119,50 @@ int main() {
|
||||
CHECK("good after bad", decode("\xFF\xC3\xA9", bad) == L"<EFBFBD>é" && bad);
|
||||
CHECK("no flag asked", dc::utf8_to_wide("\xFF") == L"<EFBFBD>");
|
||||
CHECK("empty", decode("", bad).empty() && !bad);
|
||||
{ // ((Triforce, 11-21, PRESENT-37) the DLSS model row stepped through: no feature for a preset passed over
|
||||
dc::PresetSettle s;
|
||||
const unsigned K = 0, M = 1, L = 2;
|
||||
CHECK("no feature: the row's preset at once", s.pick(K, ~0u, false, 100, 30) == K);
|
||||
CHECK("the feature's own preset", s.pick(K, K, true, 101, 30) == K);
|
||||
CHECK("a new preset waits", s.pick(M, K, true, 200, 30) == K && s.pick(M, K, true, 210, 30) == K);
|
||||
CHECK("stepped on: the count starts again", s.pick(L, K, true, 211, 30) == K && s.pick(L, K, true, 240, 30) == K);
|
||||
CHECK("held for 30 frames: taken", s.pick(L, K, true, 241, 30) == L);
|
||||
CHECK("and it is the feature's now", s.pick(L, L, true, 242, 30) == L);
|
||||
CHECK("away and back within the wait: nothing made", s.pick(M, L, true, 300, 30) == L && s.pick(L, L, true, 310, 30) == L);
|
||||
CHECK("the feature let go: at once", s.pick(M, L, false, 311, 30) == M);
|
||||
dc::PresetSettle now;
|
||||
CHECK("0 frames: at once, as before", now.pick(K, ~0u, false, 1, 0) == K && now.pick(M, K, true, 2, 0) == M &&
|
||||
now.pick(L, M, true, 3, 0) == L);
|
||||
CHECK("the switch", dc::settle_frames(nullptr) == 30 && dc::settle_frames("") == 30 && dc::settle_frames("30") == 30 &&
|
||||
dc::settle_frames("0") == 0 && dc::settle_frames("120") == 120 && dc::settle_frames("-5") == 0 &&
|
||||
dc::settle_frames("off") == 0);
|
||||
}
|
||||
{ // ((Triforce, 11-22, the performance audit's PRESENT-32) the one-size (DLAA) modes: before, whenever the render size is
|
||||
// the output's; with the rule, only where DLAA is the Upscaler's choice
|
||||
CHECK("as before: one size whenever the sizes are equal", dc::dlaa_feature(false, false, 2560, 1440, 2560, 1440) &&
|
||||
dc::dlaa_feature(false, true, 2560, 1440, 2560, 1440) &&
|
||||
!dc::dlaa_feature(false, true, 1707, 960, 2560, 1440) &&
|
||||
!dc::dlaa_feature(false, false, 2560, 1439, 2560, 1440));
|
||||
CHECK("the rule: DLAA at the output's size is one size", dc::dlaa_feature(true, true, 2560, 1440, 2560, 1440));
|
||||
CHECK("the rule: DLSS at the output's size is not", !dc::dlaa_feature(true, false, 2560, 1440, 2560, 1440));
|
||||
CHECK("the rule: a smaller render size never is", !dc::dlaa_feature(true, true, 1707, 960, 2560, 1440) &&
|
||||
!dc::dlaa_feature(true, false, 1707, 960, 2560, 1440));
|
||||
CHECK("RX_VK_DLSS_PREWARM: on only at 1", !dc::prewarm_rule(nullptr) && !dc::prewarm_rule("") && !dc::prewarm_rule("0") &&
|
||||
dc::prewarm_rule("1") && !dc::prewarm_rule("2") && !dc::prewarm_rule("on"));
|
||||
// (DLSS at full size takes the scaled mode whose range holds it, and that range holds Auto's smaller sizes: NGX's
|
||||
// ranges as it answers them, Quality's from half the output to the output's own)
|
||||
const unsigned outs[][2] = {{1920, 1080}, {2560, 1440}, {3840, 2160}, {4416, 1864}, {5120, 2160}};
|
||||
for (const auto& o : outs) {
|
||||
const dc::ModeRange r[5] = {{o[0] / 2, o[1] / 2, o[0], o[1], true}, {o[0], o[1], o[0], o[1], true}, {o[0] / 2, o[1] / 2, o[0], o[1], true},
|
||||
{o[0] / 2, o[1] / 2, o[0], o[1], true}, {o[0] / 3, o[1] / 3, o[0] / 3, o[1] / 3, true}};
|
||||
bool wide = false;
|
||||
const int at = dc::mode_for(r, 5, o[0], o[1], o[0], o[1], true, &wide);
|
||||
CHECK("DLSS at the output's size: the first scaled mode's", at == 0 && !wide);
|
||||
for (unsigned pct = 50; pct <= 100; pct += 5)
|
||||
CHECK("Auto's sizes are in that mode's range", o[0] * pct / 100 >= r[at].min_w && o[0] * pct / 100 <= r[at].max_w &&
|
||||
o[1] * pct / 100 >= r[at].min_h && o[1] * pct / 100 <= r[at].max_h);
|
||||
}
|
||||
}
|
||||
std::puts("dlss checks: ok");
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user