mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 05:49:57 -04:00
Map Ocarina's global memory accesses through pointer tables and summed bases to storage buffers.
The translator dropped 36113 global accesses per Kokiri boot (loads read 0, stores and atomics deleted); 837 remain. AmpereLowering computes a predicated LEA's carry sum unconditionally, so a base like c[0][0x110] no longer reaches the address as a phi; the edge AA's tile list is written and its blend weights follow the edges. Patch 0022 extends GlobalToStorage: a constant-buffer base inside a sum of terms, and buffers reached through a pointer the program loads from another storage buffer at a constant offset (the pointer tables Ocarina's vertex, pixel, mesh and compute shaders read, also through register spills and phis). Such a buffer is listed with its outer buffer and offset, and the runtime binds it at the address read from guest memory when the stage is bound (vk_exec_draw.c ptr_addr). The fog injection's 64x36x96 volumes now hold in-scattering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,8 @@ typedef struct {
|
||||
uint16_t count; // descriptors (array length)
|
||||
uint8_t separate; // TEX: texture and sampler handles are separate
|
||||
uint8_t pool; // TEX: 1 the texture pool, 2 the sampler pool, indexed by bindless handles (set 2)
|
||||
uint16_t ptr; // SSBO: 0, or 1 + the byte offset of this buffer's address inside the storage buffer that
|
||||
// cbuf_slot and handle name (a pointer table; the translator's patch 0022, res.json "ptr")
|
||||
} GfxShaderRes;
|
||||
typedef struct { uint8_t type, comps, packed; } GfxShaderIo; // GFX_TYPE_*, components, 1 with a Component decoration
|
||||
int gfx_shader_stage(const GfxShader *s); // GFX_STAGE_VS, GFX_STAGE_FS or GFX_STAGE_CS
|
||||
|
||||
Reference in New Issue
Block a user