mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-09-26 08:51:05 -04:00
91592e3faa
* [runtime] Memory swizzling rework Reimplementation of memory swizzling supporting all valid GS texture storage types. An additional optimization was done to improve the speed of lookups. Since page access is linear, we can precompute the non-linear bit (blocks and columns) for an entire page for each format. This reduces the runtime calculation to just calculating the correct page in 2d memory space and then performing a lookup in the table to get the location in memory inside a page. Since all page accesses are the same, this works across all pages. Speed improvements should be compounded by the number of accesses but there might be some reductions as a result of actually implementing formats that were not implemented before. I took care to do this with simple math. GS swizzling is complicated and optimizing it for debug builds is outside the scope of my current work. This is just the standalone code. It will be worked into the current rasterizer in a follow up commit. * [runtime] Reimplement GS host -> local transfers Reimplement the host -> local transfers using new swizzling code * [runtime] Reimplement sampling with new swizzling Reimplements the rasterizer sampling code to use the new swizzling code * [runtime] Replace fb writes with new swizzling Replace the framebuffer write code with the new swizzling code * [runtime] Reduce vram read/write to func lookup Reduces the vram read write switches to a function lookup * [tests] fix GS tests not handling depth test * [runtime] z interpolation and write support Add support for interpolating z from primitives and writing to the z buffer after z testing and masking * [runtime] local to local transfer rework * [runtime] host readout uses new sizzling code plus cleanup some dead code * [runtime] rework local->host transfer update to the new swizzling code * [runtime] update clear function with new swizzling