mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-25 18:48:51 -04:00
Triforce v0.8.0
Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
51
gpu/vk/vk_reactive.h
Normal file
51
gpu/vk/vk_reactive.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// (Triforce) A reactive mask for the temporal upscalers NVIDIA DLSS (vk_dlss.cpp) and AMD FSR 3.1 (vk_fsr3.cpp); not AMD
|
||||
// FSR 4 or Intel XeSS, which take none (they run as they do without RX_VK_REACTIVE): where the scene's transparent draws
|
||||
// (water, smoke, fire, glows) changed it. They write no depth and have no motion of their own, so an upscaler takes them
|
||||
// for the surface behind and smears or ghosts them; where the mask is set it leans on this frame and not on its history.
|
||||
//
|
||||
// The game does not say which draws they are. vk_draw.cpp's draw tells them by their state (reactive_policy.h) and has the
|
||||
// scene's colour copied before them (copy_scene); at the upscale, what the scene's target holds now is compared with
|
||||
// that copy (shaders/reactive_mask.comp), and the difference is the mask.
|
||||
//
|
||||
// Off unless RX_VK_REACTIVE=1: which draws are the transparent ones is a guess from their state, and it is not yet checked
|
||||
// in the game. RX_VK_REACTIVE_SCALE (1) multiplies the mask, RX_VK_REACTIVE_MAX (0.9) limits it, RX_VK_REACTIVE_DEBUG=1
|
||||
// shows it in the picture (magenta where it is set).
|
||||
// With the parallel replay (vk_replay.cpp) each thread keeps its own run of the scene's draws (reactive_policy::Run): a
|
||||
// thread that starts in the middle of a run of transparent draws copies again before its first one, and the mask then
|
||||
// holds only what was drawn after that copy.
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "vk_internal.h"
|
||||
|
||||
namespace mkwvk {
|
||||
|
||||
struct Texture;
|
||||
|
||||
namespace reactive {
|
||||
|
||||
/// A frame's mask: R8_UNORM, of the upscaler's inputs' size, set in its top left width x height
|
||||
struct Mask {
|
||||
VkImage image = VK_NULL_HANDLE;
|
||||
VkImageView view = VK_NULL_HANDLE;
|
||||
VkFormat format = VK_FORMAT_UNDEFINED;
|
||||
uint32_t image_width = 0, image_height = 0;
|
||||
};
|
||||
|
||||
/// RX_VK_REACTIVE=1, and the device can make the mask
|
||||
bool wanted();
|
||||
|
||||
/// Before a transparent draw into the scene's colour target (reactive_policy.h says which): its level's colour as it is
|
||||
/// now, copied aside. Called outside a pass. False when it is not a target this can copy (the reason is logged once)
|
||||
bool copy_scene(VkCommandBuffer cmd, Texture* color, uint32_t level, uint32_t layer, uint32_t width, uint32_t height);
|
||||
|
||||
/// At the upscale: the mask of this frame's copy against the scene's target as it is now, width x height in an image of
|
||||
/// image_width x image_height (DLSS's inputs are larger than the scene). `color` is the upscaler's RGBA16F colour input,
|
||||
/// a storage image of at least that size, written only by RX_VK_REACTIVE_DEBUG. False when there is no mask this frame:
|
||||
/// nothing transparent was drawn, or the scene's target is not the one copied (the upscaler then runs without one)
|
||||
bool mask(VkCommandBuffer cmd, uint32_t width, uint32_t height, uint32_t image_width, uint32_t image_height,
|
||||
VkImageView color, Mask& out);
|
||||
|
||||
} // namespace reactive
|
||||
} // namespace mkwvk
|
||||
Reference in New Issue
Block a user