From db9b359b8b2dd0cb47bfef7319d214c7c326774e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 2 May 2025 07:16:29 +1000 Subject: [PATCH] Optimise vertex upload --- misc/n64/gpu.c | 41 +++++++++++++------------ misc/n64/rsp_gpu.S | 56 +++++++++++++++-------------------- misc/n64/rsp_gpu_clipping.inc | 6 ++++ 3 files changed, 50 insertions(+), 53 deletions(-) diff --git a/misc/n64/gpu.c b/misc/n64/gpu.c index b3d4399af..92a7fde13 100644 --- a/misc/n64/gpu.c +++ b/misc/n64/gpu.c @@ -34,7 +34,7 @@ enum { GPU_CMD_SET_LONG = 0x3, GPU_CMD_DRAW_QUAD = 0x4, - GPU_CMD_UPLOAD_VTX = 0x5, + GPU_CMD_UPLOAD_QUAD = 0x5, GPU_CMD_MATRIX_LOAD = 0x6, GPU_CMD_PUSH_RDP = 0x7, @@ -156,41 +156,40 @@ static inline void put_word(rspq_write_t* s, uint16_t v1, uint16_t v2) rspq_write_arg(s, v2 | (v1 << 16)); } -static void upload_vertex(uint32_t index, uint8_t cache_index) +static void upload_vertex(rspq_write_t* s, uint32_t index) { - rspq_write_t s = rspq_write_begin(gpup_id, GPU_CMD_UPLOAD_VTX, 5); - rspq_write_arg(&s, cache_index * PRIM_VTX_SIZE); char* ptr = gpu_pointer + index * gpu_stride; float* vtx = (float*)(ptr + 0); - put_word(&s, vtx[0] * (1<