Files
Triforce-Source/gpu/vk/vk_xfer.h
ruckus7382sfgsgdf 6f338c8f56 Triforce v0.5.0
In-game mods (GameBanana browser, search and installs, with the Mask Salesman), code-patch and cheat mods, the devs' test18 to test45 work (full performance overlay, frame pacing on, steady frame rate, save export and import, bug capture, new options rows, Setup's Mods page and Add to Steam), occlusion queries and new defaults, Auto resolution that scales, replay helper threads and robust buffers off by default, the options in sections.
2026-11-17 22:40:50 -06:00

31 lines
1.8 KiB
C++

// Texture <-> buffer and texture <-> texture copies, and texture clears.
//
// These are totk-pc-recomp's, from runtime/vk_exec_xfer.c (sub_resolve, buffer_side, copy_buffer_image, copy_t2t,
// clear_tex), whose comments explain each case; adapted to this back end, where an image is one level and one layer
// of a texture found by its storage address (vk_image.cpp image_for) instead of one image holding every level.
//
// What they are for here: MKW renders into its own targets and copies them into the 4K window texture it presents,
// so without these the present blits an image nothing ever wrote.
#pragma once
#include "vk_internal.h"
#include "vk_state.h"
namespace mkwvk {
/// buffer <-> texture level (nvn_p_copy_bt); to_image: buffer to texture, else texture to buffer. cpu_done (Triforce): a
/// parallel replay's worker after its dry pass, which made the copies the CPU makes (dry_copy_b2t): not made again
void copy_b2t(VkCommandBuffer cmd, NvnState& s, const nvn_p_copy_bt& p, bool to_image, bool cpu_done = false);
/// (Triforce) The parallel replay's dry pass, in stream order on the replay thread: the destination of a buffer-to-texture
/// copy, of a texture-to-texture copy and of a texture clear looked up as the copy will look it up and marked as written
/// by the GPU, before any segment's worker records (vk_xfer.cpp, "the parallel replay's dry pass")
void dry_copy_b2t(NvnState& s, const nvn_p_copy_bt& p);
void dry_copy_t2t(const nvn_p_copy_tt& p);
void dry_clear_tex(const nvn_p_clear_tex& p);
/// texture level -> texture level (nvn_p_copy_tt): copy, blit when scaled or converting, resolve when multisampled
void copy_t2t(VkCommandBuffer cmd, NvnState& s, const nvn_p_copy_tt& p);
/// a whole level to a value (nvn_p_clear_tex)
void clear_tex(VkCommandBuffer cmd, NvnState& s, const nvn_p_clear_tex& p);
} // namespace mkwvk