Commit 91592e3
authored
GS rasterizer rework (#132)
* [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 swizzling1 parent 790aaf4 commit 91592e3
10 files changed
Lines changed: 1818 additions & 788 deletions
File tree
- ps2xRuntime
- include
- runtime
- src/lib
- ps2xTest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
109 | 114 | | |
110 | 115 | | |
111 | 116 | | |
| |||
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
| |||
168 | 180 | | |
169 | 181 | | |
170 | 182 | | |
171 | | - | |
| 183 | + | |
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
| |||
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
252 | 267 | | |
253 | 268 | | |
254 | 269 | | |
| |||
292 | 307 | | |
293 | 308 | | |
294 | 309 | | |
295 | | - | |
296 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
297 | 318 | | |
298 | 319 | | |
299 | 320 | | |
| |||
318 | 339 | | |
319 | 340 | | |
320 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
321 | 348 | | |
322 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
323 | 360 | | |
0 commit comments