mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.5.2
The new launcher (Windows and Linux: the game's own look, music and settings, saves and mods pages, smaller updates in parts), benchmark mode (Find my best settings: the game tours four places by itself and writes its results), Quit and Restart in the pause menu under Mods, Squadala! in the Mods menu, battle music above 60 fps, menu text, the controller in the menus with the game in the background, the whole GameBanana list, RX 580 and RX 5000/6000 shader fixes, the pipeline cache kept through an update, async present black flashes, and faster builds.
This commit is contained in:
@@ -64,6 +64,7 @@
|
||||
#include "reupload_early.h" // ((Triforce) the re-uploads made before a parallel replay's segments)
|
||||
#include "upload_earliest.h" // ((Triforce) a parallel replay's upload into the earliest segment still recorded)
|
||||
#include "pass_barrier.h" // ((Triforce) the rule of the barrier a draw pass starts with)
|
||||
#include "redrawn.h" // ((Triforce) whether a target is drawn again frame after frame: the new-texture budget's rule)
|
||||
#include "host_shaders/block_linear_unswizzle_2d_comp_spv.h"
|
||||
#include "shaders/swizzle_back_comp_spv.h"
|
||||
#include "vk_work.h" // (after the others: counts the commands that do GPU work, for full_barrier)
|
||||
@@ -2777,7 +2778,15 @@ Texture* create(const Key& key, const nvn_tex* t, VkFormat vf, bool astc, int bw
|
||||
(int)x.format, (int)r, x.type == VK_IMAGE_TYPE_3D ? " (3D: taken)" : "");
|
||||
}
|
||||
}
|
||||
if (x.type == VK_IMAGE_TYPE_2D && x.layers >= 6 && x.width == x.height && x.samples == VK_SAMPLE_COUNT_1_BIT)
|
||||
// ((Triforce, 11-18, EstebanGGM's port from NX2navi) on AMD's drivers only a cubemap's image is made cube compatible: a square
|
||||
// 2D array of 6 layers or more made so broke terrain textures on an RX 580 and an RX 7800 XT. Elsewhere as before (a cube view
|
||||
// of an image without the flag is refused: view_of), until a cube read of a non-cube target is ruled out there too.
|
||||
// RX_VK_CUBE_ONLY=1: on every GPU, =0: on none)
|
||||
static const int cube_env = getenv("RX_VK_CUBE_ONLY") ? atoi(getenv("RX_VK_CUBE_ONLY")) : -1;
|
||||
const bool cube_only = cube_env >= 0 ? cube_env != 0 : dev.props.vendorID == 0x1002;
|
||||
const bool cube_target = d.target == NVN_TEXTURE_TARGET_CUBEMAP || d.target == NVN_TEXTURE_TARGET_CUBEMAP_ARRAY;
|
||||
if (x.type == VK_IMAGE_TYPE_2D && (!cube_only || cube_target) && x.layers >= 6 && x.width == x.height &&
|
||||
x.samples == VK_SAMPLE_COUNT_1_BIT)
|
||||
flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, x.cube = true;
|
||||
if (x.type == VK_IMAGE_TYPE_3D) {
|
||||
flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
||||
@@ -3321,6 +3330,10 @@ void audit_scan(const Texture& t) {
|
||||
}
|
||||
|
||||
thread_local bool upload_defer_ok = false;
|
||||
bool texture_redrawn(const Texture* t) {
|
||||
if (!t) return true;
|
||||
return redrawn::drawn_before(t->prev_written, t->last_written, t->gpu_written && !t->released, frame_no);
|
||||
}
|
||||
/// (Triforce) The hold of the last picture (present_hold.h): the mode do_present sets for the draws of the next frame, this
|
||||
/// frame's looks that left a texture owed its first bytes, and the new textures left for later
|
||||
std::atomic<int> hold_mode{present_hold::AS_BEFORE};
|
||||
@@ -3510,6 +3523,10 @@ bool upload_again_later(const Texture& tex) {
|
||||
return true;
|
||||
}
|
||||
int64_t texture_uploads_later() { return st_again_later.load(std::memory_order_relaxed); }
|
||||
bool texture_frame_left_any() { // (each counter is set back at the frame's end: texture_frame)
|
||||
return frame_owed.load(std::memory_order_relaxed) || st_again_later_frame.load(std::memory_order_relaxed) ||
|
||||
st_torn_later_frame.load(std::memory_order_relaxed) || st_deferred_frame.load(std::memory_order_relaxed);
|
||||
}
|
||||
// ---- (Triforce, 11-16) the re-uploads made before a parallel replay's segments (reupload_early.h) ----
|
||||
namespace {
|
||||
std::mutex reup_mu; // (the notes come from the segments' threads too, under the recording lock; the early looks before them)
|
||||
@@ -4665,6 +4682,9 @@ void texture_written(Texture* tex, const char* why) {
|
||||
tex->wb_burst = frame_no;
|
||||
}
|
||||
if (!tex->gpu_written || tex->released) tex->first_written = frame_no;
|
||||
// ((Triforce) redrawn.h: the frame it was written in before this one, for the new-texture budget's rule; read before
|
||||
// gpu_written and released are set for this write)
|
||||
tex->prev_written = redrawn::prev_on_write(tex->prev_written, tex->last_written, tex->gpu_written && !tex->released, frame_no);
|
||||
tex->last_written = frame_no;
|
||||
tex->gpu_written = true;
|
||||
upload_same::changed(tex->same); // ((Triforce) its image's bytes are the GPU's: no kept hash of a re-upload's is theirs)
|
||||
|
||||
Reference in New Issue
Block a user