mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 11:09:56 -04:00
Port Ocarina of Time (Switch 2) to the recomp host
The NVN2 front end and the SM86 to Maxwell shader lowering (tools/xlate/AmpereLowering.cs, mesh and task stages, bindless texture pools, BRX jump tables, the NVN2 compute c0 layout) with four translator patches (0017-0020) bring the opening of the game to 58-60 fps on the Vulkan renderer. This round fixes the haze: SM86 IPA is lowered as a plain Maxwell IPA.PASS (texture coordinates were corrected for perspective twice); LDSM, TXD, both F2IP byte forms, HMMA, MOVM and HFMA2.RELU are lowered and spill mode has eight uniform register groups; conditional rendering keeps the newest counter report per address and treats a report as pending until its value is in guest memory, so occlusion tests and the depth clears around the depth copy behave; and the upscaler stand-in decodes the post pass's sRGB picture before writing the linear target. Tensor-core programs keep the stand-in unless NX2NAVI_NATIVE_TENSOR=1, because their lowering does not match the hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -409,6 +409,8 @@ static IpcBuffer pick(const IpcBuffer *a, unsigned na, const IpcBuffer *b, unsig
|
||||
return x.size ? x : y;
|
||||
}
|
||||
|
||||
static uint32_t voice_drop_bits = 0x3f800000u; // SetVoiceDropParameter's float (1.0 until set)
|
||||
|
||||
static void renderer_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *rs) {
|
||||
AudioRenderer *r = s->state;
|
||||
switch (rq->cmd) {
|
||||
@@ -446,6 +448,20 @@ static void renderer_handler(IpcSession *s, const IpcRequest *rq, IpcResponse *r
|
||||
case 7: rs->copy[rs->ncopy++] = kern_event_readable(r->event); return; // QuerySystemEvent
|
||||
case 8: r->time_limit = IPC_ARG(rq, uint32_t, 0); return; // SetRenderingTimeLimit
|
||||
case 9: { uint32_t v = r->time_limit ? r->time_limit : 100; IPC_OUT(rs, v); return; } // GetRenderingTimeLimit
|
||||
// 15.0.0+ Set/GetVoiceDropParameter (the system service/audio/audio_renderer.cpp): the factor the DSP uses to drop
|
||||
// voices when a frame overruns its time. The host mixer renders every voice, so the value is only kept.
|
||||
case 12: {
|
||||
float v = IPC_ARG(rq, float, 0);
|
||||
__atomic_store_n(&voice_drop_bits, isfinite(v) ? *(uint32_t *)&v : 0x3f800000u, __ATOMIC_RELAXED);
|
||||
return;
|
||||
}
|
||||
case 13: {
|
||||
uint32_t bits = __atomic_load_n(&voice_drop_bits, __ATOMIC_RELAXED);
|
||||
float v;
|
||||
memcpy(&v, &bits, sizeof v);
|
||||
IPC_OUT(rs, v);
|
||||
return;
|
||||
}
|
||||
default: ipc_unimplemented(s, rq);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user