mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-23 17:49:57 -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:
@@ -44,9 +44,16 @@ def main():
|
||||
guard = body[:body.index("dyn_same(")]
|
||||
if "last_dyn_valid" not in guard:
|
||||
raise SystemExit("a clear's dynamic state is left unset")
|
||||
fixture = f'''#include <cstdint>
|
||||
# ((Triforce, 11-22, the performance audit's DESC-06, after Source A's) the words and the bytes by one memcmp each, the
|
||||
# floats still by value: the same answers as the three loops gave, at the last word and the last byte too, with -0 the
|
||||
# same as 0 and a NaN the same as nothing
|
||||
if fn.count("std::memcmp(") != 2 or "if (fp[i] != cfp[i]) return false;" not in fn:
|
||||
raise SystemExit("dyn_same does not compare its floats by value and its words and bytes by two memcmp")
|
||||
fixture = f'''#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#define CHECK(x) do {{ if (!(x)) {{ std::fprintf(stderr, "FAIL:%d %s\\n", __LINE__, #x); std::exit(1); }} }} while (0)
|
||||
{fn}
|
||||
int main() {{
|
||||
@@ -63,6 +70,33 @@ int main() {{
|
||||
craw[1] = 7;
|
||||
CHECK(!dyn_same(fp, 2, up, 2, raw, 2, cfp, cup, craw));
|
||||
CHECK(!dyn_same(fp, 0, up, 2, raw, 2, cfp, cup, craw));
|
||||
craw[1] = 6;
|
||||
CHECK(!dyn_same(fp, 2, up, 0, raw, 2, cfp, cup, craw));
|
||||
CHECK(!dyn_same(fp, 2, up, 2, raw, 0, cfp, cup, craw));
|
||||
CHECK(dyn_same(fp, 2, up, 2, raw, 2, cfp, cup, craw));
|
||||
// (the sizes the draw uses: 13 floats, 35 words, 160 bytes; a difference in the last of each, and only there)
|
||||
float f13[13], g13[13];
|
||||
uint32_t u35[35], v35[35];
|
||||
uint8_t b160[160], c160[160];
|
||||
for (int i = 0; i < 13; i++) f13[i] = g13[i] = (float)i * 0.5f;
|
||||
for (int i = 0; i < 35; i++) u35[i] = v35[i] = 0x01010101u * (uint32_t)i;
|
||||
for (int i = 0; i < 160; i++) b160[i] = c160[i] = (uint8_t)(i * 7);
|
||||
CHECK(dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
v35[34] ^= 0x80000000u;
|
||||
CHECK(!dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
CHECK(dyn_same(f13, 13, u35, 34, b160, 160, g13, v35, c160)); // (the last word is past the count: not looked at)
|
||||
v35[34] = u35[34], v35[0] ^= 1;
|
||||
CHECK(!dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
v35[0] = u35[0], c160[159] ^= 1;
|
||||
CHECK(!dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
CHECK(dyn_same(f13, 13, u35, 35, b160, 159, g13, v35, c160)); // (the last byte is past the count: not looked at)
|
||||
c160[159] = b160[159], g13[12] += 0.25f;
|
||||
CHECK(!dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
g13[12] = f13[12];
|
||||
f13[0] = 0.0f, g13[0] = -0.0f; // (-0 is 0: by value, not by its bits)
|
||||
CHECK(std::memcmp(&f13[0], &g13[0], sizeof(float)) != 0 && dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
f13[5] = g13[5] = std::nanf(""); // (a NaN is the same as nothing, itself included: the state is built again)
|
||||
CHECK(!dyn_same(f13, 13, u35, 35, b160, 160, g13, v35, c160));
|
||||
std::printf("PASS: the same dynamic state is not built again\\n");
|
||||
}}
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user