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:
@@ -1,4 +1,5 @@
|
||||
// Game-free regression for the Ampere -> Maxwell lowering's register renaming (lower_to_maxwell.h): a renamed high GPR's
|
||||
// Game-free regression for the Ampere -> Maxwell lowering's register renaming (lower_to_maxwell_regmap.h, the lowering
|
||||
// that takes the programs the first one refuses, namespace Shader::AmpereRegmap): a renamed high GPR's
|
||||
// marker must not be a number another field of the same instruction names. OoT's Castle Town flower colour pass had
|
||||
// FMUL R252, R216, c[..] (native 864 of mesh code e3fc8fcf540f7a48): R252 took R216 as its marker, the prefix mapped
|
||||
// R216 to both 252 and 216, the product went to R216 and R252 stayed undefined: the flowers' vertices broke and they
|
||||
@@ -7,13 +8,13 @@
|
||||
#include <cstdio>
|
||||
#include <map>
|
||||
|
||||
#include "shader_recompiler/frontend/ampere/lower_to_maxwell.h"
|
||||
#include "shader_recompiler/frontend/ampere/lower_to_maxwell_regmap.h"
|
||||
|
||||
namespace {
|
||||
using Shader::Ampere::Instruction;
|
||||
using Shader::AmpereRegmap::Instruction;
|
||||
|
||||
// Numbers mapped to two different targets by the prefixes before one lowered word.
|
||||
int collisions(const Shader::Ampere::LoweredProgram& lowered) {
|
||||
int collisions(const Shader::AmpereRegmap::LoweredProgram& lowered) {
|
||||
int bad = 0;
|
||||
std::map<u32, u32> current;
|
||||
for (const u64 w : lowered.instructions) {
|
||||
@@ -36,6 +37,26 @@ int collisions(const Shader::Ampere::LoweredProgram& lowered) {
|
||||
}
|
||||
return bad;
|
||||
}
|
||||
// UR36 puts the first reserved register at R206. A load into R204 needs a
|
||||
// prefix for R206-R207 only when it writes all four destination registers.
|
||||
bool check_load_width(u32 size, bool uniform_address) {
|
||||
using namespace Shader::AmpereRegmap;
|
||||
const Instruction load = uniform_address
|
||||
? Instruction{{0xffcc7981, 0, 0x081e8100U | (size << 9), 0x000fe200}} // LDG.E R204, [UR0]
|
||||
: Instruction{{0x08cc7381, 0, 0x001e8100U | (size << 9), 0x000fe200}}; // LDG.E R204, [R8]
|
||||
const Instruction program[] = {
|
||||
{{0x00247ab9, 0x0001e400, 0x00000a00, 0x000fe200}}, // ULDC.64 UR36
|
||||
load,
|
||||
{{0x0000794d, 0, 0x03800000, 0x000fea00}}, // EXIT
|
||||
};
|
||||
const auto lowered = LowerToMaxwell(program);
|
||||
if (!lowered) return false;
|
||||
const u32 first = lowered.source_instruction_offsets[1];
|
||||
const u32 end = lowered.source_instruction_offsets[2];
|
||||
if (size != 6) return end == first + 1;
|
||||
const RegisterRun upper_pair{206, 206, 2};
|
||||
return end == first + 2 && lowered.instructions[first] == RegisterMapPrefix(&upper_pair, 1);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
int main() {
|
||||
@@ -44,7 +65,7 @@ int main() {
|
||||
{{0xd8fc7a20, 0x00cc0c00, 0x00410000, 0x000fe200}}, // FMUL R252, R216, c[0x3][0x30]
|
||||
{{0x0000794d, 0x00000000, 0x03800000, 0x000fea00}}, // EXIT
|
||||
};
|
||||
const auto lowered = Shader::Ampere::LowerToMaxwell(std::span<const Instruction>(program, 3));
|
||||
const auto lowered = Shader::AmpereRegmap::LowerToMaxwell(std::span<const Instruction>(program, 3));
|
||||
int failures = 0;
|
||||
if (!lowered) {
|
||||
std::fprintf(stderr, "not lowered: %.*s\n", static_cast<int>(lowered.error.size()), lowered.error.data());
|
||||
@@ -56,6 +77,15 @@ int main() {
|
||||
std::fprintf(stderr, "%d register numbers mapped to two registers in one prefix\n", bad);
|
||||
failures++;
|
||||
}
|
||||
for (const bool uniform_address : {false, true}) {
|
||||
for (const u32 size : {4U, 5U, 6U}) {
|
||||
if (!check_load_width(size, uniform_address)) {
|
||||
std::fprintf(stderr, "incorrect register map for %u-bit LDG R204, [%s]\n",
|
||||
32U << (size - 4), uniform_address ? "UR0" : "R8");
|
||||
failures++;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::printf("%s\n", failures ? "FAILED" : "ok");
|
||||
return failures ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user