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:
@@ -17,4 +17,32 @@ inline bool shifted_over(uint64_t lo, uint64_t hi, uint64_t last_used, uint64_t
|
||||
return b > a && (b - a) * 8 >= hi - lo;
|
||||
}
|
||||
|
||||
/// ((Triforce, 11-21, the performance audit's TEX-30, after Source A's) The same question for all the other render targets
|
||||
/// together. Judged one by one, an eighth each, a target that two others had drawn over between them, one over its head
|
||||
/// and one over its tail, each less than an eighth, was kept for good: its texels are as gone from that memory. Here the
|
||||
/// parts the others cover inside [lo, hi) are added up, each byte once: add() takes the others in the order of their starts
|
||||
/// (vk_texture.cpp's by_start), so a part never starts before the one before it and one pass merges them. A target with
|
||||
/// the same start, one inside it and one not written after its last use count nothing, as in shifted_over
|
||||
struct ShiftedOver {
|
||||
uint64_t lo, hi, last_used;
|
||||
uint64_t closed = 0, run_lo = 0, run_hi = 0; // (the parts merged and done with, and the one still growing)
|
||||
|
||||
void add(uint64_t olo, uint64_t ohi, uint64_t o_written) {
|
||||
if (hi <= lo || ohi <= olo || olo == lo || o_written <= last_used) return;
|
||||
if (olo >= lo && ohi <= hi) return;
|
||||
const uint64_t a = std::max(lo, olo), b = std::min(hi, ohi);
|
||||
if (b <= a) return;
|
||||
if (a <= run_hi) {
|
||||
run_hi = std::max(run_hi, b);
|
||||
} else {
|
||||
closed += run_hi - run_lo;
|
||||
run_lo = a, run_hi = b;
|
||||
}
|
||||
}
|
||||
/// The bytes of it the others cover
|
||||
uint64_t covered() const { return closed + (run_hi - run_lo); }
|
||||
/// Whether that is an eighth of it or more
|
||||
bool an_eighth() const { return hi > lo && covered() * 8 >= hi - lo; }
|
||||
};
|
||||
|
||||
} // namespace mkwvk::target_overlap
|
||||
|
||||
Reference in New Issue
Block a user