Commit Graph

9567 Commits

Author SHA1 Message Date
Henrik Rydgård 8b10ee3937 Depth Z: Add a stat for Z-culling, correctly distinguish the small/backface stats 2024-12-28 18:45:03 +01:00
Henrik Rydgård 449e3e1360 Very minor soft transform optimization 2024-12-28 18:45:03 +01:00
Henrik Rydgård eec7853efe More SIMD: Add some matrix operations to CrossSIMD (#19773)
* More CrossSIMD functionality

* Use the new SIMD API for the matrix multiplies
2024-12-28 18:45:14 +01:00
Henrik Rydgård 8c069917b5 Depth raster optimizations: Merge viewport into projection matrix, prepare for further SIMD-ification (#19769)
* Remove some old redundant reports

* Fix scissor off by one

* More CrossSIMD

* Move the viewport scale out to the proj matrix

* DepthRaster: Also merge the viewport translation into the projection matrix.

* Depth raster: Do the triangle clipping in batches of 4 triangles

* Cleanup
2024-12-28 10:36:39 +01:00
Henrik Rydgård cc040ab251 Depth raster: Bugfix, minor opt (#19768)
* Correct two errors in CrossSIMD.h, thanks hiroyuki177

Fixes #19767

* DepthRaster: Merge offset into viewport X/Y
2024-12-26 20:23:52 +01:00
Henrik Rydgård 4aaea67766 Enable depth raster in all backends, not just Vulkan 2024-12-24 23:26:32 +01:00
Henrik Rydgård 0e59cd7641 DepthRaster: Fix typo breaking LESS depth comparison mode on x86(64) 2024-12-24 23:26:32 +01:00
Henrik Rydgård b39a09e87b Specialize DepthRasterTriangle for the comparison modes using templating. 2024-12-22 19:24:12 +01:00
Henrik Rydgård ab088cf158 Depth raster: Clip rects to scissor too. Fixes some crashes 2024-12-22 14:14:55 +01:00
Henrik Rydgård 03f09aebd7 Enable software depth raster for Wipeout, Midnight Club LA, Resistance.
Adds a setting to control it under speedhacks, named "Lens flare
occlusion". The setting includes a low quality mode which is not yet
implemented.
2024-12-22 10:48:46 +01:00
Henrik Rydgård 3ccb01b09c Depth Raster: Add more stats, discard triangles with < 10 px area. Still good results. 2024-12-22 10:32:20 +01:00
Henrik Rydgård 19434ff303 Keep the depth in floating point to save some conversions 2024-12-22 10:32:19 +01:00
Henrik Rydgård 0629a98f97 Add some depth raster stats 2024-12-22 10:32:15 +01:00
Henrik Rydgård d53635e096 Optimize the triangle inner loop a little more 2024-12-22 10:32:15 +01:00
Henrik Rydgård 2371fdfedd Rework depth raster to fully support software transform 2024-12-21 21:22:22 +01:00
Henrik Rydgård 80cb57f8bb Cleanup 2024-12-21 14:28:01 +01:00
Henrik Rydgård 5df88fc1aa Convert the rect implementation to CrossSIMD 2024-12-21 14:28:01 +01:00
Henrik Rydgård 73ae6da757 Reimplement the depth rasterizer with SIMD. 2024-12-21 14:28:00 +01:00
Henrik Rydgård d1b50ea543 Comment 2024-12-21 14:28:00 +01:00
Henrik Rydgård ad1809875a Minor sign check optimization 2024-12-21 14:28:00 +01:00
Henrik Rydgård f886578c0e DepthRaster: Fix backface culling 2024-12-21 14:28:00 +01:00
Henrik Rydgård a344d0225f DepthRaster: Fix bug where we used the wrong vertex count. 2024-12-21 14:28:00 +01:00
Henrik Rydgård 820e7369b9 Speed up DepthRasterClipIndexedTriangles with CrossSIMD 2024-12-21 14:28:00 +01:00
Henrik Rydgård 67078d439b Depth raster: Switch to a SoA data layout for the screen space verts 2024-12-21 14:28:00 +01:00
Henrik Rydgård 6a1010afb0 Use CrossSIMD to optimize DecodeAndTransformForDepthRaster
Checked the output, the generated assembly is great!
2024-12-21 14:28:00 +01:00
Henrik Rydgård bdf4b69207 Warning fixes, minor cleanup 2024-12-21 14:28:00 +01:00
Henrik Rydgård bdb5f3a91b Reorganize the depth vertex pipeline for future optimizations 2024-12-21 14:27:59 +01:00
Henrik Rydgård dd31518272 DepthRaster: Merge the decode and transform steps 2024-12-21 14:27:59 +01:00
Henrik Rydgård c7f0eabc65 DepthRaster: Premultiply world-view-proj matrices 2024-12-21 14:27:59 +01:00
Henrik Rydgård c92b3b6521 Move prototype cross simd wrapper structs to CrossSIMD.h 2024-12-21 14:27:59 +01:00
Henrik Rydgård 72c954d8c3 Add convenient wrappers 2024-12-21 14:27:59 +01:00
Henrik Rydgård 09afe363ca One less operation in the inner loop 2024-12-21 14:27:59 +01:00
Henrik Rydgård d27d8c9dae Remove subpixel precision. Some sketching. 2024-12-21 14:27:55 +01:00
Henrik Rydgård c5ad81e3d5 Add DepthRaster.cpp/h. Rasterize depth rectangles, some triangles 2024-12-21 14:27:53 +01:00
Henrik Rydgård 1c2f11a468 Buildfix 2024-12-19 16:57:57 +01:00
Henrik Rydgård d5bfc1b5eb Finish up this cleanup (move _M_SSE compat define out of Common.h) 2024-12-19 16:23:20 +01:00
Henrik Rydgård e93c80db4e Cleaning up our SIMD header includes, using the new header 2024-12-19 16:08:48 +01:00
Henrik Rydgård 5326d87f9c Rename CrossSIMD to SIMDHeader, but also keep CrossSIMD.h (will have a future use) 2024-12-19 15:15:43 +01:00
Henrik Rydgård c91169e702 Restore removed <algorithm> includes.
Turns out these were needed after all. For some reason, on Windows and
Mac, <algorithm> gets auto-included by something else so I don't notice
when it's missing, and MSVC's include dependency tracker doesn't see it
either.
2024-12-19 09:53:07 +01:00
Henrik Rydgård 4dd3621fa0 Remove some unnecessary <algorithm> includes. 2024-12-18 17:04:27 +01:00
Henrik Rydgård 45cf6d423e Buildfixes 2024-12-18 13:57:29 +01:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård ee297e974d Move more code into SoftwareTransformCommon, cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 0b06cd1379 Actually avoid looking up the vertex decoder more than once 2024-12-17 22:42:07 +01:00
Henrik Rydgård 15b4f0c299 Lookup the decoder outside of DrawEngine 2024-12-17 19:27:01 +01:00
Henrik Rydgård 61b14df329 Delete obsolete empty function ClearTrackedVertexArrays 2024-12-17 19:15:25 +01:00
Henrik Rydgård fe4504f612 Small simplification 2024-12-17 19:15:06 +01:00
Henrik Rydgård a2a089b8c1 Remove the member function NormalizeVertices 2024-12-17 19:15:03 +01:00
Henrik Rydgård a07da939ef Some NormalizeVertices interface cleanup 2024-12-17 19:13:38 +01:00