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:
chrg6
2026-11-06 03:03:08 -05:00
parent 0478c13e45
commit 77d0c0b84e
65 changed files with 8136 additions and 554 deletions

View File

@@ -34,6 +34,8 @@ typedef struct {
unsigned ncopy, nmove;
IpcBuffer xout[IPC_MAX_BUF]; // pointer data the service placed into the client's C buffers
unsigned nxout;
int domain; // the reply carries a domain message header
unsigned domain_objects; // objects the service appended to the client's domain
} IpcResponse;
typedef struct IpcSession IpcSession;
@@ -47,8 +49,16 @@ struct IpcSession {
void *state;
void (*close)(void *state);
int32_t refs;
int is_domain; // ConvertCurrentObjectToDomain ran: requests carry a domain header
IpcSession *root; // the domain session every object id belongs to (objects share it)
IpcSession *objects[32]; // object 1 is this session, then what the service handed out
int nobjects;
uint32_t event; // readable event handed to the client (applet state changes)
};
// Register an object inside a domain (1-based id returned, 0 when full).
unsigned ipc_domain_add(IpcSession *domain, IpcSession *object);
uint32_t ipc_session_new(const char *name, IpcHandler handler, void *state, void (*close)(void *state)); // handle
void ipc_out(IpcResponse *rs, const void *p, uint32_t n);
const void *ipc_arg(const IpcRequest *rq, uint32_t off, uint32_t n);
@@ -66,3 +76,5 @@ uint64_t ipc_sessions_released(void);
// The guest frame chain of the request being served, for fatal reports from services.
void ipc_backtrace(void);
void ipc_applet_event_init(void); // call once at boot, before the guest starts
void ipc_applet_push_message(uint32_t msg); // queue an AppletMessage and signal the applet event