Triforce v0.5.1

Hotfix for v0.5.0: crashes (NX2navi game folder refused by Setup, heap-full retries, GTX 10 series noise pass and whole VRAM mirrors, code-patch mods kept with their code, no page file warning), graphics (DLSS with frame generation, DLSS coming back, AMD storage buffer alignment, mesh index map, shared memory barrier, shader conversions, integrated GPUs' uniform snapshot, a Mesh shaders row), controls (microphone after restart, button prompts with a mod's size table, sprint vs Hide text, native mouse camera, controller after Restart now), Setup's Preparing shaders step, and the Linux link fix.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-18 12:06:48 -06:00
parent 72793f2231
commit a750a21025
54 changed files with 1806 additions and 114 deletions

View File

@@ -440,13 +440,6 @@ void EmitSetAttribute(EmitContext& ctx, IR::Attribute attr, Id value, [[maybe_un
value = ctx.OpBitcast(output->type, value);
}
static constexpr IR::Attribute cd0 = IR::Attribute::ClipDistance0;
static constexpr IR::Attribute cd7 = IR::Attribute::ClipDistance7;
if (attr >= cd0 && attr <= cd7) {
const u32 idx = (u32) attr - (u32) cd0;
clip_distance_written.set(idx);
}
ctx.OpStore(output->pointer, value);
}

View File

@@ -197,11 +197,9 @@ void EmitPrologue(EmitContext& ctx) {
if (Sirit::ValidId(ctx.clip_distances)) {
for (u32 i = 0; i < ctx.profile.max_user_clip_distances; ++i) {
if (!clip_distance_written.test(i)) {
const Id idx = ctx.Const(i);
const Id element = ctx.OpAccessChain(ctx.output_f32, ctx.clip_distances, idx);
ctx.OpStore(element, ctx.Const(0.0f));
}
const Id idx = ctx.Const(i);
const Id element = ctx.OpAccessChain(ctx.output_f32, ctx.clip_distances, idx);
ctx.OpStore(element, ctx.Const(0.0f));
}
}
}

View File

@@ -2312,7 +2312,11 @@ void EmitContext::DefineMesh(const IR::Program& program) {
mesh_attribute_words = (std::max)(
mesh_primitive_base + Common::DivCeil(mesh_info.max_primitives, 32U) * primitive_lines * 32,
1U);
mesh_map_bytes = 4 + mesh_info.Corners() * mesh_info.max_primitives;
// Whole blocks of 32 primitives, as the attributes: the program writes the index bytes of every primitive block, lanes past
// max_primitives too (a count of 0 wraps its min(count - 1, lane) to every lane). Sized to max_primitives, those writes were
// clamped onto the last byte, the last primitive's last corner: with 126 primitives (most of OoT's) a stray vertex, flashing
// triangles over Kokiri's foliage and ground (as nxnative found: "primitive index bytes for every primitive block")
mesh_map_bytes = 4 + mesh_info.Corners() * Common::DivCeil(mesh_info.max_primitives, 32U) * 32;
mesh_shared_u32 = TypePointer(spv::StorageClass::Workgroup, U32[1]);
mesh_attributes = DefineVariable(*this, TypeArray(U32[1], Const(mesh_attribute_words)),
std::nullopt, spv::StorageClass::Workgroup);

View File

@@ -19,8 +19,6 @@
namespace Shader::Backend::SPIRV {
static std::bitset<8> clip_distance_written;
using Sirit::Id;
class VectorTypes {