mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-22 21:15:57 +00:00
Per-object motion vectors for DLSS, camera motion in double precision, Ultra Performance and DLSS presets.
Solid scene draws whose position reads an object's own uniform blocks (bones c5, place c7, c6) are drawn a second time with a vertex shader variant (translator patch 0012) that computes last frame's position from last frame's blocks; the game writes those into two copies that take turns, and the uniform snapshot keeps both (vk_mvprev.c). The draws are listed during the replay and recorded through the recorder thread with repeated state skipped. Blocks whose last-frame copies measured wrong (c9 and c11 of walls and cliffs) keep this frame's; positions without an object block (terrain, grass) keep the camera's motion, which measured as good. The camera motion is reprojected in double precision on the CPU: the float inverse made noise on far surfaces and a still camera that DLSS followed into a wobble. DLSS gets Ultra Performance (a third of the output, also in the F1 menu) and NVIDIA's recommended preset per mode (K, M for Performance, L for Ultra Performance; TOTK_DLSS_PRESET overrides). Test switches: TOTK_MV_CHECK measures the motion vectors and DLSS's output against the picture, TOTK_DLAA_TIMES times DLSS and the motion passes on the GPU. A reactive mask pass for transparents is included but off (TOTK_DLSS_REACTIVE): its mask covers sky and fog too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2950132ad8
commit
ad3ecd8f3c
28 files changed
+3177
-78
No files matched your search
@@ -117,6 +117,12 @@ static class SwshXlate
|
||||
public int QueryHostStorageBufferOffsetAlignment() => _job["sbuf_align"] is JsonNode n ? (int)n : 16;
|
||||
// "subgroup": n: lanes per subgroup when the host cannot pin 32 (AMD GCN/Vega run 64): ballots and votes span n lanes.
|
||||
public int QueryHostSubgroupSize() => _job["subgroup"] is JsonNode n ? (int)n : 32;
|
||||
// "mvprev": true: the vertex shader also writes last frame's position, computed from slots bank + 15 in place of
|
||||
// the user banks c3-c16 (patch 0012, runtime/vk_mvprev.c); res.json's "mvprev" names the output location (-1:
|
||||
// none) and "mvprev_banks" the banks the position depends on (bit n: cn).
|
||||
public bool QueryMotionPrevious() => _job["mvprev"] is JsonValue v && v.TryGetValue<bool>(out bool b) && b;
|
||||
public int MotionPreviousLocation = -1, MotionPreviousBanks;
|
||||
public void ReportMotionPrevious(int location, int banks) => (MotionPreviousLocation, MotionPreviousBanks) = (location, banks);
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +146,7 @@ static class SwshXlate
|
||||
["uses_frag_coord"] = p.Info.UsesFragCoord, ["frag_out_map"] = p.Info.FragmentOutputMap,
|
||||
["tex_queried"] = new JsonArray(acc.TexQueried.Select(x => (JsonNode)x).ToArray()), ["img_queried"] = new JsonArray(acc.ImgQueried.Select(x => (JsonNode)x).ToArray()),
|
||||
};
|
||||
if (acc.QueryMotionPrevious()) (res["mvprev"], res["mvprev_banks"]) = (acc.MotionPreviousLocation, acc.MotionPreviousBanks);
|
||||
foreach (var b in p.Info.CBuffers) res["cbufs"].AsArray().Add((JsonNode)new JsonObject { ["binding"] = b.Binding, ["slot"] = b.Slot });
|
||||
foreach (var b in p.Info.SBuffers) res["sbufs"].AsArray().Add((JsonNode)new JsonObject { ["binding"] = b.Binding, ["slot"] = b.Slot, ["cb_slot"] = b.SbCbSlot, ["cb_offset"] = b.SbCbOffset, ["flags"] = (int)b.Flags });
|
||||
foreach (var (list, name) in new[] { (p.Info.Textures, "textures"), (p.Info.Images, "images") })
|
||||
|
||||
Reference in new issue
Block a user