Compare commits

...

2048 Commits

Author SHA1 Message Date
JordanTheToaster
8f367abe0b GameDB: Ace Combat 5 Fixes
Adds texture preloading partial to Ace Combat 5 for better performance.
2022-08-10 06:44:20 +01:00
Mrlinkwii
fdc84be0d9 Gamedb: upscaling fixes for Shadow of Rome 2022-08-10 06:44:00 +01:00
BreakPoints
edfceaad14 Qt: Force helpText size to avoid overflow at default size
Increase minimum size of helpText to match max
2022-08-09 15:35:52 +01:00
JordanTheToaster
40fda5067d GameDB: Add DBZ Budokai Tenkaichi 2 fixes
Adds half pixel offset normal to DBZ BT 2 and removes full round sprite to fix the insane amount of ghosting in some areas
2022-08-09 15:33:42 +01:00
lightningterror
573706e5e4 GS-hw: Don't disable second output on blend mix when using constant factor.
We don't want to disable second output when using blend mix1 above 1.0f Af.
Reason is we change Af to As and later output it on second output for hw blending.
2022-08-08 18:11:28 +02:00
PCSX2 Bot
1ef4acc2af PAD: Update to latest controller database. 2022-08-08 18:11:16 +02:00
lightningterror
6035db3231 GS-d3d11: Disable blending when color isn't written.
Fixes d3d11 crashing on mgs3 using intel igpu.
2022-08-08 12:51:17 +02:00
Mrlinkwii
2cd44412f6 Gamedb: upscaling fixes for Poison Pink/ Eternal Poison 2022-08-08 11:21:14 +01:00
JordanTheToaster
c149fe31fb GameDB: Add missing Korean serials
Adds missing Korean serials as well as the accompanying fixes
2022-08-08 04:40:02 +01:00
JordanTheToaster
0e24d638c9 GameDB: Fixes for Devil Kings
Adds Special HPO to Devil Kings
2022-08-07 20:37:31 +01:00
JordanTheToaster
5c056f0c4d GameDB: Add Disaster Report fixes
Adds auto flush to Disaster Report to correct an inaccurate blur filter
2022-08-07 18:57:35 +01:00
lightningterror
62b838427f GS-hw: Purge tri ace crc hacks.
Star Ocean 3, Valkyrie Profile 2, Radiata Stories.

The crc hacks aren't that needed anymore since right now D3D is much faster than it used to be.
2022-08-07 14:13:56 +02:00
BreakPoints
ad529c10ab Qt Updater: Copy new icon to updater
So that the updater benefits from the new icon changes in #6785 (file size, sharpness of small icon sizes)
2022-08-07 13:09:26 +01:00
noigeaR
8ef7399612 GameDB: Add missing Japanese games (#6790) 2022-08-07 13:08:59 +01:00
JordanTheToaster
939c1f0f29 GameDB: Add 007 NightFire fixes
Adds half pixel offset special to 007 NightFire
2022-08-07 13:08:22 +01:00
lightningterror
6b48cf574d GS-hw: Adjust how we handle specific blend mix cases.
Replace Cs*As + Cd*(1 - As) with Cs*As - Cd*(As - 1).
Replace Cs*F + Cd*(1 - F) with Cs*F - Cd*(F - 1).
As - 1 or F - 1 subtraction is only done for the dual source output (hw blending part)
since we are changing the equation.
Af will be replaced with As in shader and send it to dual source output.

Also check if A*Alpha in the shader overflows, if it does then adjust the
alpha that is sent for HW blending further to compensate.
2022-08-07 14:08:04 +02:00
Mrlinkwii
1478819258 GS-hw: Purge SkyGunner crc hacks. 2022-08-07 03:07:04 +02:00
Mrlinkwii
f53fbd6282 GS-hw: Purge MidnightClub3 crc hacks. 2022-08-07 03:06:51 +02:00
lightningterror
60e6e1f242 Qt: Fix Wunused-but-set-variable warnings. 2022-08-07 03:00:22 +02:00
lightningterror
7a5f63e0f5 GS-metal: Move PABE shader bit to the top of sw blending.
Early return when there is no sw blending, no need to run the blend code.
Optimization.
2022-08-06 17:36:24 +02:00
refractionpcsx2
c0e325dfbf GS-HW: Correct FBMask masks for texture shuffles 2022-08-06 12:35:16 +01:00
JordanTheToaster
62e775b7c2 GameDB: Correct The Incredible Hulks name
Corrects the name of the PAL version of The Incredible Hulk and adds missing demo version to the db
2022-08-06 11:52:44 +01:00
BreakPoints
37676a296a UI: Update all sizes of App Icon (#6785) 2022-08-06 10:12:52 +01:00
Connor McLaughlin
bcc4548f7b GS/HW: Clamp draw rect to unscaled, not scaled coordinates
Fixes broken shuffle effect in Haunting Ground when upscale is set above
1x.
2022-08-06 06:13:30 +01:00
JordanTheToaster
60714b5ca4 Qt Updater: Fix use of old icons
Fixes the updater seemingly using the old style of PCSX2 icon.
2022-08-06 00:13:59 +02:00
Mrlinkwii
d632634e56 Gamedb: add basic mipmap to Blood Omen 2 2022-08-05 19:17:14 +01:00
lightningterror
bec8b40edb GS-wx: Remove some unused upscale code for renderer tab. 2022-08-05 11:41:29 +02:00
lightningterror
ab361eef72 GS-wx: Fix Wunused-but-set-variable warning. 2022-08-05 11:37:50 +02:00
Connor McLaughlin
1f16adbca7 GS/Vulkan: Don't use clear attachments on cleared RT/DS
Redundant.
2022-08-05 07:16:53 +01:00
Connor McLaughlin
1677ef3189 GS/TextureCache: Elide copies when source matches target
Assuming everything matches up, instead of copying the target, we can just sample it directly.
It's the same as doing the copy first, except we save GPU time.
2022-08-05 07:16:53 +01:00
Connor McLaughlin
36defdfbe9 GS: Use tex-is-fb for sprites/shuffles 2022-08-05 07:16:53 +01:00
Mrlinkwii
7ba6e4adc3 Gamedb: remove not needed upscaling fixes for God of war 2022-08-05 00:19:55 +01:00
TheLastRar
ee2cbc80b8 DEV9: Sockets: Set Arp Hardware Type 2022-08-03 21:05:40 +02:00
lightningterror
b4d960e795 GS-ogl: Remove bad driver messages for intel/amd.
AMD has new gl drivers which work well now.
For intel it's not really needed as the log may be useful for broadwell or lower igpu.
2022-08-03 20:57:47 +02:00
lightningterror
0f716d9053 GS-hw: Fix dithering log. 2022-08-03 20:54:30 +02:00
JordanTheToaster
cdbfd22296 GameDB: Corrects name of Asterix & Obelix XXL2
Fixes the incorrect name of Asterix & Obelix XXL
2022-08-03 19:34:10 +01:00
Goatman13
de801a4f23 GameDB: Replace Evolution Snowboarding patches.
Instead of skipping videos, patches extend stack in problematic function. So required data is no longer overwritten. Workaround for missing EE data cache emulation.
2022-08-03 11:46:51 +02:00
JordanTheToaster
1376a615b7 GameDB: Misc compat level fixes
Fixes some out of date compat levels
2022-08-03 09:51:23 +01:00
noigeaR
1fbc9ab85e GameDB: add Panzer Elite Action upscaling fix 2022-08-03 09:51:00 +01:00
refractionpcsx2
9a8a3601a7 UI-Qt: Add Bilinear dropdown to SW options 2022-08-02 23:35:48 +01:00
refractionpcsx2
f1e68e9bd0 GS: Don't double res on No-Interlace patch when interlaced 2022-08-02 23:35:35 +01:00
ichee
5228e6e6c7 GameDB: Fixes Dual Hearts FMV's not being deinterlaced
Deinterlacing is not being applied causing the FMV's to be offset. This forces blend tff.

Fixes #6715.
2022-08-02 11:36:24 +01:00
PCSX2 Bot
5b977cef54 PAD: Update to latest controller database. 2022-08-01 23:43:45 +02:00
refractionpcsx2
a802deeb51 GameDB: Add round sprite full for DMC3, reduces blur. 2022-08-01 21:07:30 +01:00
JordanTheToaster
eaf6375410 GameDB: Maximo vs Army of Zin Fixes
Adds fixes and adds a missing entry in the DB for the Korean version.
2022-08-01 16:54:00 +01:00
JordanTheToaster
d1daf21a3f GameDB: Misc fixes
Fixes many problems with many games and adds missing hacks and fixes.
2022-08-01 14:02:13 +01:00
Risae
98c83c8509 GameDB: Add fixes for Growlanser V & Growlanser VI 2022-08-01 09:02:10 +01:00
Mrlinkwii
b25731f621 Gamedb:upscaling fixes for "dot hack Infection Part 1" 2022-07-31 19:50:01 +01:00
Mrlinkwii
563f5ec713 Gamedb: add partial preload to "Hitman Contracts" 2022-07-31 12:36:48 +01:00
refractionpcsx2
ad25ae43d5 GameDB: Disable Instant VU for Juiced 2022-07-31 10:58:51 +01:00
refractionpcsx2
b058e72fdd VIF: Wait for VU on flush + clang format
Improves performance in MTVU + Non-instant a little.
2022-07-31 10:58:51 +01:00
refractionpcsx2
38ee8ccfe3 VU: Fix some bugs, ignore VU's in EE Timing Hack 2022-07-31 10:58:51 +01:00
refractionpcsx2
53161f76a6 VU-MTVU: Simulate VU times when in MTVU w/o Instant VU. 2022-07-31 10:58:51 +01:00
Connor McLaughlin
742a929966 GS: Purge sparse texture
Only worked on a limited number of drivers, not reliable, and not
necessary now that we're reducing target sizes, which works better
anyway.
2022-07-31 10:58:39 +01:00
Connor McLaughlin
63b3646e73 GS/TextureCache: Expand perfect-matched targets for display when needed
Hitman Contracts draws a line near the bottom of the screen, presumably
with a smaller scissor, then scans out 448 lines. Which meant the merge
oversampled and smeared.
2022-07-31 10:39:35 +01:00
refractionpcsx2
794c73a613 GS-debug: Fix GSDumps when rt or ds is null. 2022-07-31 08:21:22 +01:00
JordanTheToaster
59fc2a4c15 GameDB: WRC 4 Fixes
Fixes misaligned text and car shadow softness.
2022-07-30 22:15:44 +01:00
Connor McLaughlin
6a144f86cf GS: Improve target size calcs and remove conservative framebuffer 2022-07-30 17:16:59 +01:00
refractionpcsx2
f218e11d78 GS: Rearrange GS Dump names to be less annoying to navigate 2022-07-30 17:16:35 +01:00
JordanTheToaster
f6bcd8a2c2 GameDB: Various texture preloading fixes
Fixes performance problems when texture preloading is set to Full (Hash Cache).
2022-07-30 17:08:23 +01:00
JordanTheToaster
bf0cd5a6cd Qt: Recommended text fixes
Fixes some missing or incorrect recommended boxes.
2022-07-29 13:42:31 +01:00
tellowkrinkle
fc1504f2e5 GHActions: Properly label Linux AVX2/SSE4 releases 2022-07-28 20:45:23 -05:00
Stuart Kenny
7b4d545dca GameDB: Ridge Racer V upscaling fixes. 2022-07-28 22:27:12 +01:00
JordanTheToaster
89f27d0b2d Qt: Change cycle skipping text
Changes the cycle skipping default level text from "Normal" to "None".
2022-07-28 20:54:55 +01:00
Anderson_Cardoso
3728f42185 GUI-Qt: Updated Controller Image (#6729) 2022-07-28 11:52:03 +01:00
lightningterror
2d6c4c6aee GameDB: Change halfPixelOffset normal to special for shadow hearts series.
Normal breaks shadows.
2022-07-28 12:47:14 +02:00
lightningterror
83b8ec6a99 cheats_ni: Cleanup no interlace patches. (#6717)
Remove widescreen, blur, and other crap patches that shouldn't be here.
Affected crcs 1F34E107,14DDB291,71B142EC,586EA828,64328775,A8D83239
2022-07-27 14:04:16 +02:00
Jordan
5e87f6d806 GameDB: Energy Airforce fixes (#6714)
Adds autoflush to Energy Airforce Aim Strike.
2022-07-26 18:50:27 +02:00
Mrlinkwii
f2da932777 GameDB: Correct title for Mushihimesama 2022-07-26 13:10:30 +01:00
refractionpcsx2
4b3e6d7a58 GS: Flush any pending draws on reset. 2022-07-25 22:04:16 +01:00
Mrlinkwii
c50d671bdb GameDB: add 'VUSyncHack' to Air Ranger - Rescue Helicopter 2022-07-25 19:57:33 +01:00
PCSX2 Bot
5290cbea94 PAD: Update to latest controller database. 2022-07-25 18:12:34 +02:00
Connor McLaughlin
f6b55a4e19 GS/Vulkan: Fix incorrect render pass for stencil DATE 2022-07-25 14:33:09 +01:00
Mrlinkwii
4e0d2207a3 GameDB: add gamefixes to cod 2 and fix titles 2022-07-25 00:53:13 +01:00
icup321
f089d5714f GameDB: Add mipmap fixes to Toshi engine games (#6680) 2022-07-24 16:24:00 +01:00
Connor McLaughlin
be26c04dd1 Qt: Asynchronous loading of covers 2022-07-24 16:22:37 +01:00
Connor McLaughlin
cbcfe37e28 Common: Add LRUCache 2022-07-24 16:22:37 +01:00
Connor McLaughlin
ef0fde8615 CI: Use Qt 6.3.1 for all platforms 2022-07-24 16:22:37 +01:00
Connor McLaughlin
cc728642ed Qt: Allow changing theme without recreating window 2022-07-24 15:42:29 +01:00
Connor McLaughlin
d9360a66af Qt: Fix bindings not applying after profile load/reset 2022-07-24 15:15:27 +01:00
Connor McLaughlin
4040f7afca Qt: Fix game list not resizing after resize+shutdown game 2022-07-24 15:15:27 +01:00
JordanTheToaster
758c347258 GameDB: GoW Fixes 2022-07-24 14:20:31 +01:00
JordanTheToaster
cf76a605d2 GameDB: Arean Football fixes 2022-07-24 10:00:34 +01:00
refractionpcsx2
1cfcfc465e GS: CLUT Invalidation on transfer accounts for offset. 2022-07-24 10:00:14 +01:00
refractionpcsx2
fc611dee57 GS-PCRTC: Remove frame offset from anti-blur hacks in software.
Turns out this is now more detrimental than an improvement
2022-07-24 09:59:58 +01:00
refractionpcsx2
de8b23db4e GS-SW: Fix framebuffer looping at 2048 height.
Also limit height read on hardware to 2048
2022-07-24 09:59:58 +01:00
Jordan
b036dcece6 GameDB: Urban Chaos fixes. (#6690) 2022-07-23 22:08:06 +02:00
BreakPoints
94c83245db GameDB: Missed R&C3 and R&C4 Fixes
Adds fixes for bloom from #6688 to remaining R&C3 and R&C4 entries
2022-07-23 16:15:51 +01:00
JordanTheToaster
c14146926a GameDB: Add COP2 patch 2022-07-23 00:13:43 +01:00
JordanTheToaster
29dffd06b3 GameDB: R&C3 and R&C4 Fixes 2022-07-22 21:35:11 +01:00
JordanTheToaster
9646d18624 GameDB: Urban Reign fixes 2022-07-22 16:37:20 +01:00
lightningterror
170d9a27ff cheats_ws: Disable unnecessary patches.
60 fps, progressive, interlace, ghosting, blur, drain, draw distance, skip draws and more.

Shouldn't be here to begin with.
2022-07-22 10:49:56 +02:00
JordanTheToaster
4d43374b31 GameDB: God Of War 2 Fixes 2022-07-22 09:30:41 +01:00
NicknineTheEagle
085332da27 GameDB: Fix glows in Disney-Pixar Ratatouille. (#6597)
Enable Auto Flush GS HW hack in Disney-Pixar Ratatouille.
2022-07-22 03:56:25 +02:00
rufotheone-fr
4dae3ee33b GameDB: check & fix of titles + add of missing serial (numbers) (#6681) 2022-07-21 17:44:37 +01:00
Daisouji
dd729ec649 QT: Change Pathing
Formatted MainWindow.cpp code
2022-07-21 11:59:00 +02:00
Daisouji
9ef582bd6f QT: Implements 2 Theming options
Added 2 New Theme options.
2022-07-21 11:59:00 +02:00
rufotheone-fr
a4fec6323c GameDB: Addition of missing serials and fixes of some titles. (#6678) 2022-07-21 02:23:29 +02:00
Alban Zekthi
4e9d56441a GameDB: Game title and Ace Combat updates. (#6600)
Fixed some game titles; added halfPixelOffset: 3 to Ace Combat 5 and Zero; adding mergeSprite: 1 to all Ace Combat
2022-07-21 02:20:33 +02:00
JordanTheToaster
af71ae9dd9 QT: Add missing gamefix dialog 2022-07-20 21:35:08 +01:00
Mrlinkwii
305563e44f Gamedb: GShw fixes for Spider-Man 2 2022-07-20 12:47:55 +01:00
lightningterror
f042fd2e88 GS-config: Remove AA1 toggle config leftovers. 2022-07-20 00:32:42 +02:00
lightningterror
5a13932dd9 GS: Remove AA1 gui condition, it will always be enabled. 2022-07-20 00:32:42 +02:00
lightningterror
06c9967971 Qt: Remove AA1 option from the gui. 2022-07-20 00:32:42 +02:00
lightningterror
6e8d667c6a Wx: Remove AA1 option from the gui. 2022-07-20 00:32:42 +02:00
noigeaR
0529ce2bc4 GameDB: Fix and add Japanese game names, apply upscaling fixes 2022-07-19 22:43:41 +01:00
kenshen112
639552ae8f CDVD: Change CDVDaccess to CDVDcommon 2022-07-19 22:36:31 +01:00
JordanTheToaster
0d1cc8581a QT: Change MTVU recommendation 2022-07-19 21:49:41 +01:00
PCSX2 Bot
ed54b55a63 PAD: Update to latest controller database. 2022-07-19 00:35:42 +02:00
C.W. Betts
12d8a1f92e fix build error when recording is disabled. 2022-07-18 10:49:09 +01:00
refractionpcsx2
ed76e54904 GS: Move force_a_one to IsCoverageAlpha function 2022-07-18 09:40:21 +01:00
refractionpcsx2
c2bb936586 GS-HW: Added DATE check for AA1
Also fix bug when DATE+FBA is on and alpha is masked (rare)
2022-07-18 09:40:21 +01:00
refractionpcsx2
42b334efcd GS-HW: Use correct alphas when AA1 is enabled + ABE disabled. 2022-07-18 09:40:21 +01:00
Mrlinkwii
56367f257a Gamedb: clean-up game titles 2022-07-18 09:35:04 +01:00
refractionpcsx2
55db243362 GUI-Qt: Avoid divide by zero on empty gamelist folder. 2022-07-18 08:47:57 +01:00
refractionpcsx2
395f4e904c GUI-Qt fix full screen toggle hotkey 2022-07-18 01:52:26 +01:00
Connor McLaughlin
3c5a39a99a GS/OpenGL: Fix incorrect detection of DXT/BPTC texture support 2022-07-17 23:40:24 +01:00
rufotheone-fr
572c3be647 GameDB: Update names for localisation (#6661) 2022-07-17 23:40:05 +01:00
Connor McLaughlin
06e7d6c3df Qt: Hide system console if enabled in nogui mode 2022-07-17 23:29:48 +01:00
Connor McLaughlin
bcde888257 Qt: Restore geometry before going fullscreen
Fixes fullscreen with separate window on another monitor popup switching
the fullscreen monitor case.
2022-07-17 23:29:48 +01:00
Connor McLaughlin
1767213321 Qt: Fix CRC in game list showing in lowercase 2022-07-17 23:29:48 +01:00
Connor McLaughlin
b36b4e4ad1 Qt: Hide main window when in fullscreen 2022-07-17 23:29:48 +01:00
Connor McLaughlin
8857eb4e78 Qt: Fix state not being saveable on separate window close 2022-07-17 23:29:48 +01:00
Connor McLaughlin
fce3414c65 INISettingsInterface: Don't try to save with no filename 2022-07-17 23:29:48 +01:00
Connor McLaughlin
f0f23a2c61 Qt: Elide redundant scan progress updates
Fixes UI locking up for ages when switching theme.
2022-07-17 23:29:48 +01:00
Connor McLaughlin
a77f78f08f Qt: Replace hotkey tabs with a scrollable view 2022-07-17 23:29:48 +01:00
Connor McLaughlin
9269792a8c Qt: Move hotkeys to VMManager, remove sorting 2022-07-17 23:29:48 +01:00
Connor McLaughlin
e87d507c0c GameList: Populate game list from cache in batch mode
Stop-gap until we make CDVD/scanning thread-safe, and can create game
list entries on demand.
2022-07-17 23:29:48 +01:00
Connor McLaughlin
5fc07180dd Qt: Add -nogui command line parameter 2022-07-17 23:29:48 +01:00
Connor McLaughlin
a35990ee4c Qt: Move Main.cpp to QtHost.cpp 2022-07-17 23:29:48 +01:00
Connor McLaughlin
7d71954674 Qt: Add search/filter toolbar 2022-07-17 23:29:48 +01:00
Connor McLaughlin
1cee55bf45 Qt: Fix game list glitching out in X11 2022-07-17 23:29:48 +01:00
Connor McLaughlin
c11ca2ff64 GS/TextureCache: Remove redundant CLUT read 2022-07-17 16:23:49 +01:00
Connor McLaughlin
f88756cb53 Qt: Add crop options 2022-07-17 15:34:20 +01:00
JordanTheToaster
54d284cdac GameDB: MGS 2 texture preload to partial 2022-07-17 12:23:57 +01:00
Mrlinkwii
011d6bebfa Github: clean-up issue templates 2022-07-16 21:41:58 +01:00
Mrlinkwii
447dc54710 Gamedb: missing serial 2022-07-16 21:38:34 +01:00
refractionpcsx2
e2ff6327eb IPU: Adjust timing on IDEC/BDEC after IPU0 transfer 2022-07-16 18:43:19 +01:00
macmmm81
a293b6fc77 Periodication 2022-07-16 11:16:03 +01:00
macmmm81
e56ffc689d GameDB: add The Sims 2 missing fixes 2022-07-16 11:16:03 +01:00
macmmm81
4cca6a72d8 GameDB: add The Sims 2 missing fixes 2022-07-16 11:16:03 +01:00
Mrlinkwii
6e79b29678 GameDB: various GSHWFixes 2022-07-16 04:07:39 +01:00
noigeaR
a432ffc0ce GameDB: fixes for Taiko no Tatsujin series
Correct names and add fixes for hw rendering and upscaling for the Taiko no Tatsujin series
2022-07-16 04:04:04 +01:00
lightningterror
205cb2c29d iCore: Fix more negative array index warnings.
Forgot these.
Codacy.
2022-07-15 17:50:41 +02:00
lightningterror
1594b46f68 iCore: Fix negative array index warning.
Codacy.
2022-07-15 15:55:38 +02:00
lightningterror
e1e7791dff Core: Bump savestate version. 2022-07-15 15:55:38 +02:00
lightningterror
d3accbc085 USB: Fix struct member 'structname::variable' is never used warnings.
Codacy.
2022-07-15 15:55:38 +02:00
lightningterror
69cc5a559e PAD: Fix struct member 'structname::variable' is never used warnings.
Codacy.
2022-07-15 15:55:38 +02:00
lightningterror
9f8f2f6730 GS-tc: Fix condition is always true warning.
Codacy.
2022-07-15 15:55:38 +02:00
lightningterror
498eb9330b USB: Fix array index 'i' is used before limits check warning.
Codacy.
2022-07-15 15:55:38 +02:00
lightningterror
6047322f0c USB: Fix a condition is always false warning.
Codacy.
2022-07-15 15:55:38 +02:00
rufotheone-fr
2ce6a031a4 Update GameIndex.yaml 2022-07-15 12:33:44 +01:00
rufotheone-fr
323bab7d4a Update GameIndex.yaml 2022-07-15 12:33:44 +01:00
refractionpcsx2
73f45b8772 GS-OGL: Remove wide line support (deprecated in OGL Spec). 2022-07-15 13:19:41 +02:00
BuildTools
a9407f055c GameDB: Disable texture preloading in Xenosaga Episode III 2022-07-15 11:05:33 +01:00
MetrosexualGarbodor
2eb1134828 GameDB: remove texture inside RT from Xenosaga Episode III 2022-07-14 15:14:03 +02:00
Mrlinkwii
7e35571b94 Gamedb: autoflush for Burnout Dominator/ Revenge 2022-07-13 20:13:05 +01:00
Mrlinkwii
19f7e3631a Gamedb: add missing MGS3 HWfixes 2022-07-12 21:09:08 +01:00
Mrlinkwii
094f2da774 Gamedb: add EEclamping for "Cowboy Bebop" and autoflush for burnout 3 2022-07-12 20:28:57 +01:00
Goatman13
1b9d22a491 GameDB: Remove Musashi SPS patches/fixes.
No needed anymore.
2022-07-12 10:02:28 +01:00
Goatman13
df1e19dd47 COP2: Fix CTC2 to R register
Only 23 bits are writable. Upper 9 bits are hardcoded to 001111111.
2022-07-12 10:02:28 +01:00
github-actions[bot]
8c4fa838fe PAD: Update to latest controller database. (#6610)
Co-authored-by: PCSX2 Bot <PCSX2Bot@users.noreply.github.com>
2022-07-11 18:11:17 +02:00
refractionpcsx2
2f6df2f9af GS: Fix scanmask interlace offsetting on even numbers 2022-07-11 15:16:11 +01:00
refractionpcsx2
446b0c2dfa GS: CLUT - check the whole page range of transfer for CLUT clear. 2022-07-11 12:19:32 +01:00
refractionpcsx2
0eb963d491 GS: Remove needless flush check on Host->Local write. 2022-07-10 17:50:05 +01:00
refractionpcsx2
156484ac80 GS: Invalidate CLUT by page
Some games (We Love Katamari) write offset inside the CLUT, and one block is only 32 colours (in 32bit) anyway, so by block is insufficient.

Also add check for CLUT invalidation from Z writes, because it *could* happen, weirder things have been done in games.
2022-07-10 17:50:05 +01:00
Mrlinkwii
6511d4c21c GameDB: fix memcard filters 2022-07-10 09:31:36 +01:00
BuildTools
e2a8c70f3d UI: Minor typo fixes 2022-07-09 22:26:58 +01:00
Mrlinkwii
53386e4d42 Gamedb: fix game titles 2022-07-09 22:26:39 +01:00
Jordan
d82d25cc10 Patches: Cleanup more ws patches. (#6595)
Removes more 60 fps codes.
2022-07-09 14:49:26 +02:00
Mrlinkwii
d79b4b2352 Gamedb: fix up game names and add HWfixes 2022-07-08 12:29:35 +01:00
refractionpcsx2
a206187802 GS: Improve clut testing, add test for local->local transfers.
Fixes Sagashi ni Ikouyo which does local->local transfers in to the CLUT so it needs flushing.
2022-07-08 11:58:21 +01:00
Mrlinkwii
e48e810005 QT: set Texture Offsets & Skipdraw Range per game only 2022-07-08 11:05:59 +01:00
Connor McLaughlin
fbac3ebad1 GS/TextureCache: Fix incorrect hashing of L/H/small textures
Fixes text getting garbled in Valkyrie Profile 2 with preloading on.
2022-07-07 12:09:40 +01:00
Jordan
c88a042c8b Patches: Cleanup cheats_ws. (#6577)
60 fps hacks do not belong in the widescreen patches archive.
2022-07-06 23:29:41 +02:00
Mrlinkwii
a78d76d143 QT: more missing descriptions 2022-07-06 20:57:36 +01:00
BuildTools
33ea0af06f Patches: Misc cheats_ni cleanup
Patches: Misc cheats_ni cleanup
2022-07-06 01:17:01 +01:00
Mrlinkwii
55a15f5a21 QT: more settings descriptions 2022-07-06 01:16:41 +01:00
Daisouji
3dd5a32cc0 QT: Adds descriptions to OSD/Post Processing Settings (#6571)
Co-authored-by: Ty <AmFobes@gmail.com>
2022-07-05 23:52:27 +01:00
Pyra Drake
0df86c6aaf GameDB: EA Sports BIO FolderMC Support (#6575) 2022-07-05 19:47:36 +01:00
Mrlinkwii
383ff6c234 QT: more missing descriptions 2022-07-05 18:02:27 +01:00
Connor McLaughlin
2cf920a1d4 CI: Add AppImage builder for Qt 2022-07-05 13:05:57 +01:00
Connor McLaughlin
dc8bb7cc2f Qt: Use same data directory as wx with XDG_STD enabled 2022-07-05 13:05:57 +01:00
Connor McLaughlin
cfe51035fb CMake: Drop unused ALSA dependency 2022-07-05 13:05:57 +01:00
Connor McLaughlin
a2afbd3080 Qt: Make status bar less confusing 2022-07-05 13:04:40 +01:00
Connor McLaughlin
dcb17243f8 ThreadedFileReader: Fix a low-chance race when closing file 2022-07-05 13:04:26 +01:00
Connor McLaughlin
6e706b3a8c Qt: Implement mouse wheel binding 2022-07-05 13:04:03 +01:00
PCSX2 Bot
f5e3d79cc7 PAD: Update to latest controller database. 2022-07-04 19:05:46 +02:00
Mrlinkwii
1febfa4f4e QT: settings descriptions 2022-07-04 11:39:18 +01:00
BuildTools
9601d0fc45 Patches: Update Persona 4 WS Patch 2022-07-04 09:57:33 +01:00
Connor McLaughlin
9f8f0262c7 Qt: Show disabled hw fixes in OSD 2022-07-03 03:59:04 +01:00
Mrlinkwii
e718a4f843 Gamedb: upscaling fixes for Kingdom Hearts - Final Mix 2022-07-02 23:50:41 +01:00
lightningterror
2257103ee6 GS-hw: Fix Wunused-but-set-variable warning. 2022-07-02 22:29:52 +02:00
Mrlinkwii
9e58aafa4a Gamedb: fixup wrong titles and add game fixes 2022-07-02 15:30:54 +01:00
BuildTools
a13096bdfe Config: Set texture preloading to full by default 2022-07-02 14:44:22 +01:00
Connor McLaughlin
53c3958b2b 3rdparty: Remove ghc::filesystem 2022-07-02 06:21:30 +01:00
Connor McLaughlin
bbc0bcae1e IopBios: Replace ghc::filesystem with our wrappers 2022-07-02 06:21:30 +01:00
Connor McLaughlin
2b52bf4539 DEV9: Replace ghc::filesystem with our wrappers 2022-07-02 06:21:30 +01:00
refractionpcsx2
40f315a259 GS: Fix CLUT changing bit depth.
This usually means the storage method changes with it, so it's a good idea to reload it
2022-07-01 17:10:26 +01:00
refractionpcsx2
f191915b53 GS: Adjust CLUT dirty checks to reduce false positives 2022-07-01 13:56:55 +01:00
lightningterror
cb0e79972d GS: Fix default config for UserHacks_CPUSpriteRenderBW for wx build. 2022-06-30 21:23:44 +02:00
Ty Lamontagne
2a980d9fc0 IOPBios: Make our hostfs HLE safer
For example, if you mkdir a path that is taken by an existing _file_, GHC would throw an exception and crash the emulator.
2022-06-30 01:19:12 +01:00
Connor McLaughlin
6daeb56550 GS: Support using SW renderer for texture decompression sprites 2022-06-29 14:03:16 +01:00
Connor McLaughlin
65ae3e1d8d Qt: Make mouse mapping opt-in (less annoying) 2022-06-29 11:55:58 +01:00
Connor McLaughlin
403b93daf6 Qt: Fix drag/drop of blockdumps 2022-06-29 11:55:58 +01:00
Connor McLaughlin
ff0380b456 Qt: Fix drag/drop of GS dumps/ELFs 2022-06-29 11:55:58 +01:00
Connor McLaughlin
e7bb6c8767 PAD: Adjust existing button pressure when modifier activated 2022-06-29 11:55:58 +01:00
MomosuWarosu
f9c7b4e441 GameDB: Upscaling fixes and region corrections for Armored Core 3/Silent Line 2022-06-29 09:34:43 +01:00
Connor McLaughlin
0540b8e1ad GS: Switch to placeholders for VM repeat mapping in Qt
This is not reliant on having larger gaps in the virtual address space,
and should never fail.
2022-06-29 09:18:20 +01:00
Connor McLaughlin
fcde6f686e Build: Bump _WIN32_WINNT to Windows 10 and link against OneCore
Necessary for us to utilize the new WinAPI functions. We just need to be
careful not to call any of these in wx, because otherwise it'll no
longer run on Win8.
2022-06-29 09:18:20 +01:00
Connor McLaughlin
444dce4aeb PAD: Fix incorrect MAX_KEYS check 2022-06-29 09:04:30 +01:00
Connor McLaughlin
1a0b8fb37f Qt: Fix window reopening after close 2022-06-29 09:04:30 +01:00
Connor McLaughlin
4fcc8abf55 Qt: Add pressure modifier button for pads 2022-06-29 01:09:29 +02:00
Connor McLaughlin
131b92e9fe Qt: Implement remove disc 2022-06-28 20:01:42 +01:00
Connor McLaughlin
5391b529b6 Qt: Implement start disc 2022-06-28 20:01:42 +01:00
Connor McLaughlin
92aea38230 GS: Reset stats on open
Fixes junk/bogus stats when switching to/from software renderer, and
when shutting down/starting a new game.
2022-06-28 20:01:42 +01:00
Connor McLaughlin
590ca98463 Qt: Implement pause on focus loss 2022-06-28 20:01:42 +01:00
Connor McLaughlin
16936aa452 Qt: Make UI thread VM valid/paused globally accessible 2022-06-28 20:01:42 +01:00
Connor McLaughlin
dedb1e0c80 Qt: Implement pause on start 2022-06-28 20:01:42 +01:00
Connor McLaughlin
63163737c2 Qt: Implement disable window resize 2022-06-28 20:01:42 +01:00
Connor McLaughlin
9f99e88c92 Qt: Fix game properties staying open after closing main window 2022-06-28 20:01:42 +01:00
Connor McLaughlin
b6f748ad8f Qt: Add option to hide main window when game running 2022-06-28 20:01:42 +01:00
Mrlinkwii
1f3f70a642 GameDB: fix game titles and add an entry 2022-06-28 20:01:20 +01:00
dio-gh
edfb59a87d Add MacOS badge to the README 2022-06-28 18:48:23 +01:00
refractionpcsx2
999b01c814 GS: Fix interlace offset for native. 2022-06-28 15:47:36 +01:00
refractionpcsx2
e7f52cbf98 GS: Fix interlace offsets for no-interlace patches 2022-06-28 09:57:23 +01:00
Mrlinkwii
311d1c805d Gamedb: add VUclamping to "NCAA March Madness 2003/2004" 2022-06-28 10:43:24 +02:00
lightningterror
2908c97432 Qt: Fix anti blur tooltip. 2022-06-28 10:35:48 +02:00
lightningterror
122423e535 Qt: Add tooltlips to System Settings. 2022-06-28 10:35:48 +02:00
lightningterror
639865f3e2 Qt: Add tooltlips to Advanced System Settings. 2022-06-28 10:35:48 +02:00
lightningterror
42e214eb17 Qt: Add tooltips to Emulation Settings. 2022-06-28 10:35:48 +02:00
refractionpcsx2
73c29d44c3 GS: Don't vmalloc inside fifo_alloc to avoid logic confusion.
Also remove a pointless check from my previous COP2 fix.
2022-06-28 09:29:47 +01:00
chaoticgd
ab6148f0b4 Config: Fix loading of SavestateZstdCompression setting
It seems like when the setting was originally added, the author
forgot to add a line to the Pcsx2Config::CopyConfig function which
meant that the setting was not loaded properly.
2022-06-28 09:13:41 +01:00
refractionpcsx2
bf0243c253 iR5900: Ignore Non delayed COP2 commands when not interlocked 2022-06-27 23:32:25 +01:00
PCSX2 Bot
b53c9daf50 PAD: Update to latest controller database. 2022-06-27 22:15:10 +02:00
refractionpcsx2
7fa482e5c6 GS: Adjust interlacing offsets to something more sensible. 2022-06-27 19:35:43 +01:00
refractionpcsx2
391bd119b8 VU: Don't clamp VF00 or I Reg 2022-06-27 14:44:57 +01:00
Connor McLaughlin
cdd9b1fa3b iR5900: Elide VU0 micro finish calls when safe
This makes a difference in COP2-heavy games, where a chain of
instructions will repeatedly test the VU0 idle bit unnecessarily, as it
is impossible for a micro to be started inbetween the instruction chain.

Saves a bit of code size (for register backup/restore), as well as
getting rid of branches. Seems to make a 1-2% difference in performance
in Ratchet on a 3900X, but if we're lucky, more on slower chips.
2022-06-27 14:44:48 +01:00
dependabot[bot]
99487d0e2b Bump mikehardy/buildcache-action from 1.2.2 to 1.3.0
Bumps [mikehardy/buildcache-action](https://github.com/mikehardy/buildcache-action) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/mikehardy/buildcache-action/releases)
- [Changelog](https://github.com/mikehardy/buildcache-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mikehardy/buildcache-action/compare/v1.2.2...v1.3.0)

---
updated-dependencies:
- dependency-name: mikehardy/buildcache-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-27 12:11:32 +02:00
Mrlinkwii
5ff98258df GameDB: fix up wrong titles 2022-06-27 00:21:10 +01:00
lightningterror
41bc4832f3 USB: More variable scope warnings.
Looks like there are still more, let's see if it complains more about this file.
Codacy.
2022-06-26 19:23:49 +02:00
BuildTools
69dbb2e17c Readme: Update Linux version 2022-06-26 19:03:11 +02:00
lightningterror
3dbaf96a9a USB: Cleanup more variable scope warnings.
Codacy.
Looks like I missed some.
2022-06-26 19:02:08 +02:00
Ty Lamontagne
15d8b891d6 Core: Replace old include guard with pragma once 2022-06-26 12:42:10 +02:00
Connor McLaughlin
efc09a7b47 GS/TextureCache: Unswizzle shared texture formats when hashing
Fixes formats such as PSMT4HL giving different hashes depending on what
the overlapping/shared pixels in local memory contain.

Enable this unconditionally, rather than only when dumping, because
unswizzling and hashing is around 25% faster on AVX2 builds than hashing
the backing local memory for larger textures (e.g. Star Ocean 3 menus).
Also has the added bonus of hitting the cache more often in such cases
too.
2022-06-26 03:08:57 +01:00
refractionpcsx2
6e84e5ce9c VU: YOLO T-Bit on MTVU
More games than I expected just turn T-Bit on but never actually use it, which causes poor performance in MTVU due to threading.  If there is a game that uses it, we can disable MTVU in the GameDB, since it will break the performance of the game, even if we try to handle it correctly.

Maybe we can re-enable it in the future if some threading genius figures it out.
2022-06-25 16:54:42 +01:00
refractionpcsx2
7d5d2b86cf GS: Don't do interlace offset if de-interlacing is disabled. 2022-06-25 16:46:59 +01:00
Mrlinkwii
e887600c7e Gamedb: Fix game names 2022-06-25 16:14:35 +01:00
refractionpcsx2
8216faae6e IPU: Fix GT3 regression from #6506
BTW it was totally not my suggestion to change it and I take no responsibility for the fact I bro.. I mean LT broke it.
2022-06-25 16:01:39 +01:00
lightningterror
8c1b9e1557 GS-hw: Fix redundant condition warning.
Codacy.
2022-06-25 13:26:46 +02:00
lightningterror
57595c70b0 PAD: Fix expression is always false warning.
Codacy.
2022-06-25 13:26:22 +02:00
lightningterror
cf568d2782 iR5900: Cleanup variable scope.
Codacy.
2022-06-25 11:20:53 +02:00
lightningterror
ba07e46cf8 iR3000A: Cleanup variable scope.
Codacy.
2022-06-25 11:20:53 +02:00
lightningterror
f19ba1b0db iFPUd: Cleanup variable scope.
Codacy.
2022-06-25 11:20:53 +02:00
lightningterror
51887f1cbc BaseBlockEx: Cleanup variable scope.
Codacy.
2022-06-25 11:20:53 +02:00
refractionpcsx2
539e285f86 GS: Limit the offset for FFMD to prevent over scaling. 2022-06-25 02:53:09 +01:00
refractionpcsx2
75d57640eb GS: Rework interlace offsets 2022-06-25 02:53:09 +01:00
refractionpcsx2
56316ffcca GS: Add internal FFMD offset to interlace. 2022-06-25 02:53:09 +01:00
Mrlinkwii
580dbd0905 Gamedb:Add missing serials 2022-06-25 02:29:43 +01:00
Mrlinkwii
42a394628e GameDB: upscaling fixes for "Mike Tyson Heavyweight Boxing" 2022-06-24 23:29:51 +01:00
lightningterror
0233845994 USB: Cleanup uninitialized variable.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
f42647426b IOP: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
b54521de51 iR5900: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
d7e09167fa iMMI: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
26d20e458c iFPU: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
3099d55b40 RDebug: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
72218929b9 SPU2: Cleanup variable scope.
Codacy
2022-06-24 23:32:30 +02:00
lightningterror
f99106ccb1 MemoryCardFolder: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
dd6f9c5ad3 USB: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
7d2209860e IPU: Cleanup variable scope.
Use totalqwc instead of ipu1cycles for adding cycles.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
c82a927556 GS: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
59e9d80b18 PAD: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
732d30c919 CDVD: Cleanup variable scope.
Codacy.
2022-06-24 23:32:30 +02:00
lightningterror
8586490162 Misc: Cleanup some stuff I didn't notice in previous commits. 2022-06-24 02:22:40 +02:00
lightningterror
f8a3cf2d3d README: Update requirements. 2022-06-24 02:17:38 +02:00
lightningterror
826ca5ece5 GS-hw: Update crc hack comments. 2022-06-24 01:20:28 +02:00
refractionpcsx2
73a3542ab2 Build: Fix appimage.sh 2022-06-23 23:25:46 +01:00
lightningterror
dfbe243b4c Misc: Clean up warnings.
Wsign-compare, Wunused-variable, Wunused-variable.
2022-06-23 22:48:07 +02:00
Stuart Kenny
f7d76ebf1d GS: Add lottes crt to present shader. 2022-06-22 16:26:19 +02:00
lightningterror
34c36c09ff wx: Rename gsdx to gs for window title statistics. 2022-06-22 13:58:26 +02:00
lightningterror
765dab5d8d GS: Make sure upscaling hacks are disabled on native res.
There was a regression that caused upscaling hacks to still be enabled on native res.
2022-06-22 12:58:32 +02:00
lightningterror
063d02a9cb GS-wx: Disable TX x y offsets on native res:
We already gray out the option on Qt, and it should be an upscaling hack only.
2022-06-22 12:58:32 +02:00
lightningterror
6e5e9ab7bc GS-d3d12: Remove scale factor clamp.
Already handled in config so it's duplicate.
2022-06-22 12:58:32 +02:00
Ty Lamontagne
c8c7ac45d1 CDVD: Touch-Up GZip logging messages. 2022-06-21 23:49:27 +01:00
Connor McLaughlin
14181ec70d InputManager: Fix chord bindings when activating in reverse 2022-06-21 21:53:02 +01:00
Connor McLaughlin
b20e5a1e01 VMManager: Convert to fmt
Also adds an error message when trying to save state in the BIOS.
2022-06-21 21:53:02 +01:00
Connor McLaughlin
64d222a1e4 Qt: Support binding numpad keys independently of number row 2022-06-21 21:53:02 +01:00
refractionpcsx2
e4554fe9ca CDVD: Load GZip index location direct from ini.
Stops the Qt game list from putting indexes in the default location when a custom one is used.
2022-06-21 21:51:25 +01:00
refractionpcsx2
8ec736789c GUI: Allow memcard names shorter than 4 2022-06-21 21:51:07 +01:00
refractionpcsx2
9a323a9a8d GUI: Only add extension to new memcards on save 2022-06-21 21:51:07 +01:00
MomosuWarosu
298e626b6e GameDB: Upscaling fixes added for all retail versions of Shutokou Battle 01
GameDB: Upscaling fixes for Shutokou Battle 01

GameDB: Upscaling fixes for Shutokou Battle 01
2022-06-21 21:22:03 +01:00
Blackbird88
af7308e395 GameDB: Fix name of "The Document of Metal Gear Solid 2" 2022-06-21 21:21:43 +01:00
Mrlinkwii
7c80fcacba GameDB: add missing upscaling fixes to "Xenosaga Episode III" 2022-06-21 21:21:27 +01:00
Silent
beb23efa88 XInput: Fix axis inversion when using SCP extensions 2022-06-21 17:16:44 +01:00
Christian Murphy
1b65f5f164 PAD/Core bugfix for #6472
Bugfix for https://github.com/PCSX2/pcsx2/issues/6472 which was introduced by hold turbo changes
2022-06-21 09:36:06 +01:00
PCSX2 Bot
bb336f1bc7 PAD: Update to latest controller database. 2022-06-20 21:16:38 +02:00
Connor McLaughlin
36d386b451 Qt: Fix hide mouse cursor not working with render-to-main off 2022-06-20 15:14:23 +01:00
Connor McLaughlin
9199f48a3c HostDisplay: Remove DestroyRenderDevice()/move to destructor
Saves having to remember to call this any time you destroy the display
object.
2022-06-20 15:14:15 +01:00
Connor McLaughlin
5c88c585a0 ContextWGL: Use pbuffers when we don't have a surface
Fixes context restore error tripping when confirming shutdown while
fullscreen in Qt.
2022-06-20 15:14:15 +01:00
Connor McLaughlin
771b1490d2 Qt: Get rid of redundant resume on confirm shutdown 2022-06-20 10:34:28 +01:00
Connor McLaughlin
4bbdbf6332 Qt: Fix crash on confirm shutdown when fullscreen 2022-06-20 10:34:28 +01:00
refractionpcsx2
7dc10fbe46 Docs: Add normal readme and rename documentation readme 2022-06-20 09:12:08 +01:00
Ali Mahdavi
90ca83bd96 Qt: Change the word “Save Slot” to “Load Slot” in Load State menu
First off, I must admit, I **HAVE NOT** compiled the project to see if my change breaks the whole thing or not. I just searched the entire repository for `Save Slot` and renamed the one related to `loadSaveStateSlot`.
2022-06-20 09:56:36 +02:00
Christian Murphy
4ee92fc637 Qt: Turbo (Hold) Hotkey binding
Fixes #5538
Acts as a temporary flip-flop switch while held that either enables turbo while held or disables turbo while held if you've already toggled turbo.

Default bind is Keyboard/Period but happy to make this unbound if preferred.
2022-06-20 09:55:53 +02:00
Florin9doi
1d39488061 Gamedb: DB Updates 2022-06-20 08:50:56 +01:00
MomosuWarosu
d87cd32ff4 GameDB: Upscaling fixes for Tokyo Xtreme Racer 3 2022-06-20 07:50:00 +01:00
Connor McLaughlin
2a50ae905d VMManager: Don't try to load state when none exists 2022-06-20 07:38:19 +01:00
Connor McLaughlin
f536584d7a VulkanHostDisplay: Fix uploading unaligned texture sizes 2022-06-20 07:28:12 +01:00
Connor McLaughlin
fa3bd58b7f GS: Don't show GPU OSD when timing init fails 2022-06-20 07:28:12 +01:00
Connor McLaughlin
1f5d2c49fc Qt: Split texture replacement settings to its own page 2022-06-20 07:28:12 +01:00
Connor McLaughlin
3e585c3438 Qt: Add folder settings 2022-06-20 07:28:12 +01:00
Connor McLaughlin
c23e792f68 Qt: Add folder selection to memory card settings 2022-06-20 07:28:12 +01:00
Connor McLaughlin
02d3c93c2c Qt: Allow editing folder settings 2022-06-20 07:28:12 +01:00
Connor McLaughlin
a07ef0f5ee Qt: Move logging setup into core
Sharable between frontends this way.
2022-06-20 07:28:12 +01:00
Connor McLaughlin
e415251f30 Qt: Add pad deadzone 2022-06-20 07:28:12 +01:00
Connor McLaughlin
ddbc143178 GS/DX12: Fix creating display textures mid-frame crashing 2022-06-20 07:28:12 +01:00
CharlesThobe
d54715a9c3 Updater: Do not extract portable.ini
DIO
2022-06-19 20:18:34 +01:00
refractionpcsx2
eb9507707d GS: Unset scanmsk_used after 2 frames 2022-06-19 19:36:02 +01:00
lightningterror
3377de1fe3 gitignore: Ignore dmp files in bin directory. 2022-06-19 19:05:43 +02:00
refractionpcsx2
b5807e0788 GS-PCRTC: Add option to enable/disable Anti-Blur code.
For... accuracy?

Also clean up FIELD nonsense in the merge circuit.
Fixed up offset code for interlacing
2022-06-19 16:25:13 +01:00
Connor McLaughlin
c86e82039a GS: Fix possible crash when changing settings with readbacks disabled 2022-06-19 09:32:31 +02:00
Connor McLaughlin
999b2267c0 Wx: Remove sync to host refresh rate option
Still available in Qt obviously. Apparently there's COM reinitialization
issues on the CPU thread in wx, and I don't want to deal with that nonsense.
2022-06-19 09:31:51 +02:00
Connor McLaughlin
fbf9585b5a VMManager: Auto switch to 16:9 when ws patches are enabled/found 2022-06-19 02:18:08 +01:00
Connor McLaughlin
470365644f Qt: Implement mouse->controller binding
Also implements forwarding mouse events to imgui.
2022-06-19 02:17:42 +01:00
Connor McLaughlin
7b3847cc5c Qt: Fix incorrect input popup when no vibration sources available 2022-06-18 22:58:27 +02:00
Connor McLaughlin
2b0e1a1dec Qt: Fix compiling with spaces in path on Windows 2022-06-18 22:57:51 +02:00
kmicki
316e140329 PAD: changed freeze data size in Linux for cross-platform compatibility 2022-06-18 22:56:59 +02:00
Mrlinkwii
02c4c3b03d Gamedb: add "EETimingHack" for "Strikers 1945 1-2" and gamefixes for 'Star wars episode 3 " 2022-06-18 21:51:51 +01:00
TellowKrinkle
e5405e191b Metal: Fix ImGui renderer
Turns out those were bitcasts, not conversions
2022-06-18 15:32:46 -05:00
TheLastRar
839ea61d55 DEV9: Formatting 2022-06-17 19:12:35 +02:00
TheLastRar
02f27f8cbc DEV9: Have internal DHCP use AdapterUtils 2022-06-17 19:12:35 +02:00
TheLastRar
35b5138593 DEV9: Have internal DNS use AdapterUtils 2022-06-17 19:12:35 +02:00
TheLastRar
809c5ed051 DEV9: Have pcap backend use AdapterUtils 2022-06-17 19:12:35 +02:00
TheLastRar
412451f9d6 DEV9: Have Sockets backend use AdapterUtils 2022-06-17 19:12:35 +02:00
TheLastRar
35802f2089 DEV9: Add AdapterUtils 2022-06-17 19:12:35 +02:00
TheLastRar
8f6f0f8401 DEV9: Exclude pcap NPF_ Prefix from GUID on Windows 2022-06-17 19:12:35 +02:00
refractionpcsx2
44d95badc4 GUI-WX: Add Blit description in WX gamefix panel. 2022-06-17 00:30:06 +01:00
Mrlinkwii
d622faba17 GameDB: add autoflush and upscaling fixes for "Mega Man X8" 2022-06-16 20:29:23 +01:00
noigeaR
b5945d3d5c GameDB: add missing Japanese game serials
GameDB: add missing Japanese game serials
2022-06-16 17:52:07 +01:00
Silent
52cd6fb1dd GameDB: Port the Midnight Club 3 patch to NTSC-u v2.00 2022-06-16 15:05:25 +01:00
TellowKrinkle
04681babf1 Common: Add assertion failure message to crashlogs 2022-06-15 16:23:32 -05:00
Connor McLaughlin
e63c068720 GameDatabase: Add option to force blit-based FPS detection 2022-06-15 16:21:31 +01:00
refractionpcsx2
fb5b465a4e GS: Fix overflow calculation from errantly going off. 2022-06-15 15:48:37 +01:00
RedPanda4552
59ea3c7949 GameDB: Add HPO Special (Texture - Aggressive) to Batman Vengeance 2022-06-15 15:48:18 +01:00
Mrlinkwii
6f5306dbdc GameDB: Fix game names "ICO" and add "Monster Rancher Evo" fixes 2022-06-15 15:48:01 +01:00
refractionpcsx2
b5388fdf2f GS: Only enable scanmsk offset on frames that need it 2022-06-14 23:07:21 +01:00
lightningterror
d2904c1fd5 GS: Fix up wave filter shaders. 2022-06-14 21:25:47 +02:00
kmicki
7718feedd5 PAD Linux: correct conversion of analog stick values. 2022-06-14 20:59:11 +02:00
Riccardo Marcangelo
56add277f9 GS: Migrate function pointer to lambda
Compilers can inline lambda for superior performance.
2022-06-14 20:48:37 +02:00
refractionpcsx2
86f772ad38 GS: Avoid Div by 0 on WriteImage 2022-06-14 17:51:04 +01:00
refractionpcsx2
24c99551c7 GS: Fix God of War regression from #6389 (v1.7.2937) 2022-06-14 02:12:26 +01:00
refractionpcsx2
9441d2a33a IPU: Remove some DMA hacks 2022-06-13 23:47:47 +01:00
refractionpcsx2
3922091a58 GS: New state opt optimisation pass 2022-06-13 23:47:34 +01:00
refractionpcsx2
1107ce8fd8 GS: Check whole state before flushing draws 2022-06-13 23:47:34 +01:00
Mrlinkwii
3d10cd1adf Gamedb: fix 'Sega Sports Tennis' name 2022-06-13 23:24:22 +01:00
refractionpcsx2
02ac3943f2 INTC: Give grace period after event for reading INTC
If a game is in a tight loop waiting for a bit of INTC, we could skip a bunch of cycles incorrectly.
2022-06-13 23:02:44 +01:00
refractionpcsx2
44b672b6f5 Counters/GS: Adjust FIELD swap timing for PAL
Console tests show about 3 PAL scanlines of time.
2022-06-13 23:02:44 +01:00
PCSX2 Bot
0239d8350d PAD: Update to latest controller database. 2022-06-13 18:01:50 +02:00
Mrlinkwii
bada5fe941 Gamedb: remove gamefixes form "Axel Impact - The Extreme Racing" 2022-06-12 21:48:49 +01:00
Mrlinkwii
6db871958e Gamedb: remove no longer needed patches 2022-06-12 15:40:33 +01:00
lightningterror
0b557fe265 GS/Core: Purge frameskipping.
Get rid of frameskipping, won't be added to Qt.
2022-06-12 11:43:10 +02:00
refractionpcsx2
ce08627396 GS: Reduce false positives in dev overflow errors 2022-06-12 08:03:14 +01:00
Christian Murphy
200ec5dcfb Qt: Update GameList scrolling to be per pixel to better indicate direction of scroll
Addressing issue https://github.com/PCSX2/pcsx2/issues/6237
2022-06-12 06:47:21 +01:00
Christian Murphy
8a6f55a63e Save/Load States via hotkey in QT
Addressing https://github.com/PCSX2/pcsx2/issues/6268.

Adds the commands for loading/saving all numbered states via hotkeys, leaving them all unbound by default.
2022-06-12 02:29:24 +01:00
Mrlinkwii
e327f5e6f0 Gamedb: remove patches and add upscaling fixes for 'Onimusha - Dawn of Dreams' 2022-06-12 02:28:45 +01:00
Στέφανος "Coornio/8924th" Βλαστός
5849726913 GameDB: upscale fixes, adding missing serials, name corrections, etc
See PR for details
2022-06-12 02:10:05 +01:00
Mrlinkwii
e063613a7f GameDB: add 'Axel Impact - The Extreme Racing' 2022-06-12 02:06:34 +01:00
Connor McLaughlin
48d2cb4975 Qt: Implement input profiles 2022-06-11 14:37:57 +01:00
Connor McLaughlin
59412b1673 Qt: Implement multitap 2022-06-11 14:37:57 +01:00
Connor McLaughlin
d1a235272e SettingsInterface: Add ContainsValue() and copy helpers 2022-06-11 14:37:57 +01:00
Mrlinkwii
7db9627ff6 Gamedb: Fix games names 2022-06-10 23:23:42 +01:00
lightningterror
83550cd153 github labeler: Remove nsis. 2022-06-10 15:12:03 +02:00
TellowKrinkle
77471bd9d6 GS: Avoid using both blending and fbfetch 2022-06-10 14:40:30 +02:00
lightningterror
0e94211ff1 GS: Fix Wunused-variable warnings. 2022-06-10 14:16:11 +02:00
Mrlinkwii
f6e7bba354 GameDB: Remove patch for Panzer Dragoon 2022-06-10 11:33:27 +01:00
noigeaR
b2255e5b27 GameDB: add missing serials, upscaling fixes, name corrections (#6385) 2022-06-10 09:46:25 +01:00
Mrlinkwii
7b493ff4c8 Gamedb: add upscaling fixes to 'Fast and the Furious' 2022-06-09 15:23:33 +01:00
Mrlinkwii
aeef163349 GameDB: add missing serials 2022-06-08 19:25:30 +01:00
RedDevilus
26f2352059 GameDB: Fix flag + add missing US serial
Someone in the Discord said that they had the question mark flags for these 2 serials, 1 is Virtua Fighter 4 Evolution PAL which had a typo and another is NBA Live '09 NTSC version. Quite surprising to see a missing American release in the GameDB still.
2022-06-08 15:27:53 +01:00
arcum42
67e38d8de2 Build: Update build.sh to remove a no longer used flag and add a few more. (#6124)
* Build: Update build.sh. Remove a no longer used flag and add a few new ones.

* Fix spacing on --use-system and --use-bundled.
2022-06-07 21:45:40 -07:00
Mrlinkwii
2c3a4cbabf Gamedb: fix up 'Deadly Skies III' name 2022-06-07 19:12:10 +01:00
Connor McLaughlin
fed3ea597c Qt: Add swap memory card button 2022-06-07 15:09:41 +01:00
Connor McLaughlin
547b2fc9e8 VMManager: Cycle/autoeject memory cards when files change
Hopefully should fix card changes not getting picked up in some games.
2022-06-07 15:09:41 +01:00
Connor McLaughlin
cf07f4aef1 MemoryCardFolder: Fix empty/unplugged card detecting as folder 2022-06-07 15:09:41 +01:00
Connor McLaughlin
3dc4aea053 MemoryCardFile: Open file memcards in read share mode
Fixes cards showing up as "missing" in Qt's settings dialog if you
opened the dialog after starting a game.
2022-06-07 15:09:41 +01:00
Connor McLaughlin
afa29facc6 FileSystem: Add OpenSharedCFile() 2022-06-07 15:09:41 +01:00
Connor McLaughlin
8c0120bdbb GS/Vulkan: Fix uploading compressed replacement textures 2022-06-07 13:49:51 +02:00
Silent
a3e72c5b43 Updater: Disable Maximize and Close buttons 2022-06-07 13:14:00 +02:00
Silent
33efc86788 Updater: Thread the UI updates, add a taskbar progress bar, add a marquee progress bar for indeterminate actions 2022-06-07 13:14:00 +02:00
Mrlinkwii
ec6be34c31 Gamedb: add disablePartialInvalidation to snowblind engine games 2022-06-07 11:44:05 +01:00
iMineLink
fd49a1e80a GS: preserve target on different format write.
affects hardware texture cache.
2022-06-07 10:49:01 +01:00
Dreadmoth
d1d6855d58 Qt: Fix Disable Depth Emulation tooltip 2022-06-07 09:02:56 +01:00
lightningterror
504b9e7051 Qt: Fix Texture Offsets tooltip. 2022-06-07 02:28:12 +02:00
Mrlinkwii
9cb64fd087 GameDB: add HW fixes for 'Raging Bless' 2022-06-06 22:27:52 +01:00
refractionpcsx2
fe9ccf55c1 GS: Allow same src for DISPFB when using 32bit + 24bit 2022-06-06 21:07:08 +01:00
PCSX2 Bot
4840da2c1b PAD: Update to latest controller database. 2022-06-06 19:21:56 +02:00
Connor McLaughlin
543fb282fe VMManager: Set affinities for threads 2022-06-06 17:44:06 +01:00
Connor McLaughlin
9b7ae498d2 3rdparty: Add cpuinfo 2022-06-06 17:44:06 +01:00
refractionpcsx2
5668bcf19b IOP: Revert a change from #6267
Think this was a misunderstanding of how the interrupts worked (was actually one shot)
2022-06-06 15:06:29 +01:00
refractionpcsx2
66c25b3cb6 GS: Auto adjust aspect when using Offsets + Overscan 2022-06-05 23:12:08 +01:00
refractionpcsx2
e234fb32d9 GS Add horizontal overscan 2022-06-05 23:12:08 +01:00
refractionpcsx2
f70c67ad7f GS: Add option to show vertical overscan 2022-06-05 23:12:08 +01:00
refractionpcsx2
cf3cfdb2bc GS: Correctly handle field/deinterlace for progressive/interlaced mode.
Also correct the number of scanlines for progressive (double strike) and how long vblank is.
2022-06-05 22:37:26 +01:00
Connor McLaughlin
394f1f2049 Vulkan: Enforce 32 byte alignment for uploads
It blows up on AVX2 stores on some drivers if we don't (e.g. AMD Linux).
2022-06-05 21:29:42 +01:00
Connor McLaughlin
a9819542d4 GS: Split convert and present shaders 2022-06-05 21:27:16 +01:00
Στέφανος "Coornio/8924th" Βλαστός
d0e3b8c4ee fix dump n.1 2022-06-05 21:26:01 +01:00
refractionpcsx2
e3681cf993 GS: Be generous with the resolution for no-interlace patches 2022-06-05 21:21:13 +01:00
Mrlinkwii
26c717a1bf Gamedb:add upscaling fixes for 'Test Drive' 2022-06-05 21:00:35 +01:00
refractionpcsx2
6efdbf2950 GIF: sync GIF packet ends 2022-06-05 16:50:20 +01:00
refractionpcsx2
b45b082c06 IPU: Wait for IPU_FROM to be ready 2022-06-05 16:50:09 +01:00
lightningterror
da21a649c0 Qt: Add tooltips to Graphics section.
Most of them are ported from WX.
2022-06-05 14:00:50 +02:00
TellowKrinkle
347736f2b4 GHActions:macOS: Add Qt SVG plugin 2022-06-04 22:28:15 -05:00
lightningterror
a6649b2d6b GS: Fix SkipDuplicateFrames default config. 2022-06-05 00:01:19 +02:00
Mrlinkwii
33a78c1919 Gamedb: add missing serials 2022-06-04 22:08:12 +01:00
Mrlinkwii
3b4b669038 Gamedb: add patch for 'Transformers - Revenge of the Fallen' 2022-06-04 21:03:19 +01:00
Mrlinkwii
26b666abcd Gamedb: fixes for 'Call of Duty - Le Jour de Gloire' 2022-06-04 20:25:19 +01:00
Mrlinkwii
32e2a8ba2c GameDB: add HW fixes for snowblind engine games 2022-06-04 19:37:50 +01:00
Angel Toloza
fdc399b44c GameDB: Mana Khemia
Fixes misalignment of textures in the Pause Menu.
2022-06-04 19:20:07 +01:00
Connor McLaughlin
ec43661664 GS: Add sync to host refresh rate option 2022-06-04 18:43:07 +01:00
Connor McLaughlin
a05a655037 HostDisplay: Create swap chain in CreateRenderDevice() for D3D
Fixes starting in exclusive fullscreen mode in Qt.
2022-06-04 18:15:59 +01:00
Connor McLaughlin
ca3833e71b VulkanHostDisplay: Avoid redundant resizes 2022-06-04 18:10:46 +01:00
Connor McLaughlin
3910b047d4 InputManager: Fix incorrect default keyboard R2 binding 2022-06-04 18:10:46 +01:00
Connor McLaughlin
15c1381c1e VMManager: Add input profile loading 2022-06-04 18:10:46 +01:00
Connor McLaughlin
c0e65d9a36 vtlb: Add RAM accessors which avoid hw access 2022-06-04 18:10:46 +01:00
Connor McLaughlin
38ff490b60 HostSettings: Add writer functions 2022-06-04 18:10:46 +01:00
Connor McLaughlin
f8fa41d4bf VulkanHostDisplay: Upload textures in init command buffer 2022-06-04 18:10:46 +01:00
Connor McLaughlin
b74c65cc7c GS: Make reopen fails non-fatal
It'll restore the old configuration instead.
2022-06-04 18:10:46 +01:00
Connor McLaughlin
624e5ae633 VMManager: Force reloading of LastELF on state load 2022-06-04 18:10:46 +01:00
Connor McLaughlin
71935e7099 VMManager: Relax memory ordering for state
CST is definitely overkill here.
2022-06-04 18:10:46 +01:00
Connor McLaughlin
bb9a551318 MTVU: Use Thread wrapper 2022-06-04 18:10:46 +01:00
Connor McLaughlin
457ec7f6f5 Threading: Add lightweight thread wrapper 2022-06-04 18:10:46 +01:00
Connor McLaughlin
433b88c0bf GS/TextureReplacements: Be more lax about header flags 2022-06-04 18:10:46 +01:00
Connor McLaughlin
9f8911536a GS/OpenGL: Use feature flag for D32F/D32FS8 selection 2022-06-04 18:10:46 +01:00
Connor McLaughlin
eeb09c54d8 GS/DX12: Use correct state for texture staging buffers 2022-06-04 18:10:46 +01:00
Connor McLaughlin
52a3777aae Qt: Convert webp flags masquerading as png to png 2022-06-04 18:10:46 +01:00
Connor McLaughlin
ea1f451d35 Qt: Move flag/star icons to resources 2022-06-04 18:10:46 +01:00
Connor McLaughlin
28795e549b GS/Qt: Represent the current frame on resize when paused
Stops the frame displayed with incorrect proportions.
2022-06-04 18:10:46 +01:00
Connor McLaughlin
0a667bf18a SettingsInterface: Add optional accessors/mutators 2022-06-04 18:10:46 +01:00
Connor McLaughlin
2d8a4e13e6 GS: Fix a bunch of texture copy counters not adding 2022-06-04 18:10:46 +01:00
Connor McLaughlin
f1702b5693 Qt: Force game list column resize on window show
Fixes a regression from dbfb93a50f where
the game list columns would always be too short on open.
2022-06-04 18:00:06 +01:00
Connor McLaughlin
b89d0837a6 Qt: Avoid spamming resize events on paint
This caused long freezes on Windows when you dragged the window around,
because it was sending a paint event for every movement.
2022-06-04 17:27:55 +01:00
TellowKrinkle
cba6a6ec51 Qt: Add preferences button to menu system
Important on macOS to get the expected keyboard shortcut
2022-06-04 14:50:33 +01:00
TellowKrinkle
d74623faf9 Qt: Support DPI change events 2022-06-04 14:50:33 +01:00
TellowKrinkle
db4bf08475 GHActions:macOS: Add Qt build 2022-06-04 14:50:33 +01:00
TellowKrinkle
f9c2327bf5 Qt: Respond to dark/light mode changes 2022-06-04 14:50:33 +01:00
TellowKrinkle
beab9870cf Common: Move ObjC methods to CocoaTools 2022-06-04 14:50:33 +01:00
TellowKrinkle
dbfb93a50f Qt: Calculate icon theme from palette instead of name 2022-06-04 14:50:33 +01:00
TellowKrinkle
6b66cd7f29 Qt: Remove [Light] from Native theme
It's whatever your system theme is set to, be that light or dark
2022-06-04 14:50:33 +01:00
TellowKrinkle
08089e0654 Qt: Set isMask to true on menu items
Prevents icons from being the wrong color when the Qt theme doesn't match the macOS system theme (or when you use Native theme with dark mode)
2022-06-04 14:50:33 +01:00
TellowKrinkle
b2ef973f16 Qt: Fix game summary field size on macOS 2022-06-04 14:50:33 +01:00
TellowKrinkle
d862f8cd53 Qt: Fix SDL initialization crash on macOS 2022-06-04 14:50:33 +01:00
TellowKrinkle
9c61e9eda3 Qt: Mac build 2022-06-04 14:50:33 +01:00
Goatman13
dc000e08ab GameDB: Add more Onimusha 3 HW fixes.
Fixes textureless graphics ingame.
2022-06-04 14:27:16 +01:00
Goatman13
5469d59de9 IPU: Set ECD if start code is not 1xx
Onimusha 3 send 0x200 and expect that start code search finish on it.
Setting ECD here helps The Sims Bustin' Out
2022-06-04 14:27:16 +01:00
refractionpcsx2
37f640ece2 IPU: Always process command if busy on DMA run 2022-06-04 13:30:48 +01:00
refractionpcsx2
906898c785 Savestates: Add developers comment for commit log messages 2022-06-04 04:57:37 +01:00
TheTechnician27
30f6c5f8f1 Update README.md to reflect project's age. 2022-06-04 02:36:13 +01:00
refractionpcsx2
1a2059c0f1 IOP Counters: Fix up interrupt behaviour
Also replace some magic values with macro/enum type thingies
2022-06-04 02:28:56 +01:00
RedDevilus
4fb0050411 GameDB: Forbidden Siren 2
Fixes vertical lines in-game (merge sprite) and FMV (software renderer gamefix)
2022-06-04 02:25:26 +01:00
refractionpcsx2
5708fb1668 IPU: add slight timing to IDEC/BDEC
Modify IPU to run on internal interrupts to give some timing
2022-06-04 01:46:01 +01:00
refractionpcsx2
870604d64c Savestates: Add new IPU variable and bump version 2022-06-04 01:46:01 +01:00
refractionpcsx2
9f4bf4267d IPU: Stop early IPUProcessInterrupt fires. 2022-06-04 01:46:01 +01:00
refractionpcsx2
5c15d57f5f IPU: Reorder DMA timing for IPU_TO and IPU_FROM 2022-06-04 01:46:01 +01:00
Mrlinkwii
6e1f76185e GameDB: add patches for 'Harry Potter and the Half-Blood Prince' 2022-06-03 23:00:05 +01:00
Goatman13
7fe5ba480c GameDB: Replace Choro Q HG, and Penny/Gadget Racers patches.
Replace patches to less invasive solution. No longer need to skip movies, or skip SetVSyncFlag.
2022-06-03 18:25:56 +01:00
RedDevilus
2333ff7b2d Qt: Bump Cache + new other icon 2022-06-03 16:23:54 +01:00
RedDevilus
5063961748 Qt: Readability and prevents false matches regions
Code readability is easier if you check out this page and also prevents false matches like PAL-FI which is a Finnish game would trigger PAL-F which gives a French flag.
2022-06-03 16:23:54 +01:00
RedDevilus
815c0a394d Qt: Adding back BIOS flags
The old code was still being used for getting the icons but they were renamed and moved into another folder. Oops!
2022-06-03 16:23:54 +01:00
RedDevilus
6d3f42a441 Qt: Change array and rename flags to region 2022-06-03 16:23:54 +01:00
RedDevilus
4b76594d8d Qt: Add array and look-up for flags
Stenzek doesn't love a lot for variables which impacts code readability, put into array for ease his mind.
2022-06-03 16:23:54 +01:00
RedDevilus
f5144f33da Qt: Move flags to seperate folder 2022-06-03 16:23:54 +01:00
RedDevilus
03f7e9e15a Qt: More flags and regions + enabling more icons
In reality it will show multiple flags like Korean flag but the flags aren't correct due to the structure in the GameDB actually being the languages more than the actual region.
At least people will have Korean flags and others for now and fix GameDB later as it's still a nightly/development cycle.

Though there are about 30 country flags included for future usage as of now.
2022-06-03 16:23:54 +01:00
Blackbird88
a8baa4b67c GameDB: Added Tourist Trophy VU clamp fix 2022-06-03 13:52:50 +01:00
RedDevilus
f40bebed3b GameDB: Fix line in the sky for Jak games
Read the description...
2022-06-02 18:25:35 +01:00
RedDevilus
5a036e572b GameDB: Remove Kingdomhearts 1/2 GShwfixes
Issues with texture cache reveal themselves so best to remove it.
2022-06-02 18:25:16 +01:00
Mrlinkwii
cd31f5fceb GameDB: upscaling fixes for 'Tokyo Xtreme Racer Drift 2' 2022-06-02 00:45:08 +01:00
Mrlinkwii
f812174270 Gamedb: fix game title typos 2022-06-01 21:39:33 +01:00
nev3rfail
aeaeb8ba94 GS/TextureReplacement: Ignore replaced textures in DumpTexture 2022-06-01 20:15:16 +02:00
Florin9doi
2adeb401ff Gamedb: PlayStation BB Navigator 2022-06-01 12:38:19 +01:00
Florin9doi
52325cb7dd Gamedb: Jissen Pachi-Slot Hisshouhou 2022-06-01 12:38:19 +01:00
Florin9doi
6265bbf99a Gamedb: Web browsers 2022-06-01 12:38:19 +01:00
Mrlinkwii
8c0c9a5e29 PAD: fix typo in UI 2022-06-01 12:09:03 +01:00
Florin9doi
8638c73a4e Gamedb: DVD Player 2022-06-01 11:01:00 +01:00
Florin9doi
d2d4038357 Gamedb: Chou! Rakushii Internet Tomodachi Nowa 2022-06-01 10:36:23 +01:00
refractionpcsx2
f8fdbaf566 CheatsWS: Remove bad Herdy Gurdy WS patch 2022-05-31 19:12:53 +01:00
Stuart Kenny
0b2536dd3e GS/HW: Fix typos in wave filter shader 2022-05-31 17:36:16 +01:00
Mrlinkwii
b2b7d8d64e Gamedb: remove patch from 'Boku to Mao' 2022-05-31 16:17:22 +01:00
Stuart Kenny
67c34794e8 Qt: wire in tv shaders 2022-05-31 15:22:47 +01:00
Dreadmoth
30f0cdde6f GameDB: Add missing serial
Secret Agent Clank (PAL-M12) [SCES-55496]
2022-05-31 16:08:13 +02:00
TheLastRar
71637cc282 DEV9: Clang format Qt files 2022-05-31 13:57:24 +01:00
TheLastRar
56402db7ee DEV9: Add DNS host export/import 2022-05-31 13:57:24 +01:00
TheLastRar
3e76d380a1 DEV9: Move helper Qt classes into a separate file 2022-05-31 13:57:24 +01:00
Connor McLaughlin
4873165dbc PAD/Host: Fix unconditionally sending state for disconnected ports 2022-05-31 12:12:44 +01:00
Connor McLaughlin
277706505e PAD: Make controller info public 2022-05-31 12:12:44 +01:00
Stuart Kenny
9f09aa725b pad: Expose Analog mode button. 2022-05-31 11:35:13 +01:00
Connor McLaughlin
06fee385e1 Tests: Add unit tests for UNC paths on Win32 2022-05-31 11:01:14 +01:00
Connor McLaughlin
dc4ef1163f Qt: Add logging of early directory setup
Makes debugging this stuff easier in the future.
2022-05-31 11:01:14 +01:00
Connor McLaughlin
2928837b76 Qt: Add command line parameter to force early console log 2022-05-31 11:01:14 +01:00
Connor McLaughlin
a5124b118b FileSystem: Fix splitting UNC paths 2022-05-31 11:01:14 +01:00
Connor McLaughlin
e7db878188 GS: Clamp tex-in-rt source rectangle to rt bounds
Fixes GPU crash for DX12 in Ridge Racer V. Game still has broken car
textures.
2022-05-31 10:58:45 +01:00
lightningterror
0b164a7989 github labeler: Add/adjust renderer labels based on current renderers. 2022-05-31 01:14:20 +02:00
Mrlinkwii
a4088685a0 Gamedb: Fix up some game names and add upscaling fixes for 'Xenosaga' 2022-05-30 22:48:18 +01:00
TellowKrinkle
fc06963c56 Common: Implement screensaver prevention on macOS 2022-05-30 16:38:01 -05:00
PCSX2 Bot
9680e7460c PAD: Update to latest controller database. 2022-05-30 21:43:49 +02:00
Connor McLaughlin
271e53a6bf Assertions: Fix message not being included for pxAssert() 2022-05-30 10:20:44 +01:00
RedDevilus
3888483fb4 GameDB: Reflect some new regions + new serials
In case of new centralised way of regions like the flag icons for Qt and adding some new serials.
2022-05-30 10:00:06 +01:00
RedDevilus
d67e72912c Qt: Fix DPI scaling 125% + higher quality icons
Upscaling on Qt didn't work properly as Windows calculates it differently, it's better to give far larger pictures and icons and let it downscale.

Also added most country flags that are relevant for PCSX2.

Reduces size icons from 3.5 MB to a whopping 0.34 MB (340 KB!) but looks even better for everyone.

Hopefully fixes #6255
2022-05-30 10:00:06 +01:00
refractionpcsx2
b843989719 Clang: Format GS.h 2022-05-30 09:48:26 +01:00
refractionpcsx2
7717450044 GS: Fix CSR.FIELD for progressive mode 2022-05-30 09:48:26 +01:00
TellowKrinkle
98947c10bb wx: Fix assert on settings panel 2022-05-30 09:48:13 +01:00
TellowKrinkle
6aa7266084 Core: Fix LnxFlatFileReader FinishRead return 2022-05-30 09:46:53 +01:00
TellowKrinkle
bd5656bf89 Core: Fix DarwinFlatFileReader FinishRead return
Looks like the return value is expected to be the number of bytes read
2022-05-30 09:46:53 +01:00
TellowKrinkle
1e4795e653 CDVD: BlockDumpFileReader formatting 2022-05-30 09:46:53 +01:00
Goatman13
c8e0090870 GameDB: Remove few IPU patches
No longer needed.
2022-05-30 01:24:31 +01:00
Goatman13
2dd9d8338b IPU: Implement start code validation for BDEC/IDEC
According to MPEG specs when 8 "0" bits are found, we should check for 000001xxh. Recommended way is to check 24 bits (000001h), and if they won't match discard 8 bits and try again until valid code is found, or stream ends.
2022-05-30 01:24:31 +01:00
Mrlinkwii
8d3c82de19 Gamedb: upscaling fixes for 'Need for Speed: Hot Pursuit 2' 2022-05-30 00:37:04 +01:00
Mrlinkwii
3bff10e17d Gamedb: add upscaling fixes for ' The Sims 2 pets' 2022-05-29 23:15:44 +01:00
refractionpcsx2
6562a5191a MTGS: Fix GS reset behaviour 2022-05-29 22:03:02 +01:00
Connor McLaughlin
5ef159876a Build: Don't rewrite svnrev.h unconditionally
Stops VS from recompiling the files which include it every time you hit
run.
2022-05-29 16:19:08 +01:00
Mrlinkwii
1bb86d8984 GameDB: remove gameFixes for 'nfl street 3' 2022-05-29 16:17:15 +01:00
Connor McLaughlin
edd735ce80 GS: Read local memory without sync when readbacks are disabled 2022-05-29 16:15:34 +01:00
Connor McLaughlin
4fd06b5ea8 GS: Clear current/merge textures on hardware reset 2022-05-29 16:15:18 +01:00
Connor McLaughlin
f6d997ca87 GS: Clear local memory on hardware reset 2022-05-29 16:15:18 +01:00
Connor McLaughlin
5963efcec8 GS: Get rid of redundant pointers to VM 2022-05-29 16:15:18 +01:00
Silent
f8fbfee49d GameDB: Add Auto Flush for 24 - The Game
Fixes pause menu backgrounds.
2022-05-29 14:34:15 +01:00
Mrlinkwii
4d7ee63d77 GameDB: remove gameFixes from'NFL Street 2' 2022-05-29 14:30:16 +01:00
Mrlinkwii
21b97f68fa Config: Remove unused macro from superVU. (#6240) 2022-05-29 01:04:24 +02:00
refractionpcsx2
95c91b4dc6 GS-TC: Preserve scale when resizing target for display. 2022-05-28 23:59:31 +01:00
Mrlinkwii
ca1b35a351 GameDB: add missing serials 2022-05-28 23:27:48 +01:00
Mrlinkwii
84177d38d4 GameDB: update 'Growlanser Generations' name 2022-05-28 19:28:14 +01:00
Mrlinkwii
e21589da86 Gamedb: fix up some game titles 2022-05-28 18:56:13 +01:00
refractionpcsx2
0768971f35 GS: Bug fix Scissor Optimization 2022-05-28 14:29:37 +01:00
Mrlinkwii
6c42a7f6e4 GameDB: fix up game names 2022-05-28 13:51:57 +01:00
Connor McLaughlin
a65f3bd116 GS/DX12: Fix incorrect blend factor for primid DATE 2022-05-28 05:50:21 +01:00
Connor McLaughlin
822e508d13 D3D12: Don't call GetGPUDescriptorHandleForHeapStart() on non-shader-visible heaps 2022-05-28 05:50:21 +01:00
RedDevilus
1611aeedce GameDB: Tales of Legendia + Batman Begin + ...
- Added FMV switch for Tales of Legendia which can show garbage textures
- Added Batman Begins (Autoflush and Special Texture half pixel offset for the lighting misalignment)
- Some extra clean-up on Spartan - Total Warrior
2022-05-28 05:49:36 +01:00
refractionpcsx2
7c243756bc GS: Better swapped draw direction detection on scissor opt 2022-05-28 04:42:33 +01:00
refractionpcsx2
43b53df0a0 Patches: Make cheats_ws.zip search case insensitive 2022-05-28 03:32:43 +01:00
C.W. Betts
66c6c2400a Some Qt for Mac fixes. 2022-05-27 21:21:48 -05:00
Connor McLaughlin
30096a5ae4 Qt: Add hardware check for SSE4 and AVX2 2022-05-27 17:39:09 +01:00
refractionpcsx2
c70afc24bd GUI/Qt: Prioritize serial in cover lookup 2022-05-27 11:34:39 +01:00
Connor McLaughlin
ce53b7adb1 Qt: Implement drag/drop to main window 2022-05-27 09:55:02 +01:00
Connor McLaughlin
25fa70fe9e Qt: Fix loading save state from manual file 2022-05-27 09:55:02 +01:00
RedDevilus
724957fbec Qt: Revision default hotkeys
There has been a re-order of keybindings, new keybindings and missing Single Frame GS Dump, Multi Frame GS Dump, Input Recording mode.

To be decided for the rest.
2022-05-26 19:27:04 +01:00
TellowKrinkle
9084ef35b4 GS:SW: Restore zequal for optimization 2022-05-26 03:51:39 -05:00
TellowKrinkle
e58b1054ea GS:SW: Use restrict on DrawTriangleSection
Improves compiler optimization
2022-05-26 03:51:39 -05:00
TellowKrinkle
24de0866f7 GS:SW: Don't interpolate xy fields for scanlines
By that point, xy is what's being used to advance the scanline and won't be needed as a parameter
2022-05-26 03:51:39 -05:00
TellowKrinkle
0cec99361b GS:SW: Use floats for zskip 2022-05-26 03:51:39 -05:00
TellowKrinkle
8ba745030a GS:SW: Hold double z in registers more 2022-05-26 03:51:39 -05:00
TellowKrinkle
4ddf897719 GS:SW: Use doubles for Z calculation 2022-05-26 03:51:39 -05:00
TellowKrinkle
9be7eb67d8 GS:SW: Rearrange GSVertexSW members to better match planned DoubleZ arrangement
Note: Removes zequal.  DoubleZ will fix, but until then things will break
2022-05-26 03:51:39 -05:00
TellowKrinkle
56bba522ac GS:SW: Unvectorize unneccessarily-vectorized things 2022-05-26 03:51:39 -05:00
TellowKrinkle
b6c1b3fb96 GS: Add double operations to GSVector/GSNewCodeGenerator 2022-05-26 03:51:39 -05:00
TellowKrinkle
82de13d95a GS: Better cxpr GSVector init 2022-05-26 03:51:39 -05:00
TellowKrinkle
92dd6fb575 GHActions: Improve macOS artifact name for tagged builds 2022-05-26 03:26:12 -05:00
TellowKrinkle
ced58a047d CMake: Set fp-contract=fast
Clang defaults to off, everyone else defaults to on or fast.  Allows multiplies and adds to be merged into fma
2022-05-25 21:56:21 -05:00
refractionpcsx2
2d98b877a2 Patches-NI: Remove broken Silent Hill 3 patch 2022-05-26 00:54:59 +01:00
Master Builder
a26b91291c Common/Linux/LnxHostSys: Fixed compatibility issues with FreeBSD, made error
handling more explicit
2022-05-26 00:28:44 +02:00
Connor McLaughlin
46a649afc1 GS: Add Skip Presenting Duplicate Frames option 2022-05-25 23:24:44 +01:00
Connor McLaughlin
3ce242886b VMManager: Disable symbol map update on Qt
Until it's implemented.
2022-05-25 23:24:30 +01:00
Connor McLaughlin
3b5538a09c VMManager: Fix no ws/ni patches message showing up on reset 2022-05-25 23:24:30 +01:00
Connor McLaughlin
796519f6a7 D3D12HostDisplay: Fix vsync 2022-05-26 00:04:46 +02:00
Connor McLaughlin
2365a9caab D3D12/Texture: Fix incorrect resource state for fallback staging buffer 2022-05-26 00:04:46 +02:00
Connor McLaughlin
425b5d0478 BlockdumpFileReader: Extra error checking to detection 2022-05-25 14:08:54 +01:00
Connor McLaughlin
628560850a CDVD: Fix crash when trying to scan small gzip files 2022-05-25 14:08:54 +01:00
Tzerinas
69f058e532 GameDB: Removes missed french Tak fmv fix 2022-05-25 12:12:03 +01:00
Mrlinkwii
c66b660c10 GameDB: more removal of software FMV fixes from games 2022-05-25 11:56:38 +01:00
Mrlinkwii
4fdb3322cc Gamedb: remove software FMV fixes from games 2022-05-25 11:33:24 +01:00
Connor McLaughlin
73122400e3 GSTextureCache: Expand target to fit readout height
This handles a case where you have two images stacked on top of one another (usually FMVs), and
the size of the top framebuffer is larger than the height of the image. Usually happens when
conservative FB is on, as off it'll create a 1280 high framebuffer.

The game alternates DISPFB between the top image, where the block pointer matches the target,
but when it switches to the other buffer, LookupTarget() will score a partial match on the target
because e.g. 448 < 512, but the target doesn't actually contain the full image. This usually leads
to flickering. Test case: Neo Contra intro FMVs.

So, for these cases, we simply expand the target to include both images, based on the read height.
It won't affect normal rendering, since that doesn't go through this path.
2022-05-25 10:51:54 +01:00
refractionpcsx2
d1cdfafe22 Qt: Fix auto updater
CI didn't build it, so we missed it lol
2022-05-25 10:28:43 +01:00
Connor McLaughlin
91e8a2cf0e Qt: Fix adding multi bindings from pad 2022-05-25 10:15:48 +01:00
Connor McLaughlin
b5721a92e9 Misc: Fix a bunch of recent warnings from clang 2022-05-25 10:15:48 +01:00
Connor McLaughlin
cefe4b773c Qt: Add clear bindings button to controllers 2022-05-25 10:15:48 +01:00
Connor McLaughlin
332346449f Qt: Remove presets dropdown, hide restore defaults
Until it's implemented.
2022-05-25 10:15:48 +01:00
Connor McLaughlin
2c199e7c42 Qt: Add log timestamps 2022-05-25 10:15:48 +01:00
Connor McLaughlin
2a32864856 Qt: Get rid of duplicate base setting query helpers 2022-05-25 10:15:48 +01:00
Connor McLaughlin
9481bbd2ef Qt: Add OSD message when block dumps are enabled 2022-05-25 10:15:48 +01:00
Connor McLaughlin
08aad5461e Qt: Add block dump options 2022-05-25 10:15:48 +01:00
Connor McLaughlin
0bab9474ae Qt: Add file logging option 2022-05-25 10:15:48 +01:00
Connor McLaughlin
1f802eca46 Common: Redo assertions, purge DiagnosticOrigin 2022-05-25 10:15:48 +01:00
Mrlinkwii
a02df6c980 GameDB: add 'disablePartialInvalidation' to 'Shadow Hearts 2' 2022-05-24 23:34:57 +01:00
refractionpcsx2
e0194b2b95 GUI: Enable verbose messages for patch loading. 2022-05-24 20:31:36 +01:00
RedDevilus
74f4886ea6 GameDB: Revise serial names + GsHWFixes
With Qt being released there were still illegal characters being used in the name, also found some random typo mistakes.

Fixes #6170

GsHWFixes:
- Ratatouille
- Wild Arms series
- Tony Hawk Downhill Jam
2022-05-24 20:27:50 +01:00
refractionpcsx2
d9119921de GS: Limit interlace offset to FFMD mode.
The offset is only really needed when the game is rendering half frames and expects a certain amount of offset.
2022-05-24 18:03:07 +01:00
refractionpcsx2
4a12ec6fc0 GS: Add option to disable Interlace Offset 2022-05-24 18:03:07 +01:00
refractionpcsx2
0c855cdd6d GS: Update interlacing on Metal 2022-05-24 18:03:07 +01:00
refractionpcsx2
89d44a5f60 GS: Offset interlace when upscaling 2022-05-24 18:03:07 +01:00
Connor McLaughlin
aa47018197 Qt: Apply patches on entry point compile
Fixes WRC4's entrypoint patch not being used.
2022-05-24 18:00:59 +01:00
refractionpcsx2
d5cd2446e4 GUI/Qt: Use higher quality icon 2022-05-24 17:59:05 +01:00
lightningterror
eb386fb0fb Qt: Gray out language selection.
Not yet implemented.
2022-05-24 16:59:26 +02:00
Connor McLaughlin
cb24b84bff Add cheats_ni.zip 2022-05-24 12:50:43 +01:00
Connor McLaughlin
d65522a9b4 VMManager: Add no-interlacing patches 2022-05-24 12:50:43 +01:00
Connor McLaughlin
fa91d0b705 Qt: Make relationship between vsync queue/optimal pacing clearer 2022-05-24 11:34:56 +01:00
Connor McLaughlin
ae43cfaaf2 R5900: Fix format string for TLB misses etc 2022-05-24 11:34:56 +01:00
Connor McLaughlin
8bbcb05303 MultipartFileReader: Fix use-after-free when opening multipart files
Also fixes loading uppercase filenames on Linux.
2022-05-24 11:34:56 +01:00
Connor McLaughlin
f2713462cc Qt: Fix starting after theme change 2022-05-24 11:34:56 +01:00
refractionpcsx2
ac9d406862 Adding FUNDING file
Adds a button to the project
2022-05-23 19:20:19 +01:00
Connor McLaughlin
74738022da Qt: Use SERIAL_CRC.ini naming for per-game settings 2022-05-23 17:27:11 +01:00
PCSX2 Bot
aae8d5d639 PAD: Update to latest controller database. 2022-05-23 18:20:41 +02:00
lightningterror
372ee9b6b6 Qt: Allow to load/browse block dump files. 2022-05-23 18:19:14 +02:00
lightningterror
943e21f507 Qt: Fix link/url colours in various themes.
Fixes #6148
2022-05-23 17:11:29 +02:00
Connor McLaughlin
b6308bab4f Qt: Initialize COM ourselves on EmuThread
If we don't, SDL initializes it first in STA mode, which prevents MT
mode from being used, which prevents us from using XAudio2.
2022-05-23 15:45:53 +01:00
Connor McLaughlin
6a4df2a641 GS: Move GSinit()/GSshutdown() to GS thread
This initializes COM, so it has to be done on the thread which is
actually going to use it.
2022-05-23 15:45:53 +01:00
lightningterror
a92eb4d10a Qt: Disable/remove unused buttons.
Not implemented yet.
2022-05-23 16:32:02 +02:00
Mrlinkwii
c03e52c06f GameDB: upscaling fixes for 'KimiKiss' 2022-05-23 13:35:42 +01:00
Christian Kenny
66e663757a NSIS: Remove installer as it is is not compatible with Qt 2022-05-23 13:11:46 +01:00
Connor McLaughlin
d279f61d0b VMManager: Clear memory card eject timeout when game starts
If we don't reset the timer here, when using folder memcards
the reindex will cause an eject, which a bunch of games don't
like since they access the memory card on boot.
2022-05-23 13:11:06 +01:00
Connor McLaughlin
b59d4791cf Qt: Fix game grid scale/title setting not loading 2022-05-23 13:09:41 +01:00
Connor McLaughlin
680a3802d7 Updater: Remove update zip after committing 2022-05-23 13:09:41 +01:00
Connor McLaughlin
c3ee97103f Qt: Don't display update errors for background checks
It can be annoying, e.g. if you're not connected to the internet.
2022-05-23 13:09:41 +01:00
Connor McLaughlin
489fbe628a Qt: Remove download size from update prompt
The pcsx2.net api doesn't provide it.
2022-05-23 13:09:41 +01:00
Tyler Wilding
9ba42ec950 ci: format the GameDB and make sure it stays that way 2022-05-23 13:08:48 +01:00
Tyler Wilding
b54facdbd8 ci: catch duplicate YAML keys in the GameDB 2022-05-23 13:08:48 +01:00
Tyler Wilding
5c790b8540 ci: differentiate cmake windows build from the others 2022-05-23 13:06:35 +01:00
Tyler Wilding
ef32b49e50 input-rec: add back safeguard around controller input hook and dont deref null virtual pads 2022-05-22 22:45:01 -04:00
Tyler Wilding
8fb09d07ed input-rec: ensure controller logging is disabled by default 2022-05-22 20:29:42 -04:00
kenshen112
710d3360ac Cmake: Link InputRecording 2022-05-22 23:47:14 +01:00
lightningterror
ded036b93e Qt: Remove rich discord presence button.
Not implemented.
2022-05-23 00:34:37 +02:00
Silent
364e6a1341 GameList: Mark search directory cells as read-only 2022-05-22 23:16:10 +01:00
Tyler Wilding
2aec91d8c0 input-rec: remove frame-advance and adjust folder structure 2022-05-22 17:24:02 -04:00
Tyler Wilding
4f0c880e3e input-rec: append .p2m2 automatically when browsing for a file 2022-05-22 17:24:02 -04:00
Tyler Wilding
13d623f350 input-rec: cleanup VS and CMake project files 2022-05-22 17:24:02 -04:00
Tyler Wilding
9aecf79d7f input-rec: refactor core code, freeze wxWidgets version 2022-05-22 17:24:02 -04:00
Tyler Wilding
2e8076d909 input-rec: begin achieving parity in Qt 2022-05-22 17:24:02 -04:00
Tyler Wilding
655939147a input-rec: Remove DISABLE_RECORDING usages 2022-05-22 17:24:02 -04:00
arcum42
bf899022d7 DMAC: Testing a constant value is always true. (#6122) 2022-05-22 13:38:02 -07:00
Connor McLaughlin
ed5aa4a67d Qt: Cancel game list scanning when VM starts
Because of CDVD global state, and the fact that we hijack CDVD for
getting the game details, we have to cancel the scan. Otherwise, the
scanner will clash with the game's CDVD access.
2022-05-22 22:30:02 +02:00
Connor McLaughlin
22bf3549b6 Host: Add game list refresh/cancel calls 2022-05-22 22:30:02 +02:00
Connor McLaughlin
f260a8be66 GameList: Add region string/fix cached progress increment 2022-05-22 22:30:02 +02:00
Tyler Wilding
068ab8ab36 ci: fix windows release asset structure 2022-05-22 15:55:06 -04:00
iMineLink
6fde585504 gs-hw: remove tales of abyss cu hack.
fixes ghosting when upscaling.
2022-05-22 21:54:11 +02:00
iMineLink
c45cc6928d gs-hw-tc: add some assertions on source scale. 2022-05-22 21:54:11 +02:00
iMineLink
110b7df4d5 gs-hw-tc: set scale in missing create source path. 2022-05-22 21:54:11 +02:00
iMineLink
73eea20fcc gs-hw: fix invalid reference to target texture.
if the target texture changes after the source
lookup, correctly propagate the texture update.

fixes tales of abyss fullscreen blur when upscaling.
2022-05-22 21:54:11 +02:00
TheLastRar
4f20a68b33 Core: Fix LnxFlatFileReader compile error with Qt 2022-05-22 19:54:28 +01:00
Tyler Wilding
dafef46a1b ci: add SSE4 support for tagged Qt builds 2022-05-22 14:18:50 -04:00
Christian Kenny
e283831841 HW: Use more sensible variable names for logging 2022-05-22 17:59:15 +01:00
Christian Kenny
d13c7b6b3e DMAC: Remove some old defines, optimize case statements 2022-05-22 17:59:15 +01:00
Tyler Wilding
e7d1477a7e ci: build the right solution file for Qt builds 2022-05-22 12:54:54 -04:00
Tyler Wilding
2810f6afc1 ci: update docs 2022-05-22 12:54:54 -04:00
Tyler Wilding
821811cf0c ci: create simpler and more efficient release pipeline 2022-05-22 12:54:54 -04:00
Tyler Wilding
fea666bd1e ci: make build workflows re-usable, extract common scripts 2022-05-22 12:54:54 -04:00
Tyler Wilding
193254de94 ci: improve workflow organization 2022-05-22 12:54:54 -04:00
Connor McLaughlin
b919719aeb GzippedFileReader: Fix index creation 2022-05-22 16:13:12 +01:00
Connor McLaughlin
ea051c6d5f Everything: Get rid of wx entirely from the Qt build 2022-05-22 13:58:56 +01:00
Connor McLaughlin
893b3c629d Everything: Remove a **lot** of wx, and px nonsense
- common has no wx left except for Path.
 - pcsx2core only has it in a few places (memory cards and path related
   stuff).
2022-05-22 13:58:56 +01:00
Connor McLaughlin
c07c942659 Common/StringUtil: Handle error returns in StdStringFromFormatV() 2022-05-22 13:58:56 +01:00
Connor McLaughlin
b1d6d84e6f Qt: Get rid of wx module init
We're not using any wx thread junk anymore, so this can go.
2022-05-22 13:58:56 +01:00
tellowkrinkle
1afb248e4d Optionally use system libs (#6094)
* CMake: Make zstd and libzip optionally use system-installed versions

* CMake: Make SDL2 optionally use system version

* CMake: Disable crypto support in bundled libzip

* CMake: Fix bundled SDL build on macOS
2022-05-21 20:28:06 -07:00
Mrlinkwii
cad85d76a5 GameDB: Fix 'Hajime no Ippo - Victorious Boxers' serial 2022-05-21 00:28:52 +02:00
iMineLink
29ad851a9c gs-ogl: fix depth copy shader in stretch rect. 2022-05-20 01:12:38 +02:00
Mrlinkwii
cb9eaeeff9 GameDB: fix 'R: Racing Evolution' serial 2022-05-19 17:58:45 +01:00
Christian Kenny
7c9493cbc2 Core: Refactor code for shutting down internal PS2 components. 2022-05-16 17:30:52 +01:00
Christian Kenny
d21c01f8d1 Core: Remove unused code/includes. 2022-05-16 17:30:52 +01:00
RedDevilus
f4f06c9777 GameDB: Add new serials, GS (HW) Fixes
GS (HW) Fixes:
- R - Racing Evolution
- Lemony Snicket's A Series of Unfortunate Events
- Free Running
- Sopranos

New Serials:
- Shadow Hearts II [Demo]
- GI Jockey 2 [Demo]
- Hajime no Ippo - Victorious Boxers
2022-05-16 17:30:28 +01:00
Connor McLaughlin
437b6f3f0e Host: Reset imgui state when there's no frame to present
Prevents things getting into a messed up state internally where several
frames are buffered.
2022-05-16 17:30:11 +01:00
Connor McLaughlin
a163c90f2b 3rdparty/imgui: Update to 60bea05 2022-05-16 17:30:11 +01:00
PCSX2 Bot
9d9d22fcba PAD: Update to latest controller database. 2022-05-16 18:02:34 +02:00
Connor McLaughlin
df5e175b86 GS: Support creating/replaying dumps in zstandard format 2022-05-16 15:03:29 +01:00
Connor McLaughlin
0f8bbfd64c GS: Fix aspect ratio cycle hotkey in Qt 2022-05-16 15:03:29 +01:00
Connor McLaughlin
8c270288de GS: Refactor screenshots/GS dumping triggers
i.e. make it not rubbish and a massive race condition.

Also adds GS dump saving to Qt.
2022-05-16 15:03:29 +01:00
LargoUsagi
7bd7cdd867 GameDB: Modify .hack // games to use 'dot hack' and '-'(#6086) 2022-05-16 10:36:10 +01:00
Mrlinkwii
f618713551 GameDB: update EyeToy - Play 2 compat 2022-05-16 10:11:59 +01:00
refractionpcsx2
de329e49a8 GS: Redo a bunch of the ignore offset code
Plus clean up a bunch of stuff which isn't needed
2022-05-16 10:09:42 +01:00
Connor McLaughlin
2aa6f771a9 GS/TextureCache: Handle edge cases of paltex and texture replacement 2022-05-15 11:40:49 +01:00
Connor McLaughlin
7787fcff8e GS/TextureCache: Fix partial replacement of textures with same hash and paltex on 2022-05-15 11:40:49 +01:00
SgtSteel
6e576d208e README.md: update website links (#6073)
Updated the downloads link to point to the new page;
Changed the "Want more?" link to point to the homepage
Removed GitHub Releases link for development builds, since they are available on the website.
Also removed any reference to Windows and Linux, since binaries are now available for all three major OS
2022-05-13 16:34:37 +01:00
Connor McLaughlin
00751dc5d3 GS/TextureCache: Force hash caching for replaced textures
If we didn't do this, and preloading wasn't set to full, we'd partial
load the texture, and it wouldn't be in the hash cache. Then, when the
replacement came back (after being asynchronously loaded), there'd be
nothing for it to swap out with.
2022-05-13 12:50:08 +01:00
arcum42
e456fb8f88 Qt: Hook up screenshot button. (#6070)
Qt: Implemented hotkey as well.
2022-05-12 14:53:40 -07:00
Mrlinkwii
9dd579a6d5 GameDB: add some missing serials 2022-05-12 17:31:21 +01:00
Connor McLaughlin
fbd36a4347 Qt: Fix building on Linux 2022-05-12 17:31:06 +01:00
Connor McLaughlin
7f8bfb22de Build: Fix revision extractor for Qt auto updater 2022-05-12 17:31:06 +01:00
Connor McLaughlin
943b513a52 GS/TextureReplacements: Use aligned buffer for texture dumping 2022-05-12 15:08:45 +01:00
Connor McLaughlin
221eaf1a81 Common/AlignedMalloc: Add move constructor/assignment 2022-05-12 15:08:45 +01:00
Connor McLaughlin
41f1ec445f Qt: Add auto updater UI 2022-05-12 15:03:26 +01:00
Connor McLaughlin
a289723f66 Qt: Add update extractor source 2022-05-12 15:03:26 +01:00
Connor McLaughlin
a3f6efecb8 libchdr: Use in-tree lzma instead of bundled
Since we need it for the Qt updater.
2022-05-12 15:03:26 +01:00
Connor McLaughlin
2587cf3b95 3rdparty: Add lzma/7Z SDK 21.07 2022-05-12 15:03:26 +01:00
Connor McLaughlin
d535331b4b Misc: Remove __fastcall, __fc, __concall and friends
These have no meaning in x64 (apart from throwing compiler warnings),
and we don't do 32-bit anymore. Also saves needing to include
`Pcsx2Defs.h` in files which don't otherwise need it.
2022-05-12 14:58:03 +01:00
lightningterror
6d85399ec5 GameDB: Add OPHFlagHack to Naruto - Uzumaki Chronicles 2.
Fixes game freezing.

Fixes #6053
2022-05-12 12:58:52 +02:00
lightningterror
7a113474f0 GameDB: Add textureInsideRT to Turok Evolution.
Fixes underwater levels.

Fixes #6064
2022-05-12 12:51:38 +02:00
Connor McLaughlin
0bb7cc0a1a GS: Add texture dumping/replacement/reload replacement hotkeys
Qt only.
2022-05-11 14:44:42 +01:00
Connor McLaughlin
322ff3fcb9 GS/TextureReplacements: Add options to filter dumping to direct/palette textures 2022-05-11 14:44:42 +01:00
Connor McLaughlin
d329cabf07 GS/TextureReplacements: Fix queued items not getting purged after shutdown 2022-05-11 14:44:42 +01:00
Connor McLaughlin
38c48e8b6a Vulkan/Context: Don't write timestamp on an unreset query 2022-05-11 13:07:58 +01:00
Mrlinkwii
cd0b349496 GUI: update hyperlink in WX 2022-05-11 12:58:40 +01:00
TheLastRar
7f1932e282 DEV9: Fix double calling freeifaddrs() 2022-05-11 13:14:11 +02:00
Connor McLaughlin
17f2fb4471 Qt: Fix nightly builds not showing version in title bar 2022-05-11 13:13:39 +02:00
PCSX2 Bot
022a9cc6df PAD: Update to latest controller database. 2022-05-09 20:20:19 +02:00
Connor McLaughlin
c88db3221c GS/TextureCache: Flush dirty areas of textures during TC move
Dark Cloud does a bunch of VRAM writes overlapping the render target,
then moves over the top of it. If we didn't flush these, the target
would still be considered dirty, and later we'd trash the move
destination, and/or not use it as a source.
2022-05-09 17:45:53 +01:00
TellowKrinkle
bd3e1299a3 GS:MTL: Disable blending when color isn't written
Can come up in two-pass alpha, and Metal doesn't like it if blending uses SRC1 and your shader doesn't output it
2022-05-09 17:43:47 +01:00
TellowKrinkle
3a97688804 GS: Fix TextureMinMax when coordinates are completely outside of min/max 2022-05-09 17:43:47 +01:00
TellowKrinkle
3f027b2698 GS:SW: Clamp Z with unsigned clamp 2022-05-09 17:34:19 +01:00
Mrlinkwii
916754ea6d GameDB: add VUclamping to 'Monster Hunter 2' and 'Monster Hunter G' 2022-05-09 17:29:20 +01:00
TellowKrinkle
335633a5e0 CI: Update SDL 2022-05-09 10:28:58 -05:00
Connor McLaughlin
925bfc2a99 Tests: Set PCSX2_CORE macro
They shouldn't be using wx, and it gets rid of the pthreads4w reference.
2022-05-09 16:06:33 +01:00
Connor McLaughlin
d19c767ad1 Common/Dependencies: Use deletion for declaring non-copyable
This is the preferred method in modern C++.
2022-05-09 16:06:33 +01:00
Connor McLaughlin
d2347d9972 Common/Threading: Replace TLS macros with standard thread_local 2022-05-09 16:06:33 +01:00
Connor McLaughlin
f8dcff9fc4 Common: Remove references to pthreads4w
It's only needed for wx now.
2022-05-09 16:06:33 +01:00
Connor McLaughlin
e5716922a3 Common/Threading: Move a bunch of unnecessary wrappers to gui 2022-05-09 16:06:33 +01:00
Connor McLaughlin
65e956a01c Misc: Replace use of Threading::Mutex with std::mutex in core code 2022-05-09 16:06:33 +01:00
Connor McLaughlin
a93829557b SaveState: Misc refactoring and improvements
- Block until saves are completed when resuming.
 - Save shutdown state asynchronously.
 - Add function to read screenshot out of zip file (useful for
   previous, now we're using zstd).
2022-05-09 10:20:48 +01:00
Connor McLaughlin
c21d475bbd Qt: Implement save-state-on-shutdown 2022-05-09 10:20:48 +01:00
Connor McLaughlin
935dd046da 3rdparty/SDL2: Bump to 2.0.22 release
Fixes a crash on shutdown in Windows::Gaming::Input.
2022-05-09 10:01:45 +01:00
refractionpcsx2
1b2d9f0c5d GS: Scissor opt - handle reverse read sprites 2022-05-08 18:22:12 +01:00
Connor McLaughlin
4baea67e75 Common: Remove RwMutex
It wasn't used, and if we need it, we can use std::shared_mutex.
2022-05-08 05:40:59 +01:00
Connor McLaughlin
1e8332f36a Misc: Move pxThread and friends to gui 2022-05-08 05:40:59 +01:00
Connor McLaughlin
096696bed7 Misc: Replace core usage of Semaphore with KernelSemaphore
i.e. decouple it from the UI.
2022-05-08 05:40:59 +01:00
Connor McLaughlin
756cd1ee47 System: Move old SysThread junk to gui 2022-05-08 05:40:59 +01:00
Connor McLaughlin
64534542a9 Threading: Move a couple of function declarations to correct location 2022-05-08 05:40:59 +01:00
Connor McLaughlin
b22e31c302 Common: Add WIN32_LEAN_AND_MEAN and NOMINMAX to RedtapeWindows.h
Otherwise, it doesn't get set for cmake.
2022-05-08 05:40:59 +01:00
Connor McLaughlin
008beb4896 ThreadedFileReader: Fix possible race with synchronous reads 2022-05-08 05:10:09 +01:00
refractionpcsx2
576bcc6979 GameDB: Add HPO for Dog's Life 2022-05-08 02:54:47 +01:00
refractionpcsx2
4ec345a239 GS: Improve read heights with screen offset disabled 2022-05-08 01:16:04 +01:00
RedDevilus
972bfbcccc GameDB: Monster Hunter 1
Fixes lighting on character models as caves and other locations don't turn mobs into glow-in-the-dark creatures by themselves.
2022-05-07 23:27:46 +01:00
RedDevilus
f59fbaf0eb GameDB: Star Ocean 3
Certain areas have bloom effects which are misaligned, this should fix it. Though minor regression has to be made in the minimap as full round sprite is too aggressive for bloom filter.
2022-05-07 23:08:53 +01:00
refractionpcsx2
631ed8c0fd GUI-WX: Restore panel size override.
Fixes the panels going wonky after the recent dead code removal
2022-05-07 16:10:32 +01:00
Connor McLaughlin
41e8a2a7d1 MTGS: Purge pxThread 2022-05-07 15:43:03 +01:00
Connor McLaughlin
599626b709 MTVU: Purge pxThread 2022-05-07 15:43:03 +01:00
Immersion95
0ae17ddb1a GS: Adding KOF2002 CRC IDs
Adding:
- The King of Fighters 2002 (EUR)
- The King of Fighters 2002 (JAP)
- The King of Fighters 2002 - SNK Best Collection (JAP)
- The King of Fighters 2002 (USA) from Disc 1 of the bundle of The King of Fighters 02/03
2022-05-07 15:33:27 +01:00
Immersion95
7353c26a4f GS-TC: Don't skip depth lookup on KOF2002
Don't skip draw calls on KOF2002
2022-05-07 15:33:27 +01:00
Immersion95
b8769e954e GS: Adding KOF2002 CRC Title
Adding KOF2002 CRC Title
2022-05-07 15:33:27 +01:00
Connor McLaughlin
81cd2d9be9 Qt: Add placeholder for when no games are in list 2022-05-07 15:32:59 +01:00
Connor McLaughlin
90707c453d Qt: Rework VM pausing when popup dialogs are opened
Also cleans up fullscreen transitions further.
2022-05-07 15:32:59 +01:00
Connor McLaughlin
ec0e9f078c Qt: Confirm disc change type when switching to game list 2022-05-07 15:32:59 +01:00
Connor McLaughlin
98b537575f Qt: Rework display widget swapping 2022-05-07 15:32:59 +01:00
arcum42@gmail.com
233195b020 Remove macros that 'might be needed again in the future'. 2022-05-07 05:26:46 +01:00
arcum42@gmail.com
7d71e28bfc Delete various unused px stuff. 2022-05-07 05:26:46 +01:00
arcum42@gmail.com
13e09953af Remove unused code in Dependencies.h 2022-05-07 05:26:46 +01:00
Connor McLaughlin
a85ca4108c GS/DX11: Fix a possible texture leak with sw blend and tex-is-ds 2022-05-06 09:37:53 +01:00
Connor McLaughlin
8620febeb3 GL/Context: Load wayland-egl dynamically
Gets rid of the dependency on libwayland-egl, allowing us to always use
the system version.

Solves missing symbol issues by including it in the AppImage.
2022-05-06 01:00:24 +01:00
Connor McLaughlin
af4c047c41 MetalHostDisplay: Fix fullscreen in Qt interface 2022-05-05 23:23:48 +01:00
Connor McLaughlin
bec9b34f54 Vulkan/SwapChain: Fix crash on fullscreen toggle with Mac 2022-05-05 23:23:48 +01:00
refractionpcsx2
9989daec94 GSWindow: Remove force disable full screen hack now the GS Window doesn't suck 2022-05-05 23:19:35 +01:00
Mrlinkwii
c86dd7397d microVU : correct logging and remove not needed comments 2022-05-05 23:13:33 +01:00
Connor McLaughlin
eefc81ed8c Qt: Fix incorrect resources directory on config reset 2022-05-05 09:51:56 +01:00
Connor McLaughlin
91c717376f Qt: Use app bundle resources directory on Mac 2022-05-05 09:51:56 +01:00
Connor McLaughlin
344c918b65 Qt: Fix possible race when shutting down (Mac) 2022-05-05 09:51:56 +01:00
Connor McLaughlin
deeda519b0 Qt: Remove unused host display includes from EmuThread.cpp 2022-05-05 09:51:56 +01:00
Connor McLaughlin
2db12b9d84 Qt: Hook up axis/vibration scale in controller settings 2022-05-05 09:51:56 +01:00
Connor McLaughlin
378588c67d Qt: Implement more command line arguments 2022-05-05 09:51:56 +01:00
Connor McLaughlin
119b6bdfd5 Qt: Fix not-render-to-main after start fullscreen+toggle 2022-05-05 09:51:56 +01:00
Connor McLaughlin
8751a2d330 Qt: Make win32 console less garbage 2022-05-05 09:51:56 +01:00
Connor McLaughlin
4543ddbcc2 Common/FileSystem: Don't recompress already compressed files 2022-05-05 09:46:52 +01:00
Immersion95
77a7b18b29 GameDB: Add patches for remaining KOF series
Fix for Depth precision.
Game fills upper 16bits of depth with 0xFFFF.
This results in a really high 32 bit value which is then converted to float because both hw and sw renderers lack double precision the lower 16 bits of the initial 32 bit value lose precision.

PAL : KOF2002+KOF2003
NTSC-J : NGBC+KOF2002+KOF2003
2022-05-05 09:45:43 +01:00
lightningterror
749aef1a64 GS-d3d11: Get rid of vendor check in device.
Rely on the vendor check we already use for best renderer selection.
2022-05-04 21:31:58 +02:00
lightningterror
8091b6bc1b GS: Adjust default renderer based on vendor and feature level.
Vulkan default:
Nvidia Maxwell gen2 and higher.

OpenGL default:
From Fermi to Mawell gen1.

Everything else Direct3D11.
2022-05-04 21:31:58 +02:00
refractionpcsx2
4efa845580 GS: Add missing CRC for SNK vs Capcom Chaos (J) 2022-05-04 13:23:25 +01:00
Linus Heckemann
8c9ae90753 Wayland fixes (#5979)
* Linux/PAD: only attempt to reset X screensaver on X11

This would previously crash PCSX2 after 4096 frames on Wayland.

* Linux: only grab pointer on X11

This silently disables the functionality on Wayland, but that's one
step better than the previous behaviour: PCSX2 would crash when
Shift-F12 was pressed.
2022-05-03 23:24:47 -07:00
7oxicshadow
d1117aafac Allow commandline params to be passed through to the patched apprun file (#5777) 2022-05-03 23:24:10 -07:00
TellowKrinkle
a565182b2b GS:SW: Fix lod on C rasterizer 2022-05-04 01:02:36 -05:00
TellowKrinkle
650b0ae646 GS:SW: Prevent CDrawScanline from trashing unused Z bits 2022-05-03 21:47:57 -05:00
TellowKrinkle
b677619f32 GS: Formatting 2022-05-03 21:47:57 -05:00
TellowKrinkle
2fa8f09a21 GS:SW: Only run zclamp once
Also fixes clamping in the wrong spot in the C SW rasterizer
2022-05-03 21:47:57 -05:00
lightningterror
73c9279907 GS: Cleanup variable declarations/initalizations.
GSDevice11, 12, ogl, GSRendererHW.
2022-05-03 23:28:02 +02:00
Mrlinkwii
7d8912f170 GameDB: add 'VIF1StallHack' to 'Ikusa Gami' 2022-05-03 16:31:24 +01:00
lightningterror
2601ba53d4 GS-hw: Add brackets to the recommended crc selection just in case. 2022-05-03 11:58:51 +02:00
lightningterror
81baaaa98a GS-hw: Fix recommended crc for dx12.
Full level should be selected.
Once rov is added we can remove it.
2022-05-03 11:42:40 +02:00
TellowKrinkle
c2638131b4 GS:SW: Merge SSE and AVX implementations of CDrawScanline 2022-05-02 16:28:45 -05:00
TellowKrinkle
586486b81c GS:SW: Merge SSE and AVX implementations of CSetupPrim 2022-05-02 16:28:45 -05:00
PCSX2 Bot
af75ac00e2 PAD: Update to latest controller database. 2022-05-02 18:03:05 +02:00
RedDevilus
67b66c1780 GameDB: Sniper Elite + Naruto Shippuuden Ninja 3-5 + GT4
Adds FMV switch for both and adds special texture half pixeloffset for Sniper Elite.
Finally adding Halfpixel normal offset for Gran Turismo 4.
2022-05-02 15:04:28 +01:00
RedDevilus
b3dce680b0 GSHWHack: Comment CrashBandicoot
Explains what the actual CRC does and why.
2022-05-02 15:04:08 +01:00
RedDevilus
d01a59650f GSCrc: Add missing Crash Bandicoot 2022-05-02 15:04:08 +01:00
RedDevilus
5ae987d48e GameDB: Crash Bandicoot - Wrath of Cortex
Adds missing gamefixes that influenced random corruptions and the famous fog wall.
2022-05-02 15:04:08 +01:00
Connor McLaughlin
6a6ecbf826 Common: Remove ThreadCPUTimer as it's unused now 2022-05-02 14:25:05 +01:00
Connor McLaughlin
4bdf180145 PerformanceMetrics: Switch to ThreadHandle 2022-05-02 14:25:05 +01:00
Connor McLaughlin
6ebb8c2e91 Threading: Add ThreadHandle class 2022-05-02 14:25:05 +01:00
Connor McLaughlin
5eae7a6328 Threading/Win32: Use QueryThreadCycleTime() for thread CPU time 2022-05-02 14:25:05 +01:00
TheLastRar
7d81c979fe DEV9: Fix Auto Adapter in Socket backend on Mac and FreeBSD 2022-05-02 15:01:41 +02:00
TheLastRar
c06ac00677 DEV9: Allow DHCP Server to find Gateway on Mac and FreeBSD 2022-05-02 15:01:41 +02:00
refractionpcsx2
85c754b456 GS: Limit scissor optimisation, fix repeat condition
Only allow scissors to happen on single draws, multiple draws (likely using it as a texture map) will possibly falsely limit the range.
2022-05-02 04:58:57 +01:00
refractionpcsx2
35d3547b62 GS: Fix up SW FMV switch behaviour 2022-05-02 04:53:51 +01:00
Immersion95
8661f42fce GameDB: Add SoftwareRendererFMVHack for KOF Orochi/Nests. (#5987)
The FMV has black frames when upscaled.
2022-05-02 01:46:04 +02:00
refractionpcsx2
a28098c4f8 GS: Account for frame offset in output circuit 2022-05-01 13:15:08 +01:00
arcum42@gmail.com
d45f34ee8b Remove iMisc.cpp, and move the code to System.cpp/h. 2022-05-01 11:43:14 +01:00
Connor McLaughlin
d552f8dc43 GS/HW: Implement moves in texture cache 2022-05-01 11:40:34 +01:00
Connor McLaughlin
b45360b49e VMManager: Don't load WS patches zip multiple times 2022-05-01 11:37:35 +01:00
Connor McLaughlin
fffdf8d671 Counters: Fix software renderer FMV fix with auto renderer 2022-05-01 11:36:57 +01:00
Connor McLaughlin
2634134481 microVU: Remove unused VSync() callback 2022-05-01 11:36:37 +01:00
Connor McLaughlin
c0ac71611b GS: Remove GSState.cpp
Seems like old/unused code, and we have a replacement GSDump replayer
now anyway.
2022-05-01 11:36:37 +01:00
Mrlinkwii
63ecdfefe3 Gamedb:add 'XGKickHack' to 'WRC II Extreme' 2022-04-30 22:04:41 +01:00
lightningterror
6345e8e467 GS-hw: Cleanup Half pixel offset Normal.
Now that custom res is removed, we don't need to split modx and mody.

Also purely rely on the tc to handle the HPO hack.
2022-04-30 18:30:11 +02:00
Ziemas
e96545ca29 IopCounters: missing include 2022-04-29 09:50:29 +01:00
arcum42
dc08858e0f build: Remove i386_flag, as it is no longer used. (#5897)
* build: Remove i386_flag, as it is no longer used.

build: Put back in ncpu.

* build: Move ncpu to set_make.
2022-04-28 13:35:15 -07:00
Mrlinkwii
f5787f9ba0 GameDB: Japanese entries Batch 3 2022-04-28 17:11:32 +01:00
refractionpcsx2
a271fe11e9 GS: limit merge circuit memory read height 2022-04-28 16:32:36 +01:00
RedDevilus
a20a3866d0 Qt: Append warning for Manual Hardware Renderer Fixes
Same as the WX side where if you enable this option for doing hardware renderer or upscaling fixes it will disable the automatic settings from the GameDB.
But in tooltip version.
2022-04-27 16:14:07 +01:00
RedDevilus
28d25fdf33 WX: Append warning for Manual HW Hacks
WX and Qt both will disable renderer and upscaling fixes if you want to manually handle the renderer and upscaling fixes. For years enabling this option didn't do much harm for users even if you didn't change any other setting, but since 1.7 development series automatised these to a degree it would be nice for users to know why their game looks potentially awful.
2022-04-27 16:14:07 +01:00
Connor McLaughlin
f13ad4fcb3 InputManager: Switch InputEventHandler to std::variant 2022-04-27 15:32:52 +01:00
Connor McLaughlin
a524410b0a Qt: Fix firing multiple bindings with chords 2022-04-27 15:32:52 +01:00
TellowKrinkle
8e23d8d557 GS: Fix ReadTexture on unaligned reads
No longer reads out of bounds
2022-04-27 09:33:20 +01:00
Connor McLaughlin
59531f005e Patch: Merge patch and patchHelper 2022-04-27 09:09:38 +01:00
Connor McLaughlin
4c8cba53ef Patch: Fix incorrect format string on patch error 2022-04-27 09:09:38 +01:00
Mrlinkwii
34cd53249d GameDB: Japanese entries Batch 2 2022-04-27 09:08:13 +01:00
Connor McLaughlin
14ce344a3f GS: Merge GSRendererNew and GSRendererHW 2022-04-27 09:06:05 +01:00
TellowKrinkle
cc5142000b MTGS: Prevent the emulator from crashing if GS fails to init 2022-04-27 01:49:59 -05:00
TellowKrinkle
1ad6532f1a GS:MTL: Report error if no Metal devices are available 2022-04-27 01:49:59 -05:00
TellowKrinkle
f136a1a970 WX: Make GSDumpViewer override picker properly show only enabled options 2022-04-27 01:49:59 -05:00
TellowKrinkle
a959ec7571 CI:macOS: Disable OpenGL
It won't work
2022-04-27 01:49:59 -05:00
TellowKrinkle
e1a6304e32 CMake: Set version based on git tag 2022-04-27 01:49:59 -05:00
TellowKrinkle
be05c95026 CI:macOS: Add MoltenVK to build 2022-04-27 01:49:59 -05:00
TellowKrinkle
3983e542b2 CI: Enable macOS artifacts 2022-04-27 01:49:59 -05:00
TellowKrinkle
3d76652b5f macOS: Build dependencies manually 2022-04-27 01:49:59 -05:00
lightningterror
6532dbced4 GameDB: Add preload frame data for Ninja Assault.
Fixes intro captions not displaying.
2022-04-27 00:45:36 +02:00
refractionpcsx2
fe27ebefc8 GS: Ignore fractional parts when reducing tex ranges 2022-04-26 16:57:49 +01:00
Connor McLaughlin
6e84613a14 GS: Make renderer a global 2022-04-26 10:33:05 +01:00
Connor McLaughlin
568ebc6199 GS/HW: Don't clear temporary copies for HDR/DS
Invalidating is enough here.
2022-04-26 09:45:53 +01:00
Connor McLaughlin
cf1d67d927 GS: Adjust texture coverage based on scissor
A good test case here is Resident Evil 4, the shuffles draw over the
entire framebuffer, but get scissored to each strip.
2022-04-26 09:45:53 +01:00
Connor McLaughlin
8181cc8528 GS: Only copy texture coverage area for current FRAME/Z sources 2022-04-26 09:45:53 +01:00
Connor McLaughlin
b344ee094f GS: Make CopyRect() take a destination offset 2022-04-26 09:45:53 +01:00
TellowKrinkle
b042aeacf5 PAD: Fix race on shutdown 2022-04-26 00:01:58 -05:00
NightFyre
fea58d2271 GameDB: SOCOM Combined Assault NTSC Patch (#5964) 2022-04-26 00:43:23 +01:00
refractionpcsx2
ca5da27170 GS: Correct display offsets for Interlaced (FFMD) Framebuffers 2022-04-26 00:35:52 +01:00
RedDevilus
11eab828c4 Qt: Fix VuClamp values
This was an oversight, probably from copying the EEClamp value variables.
2022-04-25 23:28:03 +01:00
RedDevilus
8ca3f9a9c2 GameDB: SOCOM 3 + Combined Assault
Fixes SPS and invisible/flickering characters.
2022-04-25 23:28:03 +01:00
Mrlinkwii
deb044357b GameDB: game fixes for 'DMC', 'Fatal Frame' and 'MX vs. ATV - Untamed' 2022-04-25 23:04:37 +01:00
PCSX2 Bot
00c07d2dff PAD: Update to latest controller database. 2022-04-25 18:09:59 +02:00
Connor McLaughlin
185ed3ce0b MTGS: Combine init/read FIFO and remove several MTGS waits 2022-04-25 13:32:53 +01:00
BuildTools
3b043250b6 UI: Rename Ultra Blending to Maximum Blending
Rename Ultra Blending to Maximum Blending
2022-04-25 11:43:04 +02:00
Connor McLaughlin
3359b3c7ab GS/DX11: Fix possible use-after-free on cached RT/DS 2022-04-25 09:27:43 +01:00
TellowKrinkle
6b1e483d28 GS: fbfetch full_barrier and one_barrier are identical 2022-04-24 23:10:38 -05:00
TellowKrinkle
d3faa05479 GS:MTL: Avoid uchar in shaders
Intel compiler's uchar codegen is buggy
2022-04-24 23:10:38 -05:00
Connor McLaughlin
73f17be890 Qt: Implement proper data directory selection 2022-04-24 06:08:37 +01:00
refractionpcsx2
9292ceedb1 GS: Correct SetScaling when ignoring offsets (FB size) 2022-04-24 01:43:08 +01:00
refractionpcsx2
d1470a9935 GS: Clean up some code and correct heights when offset by 1 2022-04-24 01:43:08 +01:00
arcum42@gmail.com
38fa137cfd build: Include CrashHandler.cpp in cmake. Fixes #5938. 2022-04-24 01:42:10 +01:00
qurious-pixel
a7288d8ad8 BUILD: exclude libgmodule-2.0 2022-04-23 18:22:31 +02:00
Connor McLaughlin
0692517f13 ElfObject: Ignore section headers when offset is invalid
This happens in V-Rally 3:

(ELF) Section header offset 14853196 is larger than file size 5898828
2022-04-22 13:09:31 +01:00
Connor McLaughlin
4f44e3fc46 GS/SW: Get rid of extra pointers to perfmon 2022-04-22 11:37:11 +01:00
Connor McLaughlin
14398da51f GS/SW: Fix use-after-free on worker thread shutdown 2022-04-22 11:37:11 +01:00
Sam H
6e8897d62b build: use system wayland libs if available (appimage) 2022-04-21 19:27:38 +01:00
Connor McLaughlin
69da1e4559 Qt: Install crash handler on startup 2022-04-21 14:21:49 +01:00
Connor McLaughlin
abde47fa18 Common: Add CrashHandler 2022-04-21 14:21:49 +01:00
seta-san
f46b406cbd ReadMe.md: Clarify only Windows 8.0 dropped. 2022-04-20 21:16:48 +01:00
RedDevilus
48313b42a2 GameDB: Mosquito + RE Dead Aim + Ice Age
Adds some missing upscaling fixes for Mister Mosquito (blurriness when upscaling) and quite a few for Resident Evil - Dead Aim.
Along with Ice Age Meltdown upscaling and a rare SPS issue and Ice Age 3 upscaling.
2022-04-20 21:07:39 +01:00
Connor McLaughlin
1e06b57f25 VMManager: Fix disc path when specifying source type 2022-04-19 12:34:03 +01:00
lightningterror
8a6c896dde vcxproj.filters: Adjust d3d shader and source file group naming to accommodate d3d12 addition. 2022-04-19 10:54:45 +02:00
lightningterror
b3c7b07813 GS-qt: Gray out texture barriers and geometry shaders on d3d or sw renderers. 2022-04-19 10:52:59 +02:00
lightningterror
65072ddbe5 readme: Remove broken screenshots.
Ideally we should put new ones.
2022-04-18 22:38:44 +02:00
lightningterror
d42fb851a2 GS-wx: Gray out texture barriers and geometry shader options on d3d. 2022-04-18 22:01:25 +02:00
lightningterror
ea0791a3bf pine: Fix Wswitch-bool warning. 2022-04-18 21:10:35 +02:00
lightningterror
8d4df7f74b spu2: Fix Wunused-private-field warning. 2022-04-18 21:10:35 +02:00
PCSX2 Bot
4b07eae80e PAD: Update to latest controller database. 2022-04-18 18:02:26 +02:00
lightningterror
77162ff637 GS-d3d11: Purge the NVIDIA hack.
The driver issue got resolved by nvidia.
2022-04-18 17:25:32 +02:00
Timothy O'Barr
e10f414724 CDVD: Rename cdrom files to Ps1CD for clarity of function (#5907) 2022-04-18 12:15:23 +01:00
Mrlinkwii
53c3f253e6 GameDB:add 'EETimingHack' to'Harry Potter and the Chamber of Secrets' 2022-04-18 12:14:22 +01:00
Connor McLaughlin
b0f20c9973 GS/DX11: Fix MMOD=1 merge background color 2022-04-18 04:29:19 +01:00
Sam H
5c3ae656a0 GS: fix display width calculation for frame when offsets off 2022-04-17 23:21:50 +01:00
TellowKrinkle
a98efdfedd GS: Per-selector C draw scanline 2022-04-17 15:22:49 -05:00
TellowKrinkle
3b8eb6731c Add more values to GSScanlineSelector ToString 2022-04-17 15:22:49 -05:00
TellowKrinkle
89bc4707ab Add to_string to GSScanlineSelector 2022-04-17 15:22:49 -05:00
TellowKrinkle
e5a8b01980 GS: Always compile C rasterizer 2022-04-17 15:22:49 -05:00
Connor McLaughlin
7194542029 Qt: Fix fullscreening in Wayland 2022-04-17 11:56:37 +01:00
Connor McLaughlin
06beadba74 CdRom: Fix clear error bit in StartReading() 2022-04-17 11:42:48 +01:00
Connor McLaughlin
b10249af7d CdRom: Remove Speed field/add accessor instead
This way it doesn't break save states.
2022-04-17 11:42:48 +01:00
Ty Lamontagne
1f04214461 Dmac: LegacyDmac.cpp -> Dmac.cpp 2022-04-17 10:54:39 +01:00
SeraphisCain
39d611e870 GameDB: Transformers Tatakai, T3: The Redemption, Urban Reign
GameDB fixes for a few games.
2022-04-17 10:47:09 +01:00
Connor McLaughlin
b913d39a50 Common/Timer: Fix closing invalid handle on Win32
Only is an issue if you have a debugger attached and the exception
enabled.
2022-04-17 10:45:22 +01:00
TellowKrinkle
eb60e9aa9b Common: Avoid libstdc++ assert 2022-04-17 10:44:02 +01:00
Mrlinkwii
53bb0c508f GameDB: upscaling fixes and documentation updates 2022-04-16 19:40:26 +01:00
Connor McLaughlin
1c50d3e4b3 GS: Add stat for barriers 2022-04-16 19:10:18 +01:00
Connor McLaughlin
de724d9570 GS/HW: Skip unnecessary barriers (usually two pass alpha) 2022-04-16 19:10:18 +01:00
Connor McLaughlin
e8293b2e06 GS/Vulkan: PrimID DATE doesn't need feedback loop 2022-04-16 19:10:18 +01:00
refractionpcsx2
904345ff82 GS: Get display width for frame when offsets off 2022-04-16 18:21:00 +01:00
Connor McLaughlin
d16592817b Frontend/OpenGLHostDisplay: Remove unused variables
clang likes to whinge about this one.
2022-04-16 13:57:23 +02:00
Connor McLaughlin
14f1a78608 GS/DX12: Fix DATE not being set in shader macros 2022-04-16 03:57:04 +01:00
refractionpcsx2
68c2a68087 microVU: Clean up warnings 2022-04-16 03:20:54 +01:00
refractionpcsx2
ae83f729db USB: Clean up warnings 2022-04-16 03:20:54 +01:00
refractionpcsx2
c53f4d0d63 SPU2: Clean up warnings 2022-04-16 03:20:54 +01:00
refractionpcsx2
cbb3134740 App/BIOS: Clean up warnings 2022-04-16 03:20:54 +01:00
refractionpcsx2
9b97c157f2 Recording: Clean up warnings 2022-04-16 03:20:54 +01:00
refractionpcsx2
11cf244e97 GS: Clean up warnings 2022-04-16 03:20:54 +01:00
kenshen112
6673bd9212 CDVD.cpp: Remove Elf parser from ps1 mode. 2022-04-16 03:19:21 +01:00
kenshen112
02dfc5d20d cdrom: Update status flags and implementations for PSX CD-Rom.
Added SEEKERROR and IDERROR status. Set StatP to account for SEEKS, READS and shell open.
Added speed to cdrom struct instead of cdvd. Adjustments to cdlPlay to be in line with No$ description.
Added MODE_INIT. Removed old needless hack. Added ToDo in cdlPlay
2022-04-16 03:19:21 +01:00
SeraphisCain
565ff86ab4 GameDB: Several game fixes and a gamelist entry correction (#5872) 2022-04-16 02:50:36 +01:00
refractionpcsx2
5a77790859 BIOS/GUI: Mark Qt only variables as maybe unused 2022-04-16 02:59:21 +02:00
refractionpcsx2
66101f8628 SPU2: Clean up warnings 2022-04-16 02:59:21 +02:00
refractionpcsx2
2f70b153f2 GS: Clean up warnings, fix a small error. 2022-04-16 02:59:21 +02:00
refractionpcsx2
31fe9979dd GS: Fix undefined behaviour on interlacing 2022-04-15 22:12:04 +01:00
RedDevilus
4fc6e9240c OSD: Minor clean up
Fixes variable for interlacemode
2022-04-15 22:01:48 +01:00
RedDevilus
0eae59ee66 GameDB: Black
GameDB Black roundsprite to half for lighting.
2022-04-15 22:01:48 +01:00
RedDevilus
8e6cd47f25 PCSX2: Fix Interlacing Ini
Oversight in having the correct config for the ini. Replaced CycleMipmap mode with the CycleInterlace one for correct OSD message.
2022-04-15 20:34:51 +01:00
Connor McLaughlin
ecdbe17fba Wx: Fix widescreen patch loading 2022-04-15 19:44:05 +01:00
Connor McLaughlin
0e9dcf74b2 Common/Semaphore: Fix WaitWithYield() returning immediately
This caused the WaitGS() issued from the main thread when applying
renderer settings (while the core thread was paused) to return
immediately, and a massive race resuming.
2022-04-15 19:43:22 +01:00
RedDevilus
5297c2a995 GameDB: Japanese entries
Adds a bunch of gamefixes and upscaling fixes to games as well as just entries.
Fixes:
- 0 Story
- Amagami
- Bleach Blade Battlers 2nd
- Chobits
- D.C. Da Capo The Origin
- Pandora - Kimi no Namae o Boku wa Shiru
- Katekyoo Hitman Reborn! Nerae!? Ring x Vongola Trainers
- Kateikyoushi Hitman Reborn!! Let's Ansatsu! Nerawareta 10 Daime!
- Kino no Tabi - The Beautiful World
- Kyuuketsu-hime Yui - Sen'yashou
- Shikigami no Shiro - Nanayozuki Gensoukyoku
- Secret of Evangelion
2022-04-15 19:41:48 +01:00
Connor McLaughlin
edf5e2c14e Vulkan/Context: Use static loading for vk_mem_alloc
In doing so, we simplify things a bit, as we can assume Vulkan 1.1
support. It needed it before anyway, and would crash on Vulkan 1.0
drivers.
2022-04-15 19:41:12 +01:00
Connor McLaughlin
9180adb850 VulkanHostDisplay: Handle surface loss better
Just try again next frame.
2022-04-15 19:41:12 +01:00
Connor McLaughlin
1b080f1777 Vulkan/Loader: Make vkDestroyInstance() a module import 2022-04-15 19:41:12 +01:00
Connor McLaughlin
0a2584172a GS/HW: Clear blend bits for color dest blend 2022-04-15 16:55:24 +02:00
Connor McLaughlin
1993203d26 GS: Add Direct3D 12 renderer 2022-04-15 12:56:41 +01:00
Connor McLaughlin
3c18cdcb1f Frontend: Add D3D12HostDisplay 2022-04-15 12:56:41 +01:00
Connor McLaughlin
e767fb8d35 Common: Add D3D12 wrapper/helper classes 2022-04-15 12:56:41 +01:00
Connor McLaughlin
3255422836 Common/StringUtil: Optimize equal stride copy case 2022-04-15 12:56:41 +01:00
Connor McLaughlin
67fa06b933 3rdparty/imgui: Enable DX12 backend 2022-04-15 12:56:41 +01:00
Connor McLaughlin
398e468c9e 3rdparty: Add D3D12MemoryAllocator 2022-04-15 12:56:41 +01:00
Connor McLaughlin
f7ee35e578 Wx: Reset/restore API state after window resize 2022-04-15 12:56:41 +01:00
Connor McLaughlin
800b458d3d Wx: Fix incorrect OSD scale after resize on Windows 2022-04-15 12:56:41 +01:00
Connor McLaughlin
3f31a4d25b GS: Fix edge case of broken alpha with no-DSB+ATST 2022-04-15 12:56:41 +01:00
Connor McLaughlin
0592abd31b GL/ContextEGL: Fix broken surface creation
Regression from #5676.
2022-04-15 11:46:07 +01:00
refractionpcsx2
55d546b892 GS: Maintain framebuffer size when not using offsets
This reduces blurriness
2022-04-15 11:07:22 +01:00
refractionpcsx2
f28e42c4fe GS: Set correct framebuffer size for output 2022-04-15 11:07:22 +01:00
refractionpcsx2
7cdc849ffa GS: Clean up new DISPLAY Merging code. 2022-04-15 11:07:22 +01:00
refractionpcsx2
eed04b3ff3 GS: Redesign some of the offset code for FFMD
Half height buffers need to be drawn half height, not stretched to full height during the draw, it will be bad times.
2022-04-15 11:07:22 +01:00
refractionpcsx2
e2044eba66 GS/Window: Add Automatic 4:3/3:2 mode, keep 4:3 separate 2022-04-15 11:07:22 +01:00
refractionpcsx2
06e6d12e2f GS: Added automatic 3:2 aspect for 480p mode 2022-04-15 11:07:22 +01:00
refractionpcsx2
48fd68ca87 GS: Implement PCRTC Offsets
This is off by default because people will complain about black borders, but I've tried to keep it to a minimum.

Enabling this option (Screen Offsets in the graphics settings) will allow you to position the screen in games which allow you to do so, maintain correct aspect ratios, and screen shake effects which are done on PCRTC (WipEout Fusion for example) will work.
2022-04-15 11:07:22 +01:00
refractionpcsx2
7ad59a7af1 GS: Remove NTSC Saturation option (No longer required) 2022-04-15 11:07:22 +01:00
refractionpcsx2
bae2c9c1d8 GS: Saturate DISPLAY heights and limit max height 2022-04-15 11:07:22 +01:00
Connor McLaughlin
3d171686b5 CI/Windows: Switch to Qt 6.3.0 2022-04-15 08:53:02 +01:00
Connor McLaughlin
f86b3a32cd Qt: Switch to QtEntryPoint.lib instead of explicit main() 2022-04-15 08:53:02 +01:00
Connor McLaughlin
59d6113ee4 VSProps: Fix Qt TLS plugins not getting copied 2022-04-15 08:53:02 +01:00
Connor McLaughlin
f270f34865 Qt: Move to Qt 6.3.0 2022-04-15 08:53:02 +01:00
Connor McLaughlin
b2514d49d2 3rdparty/wx: Fix compilation in MSVC conformance mode 2022-04-15 08:53:02 +01:00
Tyler Wilding
2951068e0c memcard: Detect and attempt to repair broken index files from the v1.7.2115 bug 2022-04-15 08:47:46 +01:00
Ty Lamontagne
a4dcaa7c14 BiosTools: Allow BIOS region patching 2022-04-15 08:44:46 +01:00
TellowKrinkle
b90de6d89f PAD: Process keycodes the same way on Linux and macOS 2022-04-15 08:43:12 +01:00
BuildTools
532a7addd4 Documentation: Update recommended OpenGL version 2022-04-15 08:42:59 +01:00
tcoyvwac
5389178644 Common: Prefer standard algorithms
GL/ContextEGL.cpp:
Prefer std::find_if over ranged-for.
2022-04-15 08:42:29 +01:00
tcoyvwac
6cbdc8c8b7 Common: Prefer pre-built array-form to assign values.
GL/ContextEGL.cpp:
Replace raw-index manipulation / arithmetic as logic. Now a variable-length array.
2022-04-15 08:42:29 +01:00
tcoyvwac
6e6a70b8ed Common: Prefer returning std::array by lambda expression
GL/ContextEGL.cpp:
Replace raw-index manipulation / arithmetic as logic. Variable now using IIFE (Immediately invoked function expression) to strengthen immutability.
2022-04-15 08:42:29 +01:00
TellowKrinkle
1a0a0423e7 Core: Switch MTGS and SysThreadBase to WorkSema 2022-04-15 08:41:58 +01:00
TellowKrinkle
b28779b0f6 Common: Add dead thread support to WorkSema
MTGS supports having exceptions kill the thread and send their result back to a thread calling WaitGS...
2022-04-15 08:41:58 +01:00
TellowKrinkle
63fd349e3c GS: Switch GSJobQueue to WorkSema 2022-04-15 08:41:58 +01:00
TellowKrinkle
481c92c1c8 MTVU: Use WorkSema 2022-04-15 08:41:58 +01:00
TellowKrinkle
d733730950 Common: Add WorkSema 2022-04-15 08:41:58 +01:00
SeraphisCain
93a9e5dd83 GameDB: Fixes for Wrestle Kingdom 1 + 2 (#5863) 2022-04-15 08:24:14 +01:00
TellowKrinkle
db9672509c 3rdparty: Update fmt to 8.1.1 2022-04-15 08:22:13 +01:00
Mrlinkwii
ffe69d313b GameDB: add missing serials 2022-04-15 08:19:43 +01:00
Silent
502a44e9f5 XInputSource: Add support for SCP API extension
Allows to query pressure sensitive DualShock 3 buttons via
XInput when DsHidMini is used in SXS mode, with its xinput1_3.dll dropped
in the emulator directory.
2022-04-15 08:18:57 +01:00
Silent
5e913b0e9e XInputSource: Fix triggers input range 2022-04-15 08:18:57 +01:00
Connor McLaughlin
864651ce8d System: Purge WinCompressNTFS.cpp
This is the most overengineered, stupid rubbish I've ever seen.
2022-04-15 08:15:40 +01:00
Connor McLaughlin
850deed6c1 HwRegs: Swap wxString desc() for std::string 2022-04-15 08:15:40 +01:00
Connor McLaughlin
63424b765d CDVD: Purge wxString 2022-04-15 08:15:40 +01:00
Connor McLaughlin
a635e84d82 FileSystem: Add path splitting helpers 2022-04-15 08:15:40 +01:00
Connor McLaughlin
6991f819f3 SaveState: Switch to zstd compression
zstd can be 10x+ fast compressing, 2x+ decompressing at default levels,
and provides slightly better ratios.

There's a hidden option in the config, SavestateZstdCompression, which
you can set to false if you want to use deflate.
2022-04-15 08:15:40 +01:00
Connor McLaughlin
a22c634cd4 3rdparty: Add zstd 2022-04-15 08:15:40 +01:00
Connor McLaughlin
80aaa962ec Common: Move IniInterface to WX GUI
Qt doesn't use it.
2022-04-15 08:15:40 +01:00
Connor McLaughlin
876ea3db52 Common: Purge pxStreams and some other wx string routines 2022-04-15 08:15:40 +01:00
Connor McLaughlin
1bfc0f3138 CDVD: Remove wxStr from SYSTEM.CNF parsing 2022-04-15 08:15:40 +01:00
Connor McLaughlin
5fa9427323 Patch: Store gamedb patches as single string 2022-04-15 08:15:40 +01:00
Connor McLaughlin
29cea58471 Patch: Remove all wx usage 2022-04-15 08:15:40 +01:00
Connor McLaughlin
4779bc830a StringUtil: Add more whitespace cleaners and ParseAssignmentString 2022-04-15 08:15:40 +01:00
Connor McLaughlin
dd8a645986 SaveState: Use libzip instead of wx 2022-04-15 08:15:40 +01:00
Connor McLaughlin
9aa2c52b20 3rdparty: Add libzip 2022-04-15 08:15:40 +01:00
Connor McLaughlin
0914b2a474 Qt: Fix compiling without Vulkan renderer 2022-04-15 07:21:18 +01:00
Connor McLaughlin
d387a1f4dc GS: Support compiling without OpenGL renderer 2022-04-15 07:21:18 +01:00
arcum42
3488aa54be Remove wx code from build.sh and a bit of cleanup. (#5817)
* build: Fix up the menu printed by build.sh.

* build: Removed wx code from build.sh.
2022-04-14 22:04:26 -07:00
lightningterror
de541aeba9 GS: Remove unused default configs. 2022-04-14 12:07:59 +02:00
lightningterror
5fb00bd6c7 GS: Fix some log warnings. 2022-04-14 00:47:08 +02:00
kenshen112
fdabc82342 Remove IopCommon.h added proper includes to files. Removing circle includes in several files that sometimes was several layers deep 2022-04-11 21:25:20 +01:00
refractionpcsx2
e5f90f176c Emitter: Fix s8 problem with displacements 2022-04-11 21:09:12 +01:00
PCSX2 Bot
6438547edc PAD: Update to latest controller database. 2022-04-11 18:33:35 +02:00
dependabot[bot]
0f0ab25fe8 Bump actions/upload-artifact from 2 to 3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 10:45:35 +01:00
TellowKrinkle
fc7a20dd0f wx: Fix compile on wx 3.1.6 2022-04-11 10:45:06 +01:00
TellowKrinkle
f8c7237bba i18n: Formatting 2022-04-11 10:45:06 +01:00
Ty Lamontagne
00af7d6835 GSState: Remove transfer direction warning 2022-04-10 07:19:52 +01:00
refractionpcsx2
86fb8e5809 GS: Flush PRIM on write if pending PRIM draw had TME 2022-04-08 11:46:27 +01:00
RedDevilus
29964c3f26 Qt: Fix interlacing
I actually made it backwards compatible but then reverted this line at the last minute, rendering the Qt variant useless. This fixes it again.
2022-04-08 08:24:54 +01:00
RedDevilus
ec787d090d Qt: Add Gzipped
WX supported this, I don't see why not add to Qt. Though no idea why anyone wants to use it above CSO or CHD if you look at filesize.
2022-04-08 08:24:54 +01:00
Connor McLaughlin
f9707e6809 LnxMisc: Use clock_gettime() instead of gettimeofday() 2022-04-07 21:22:24 +01:00
RedDevilus
5665e5e222 GameDB: Fix name + add comment
Fixes Ar Tonelico II and adds comments for Legion - The Legend of Excalibur
2022-04-06 21:06:55 +01:00
Mrlinkwii
336e5c77fe Gamedb: add 'VUSyncHack' to 'Next Generation Tennis 2003' 2022-04-06 20:36:43 +01:00
RedDevilus
d8b107f59c PCSX2: Interlacing to Deinterlacing
There are some more strings but don't want to mess around with too much
2022-04-06 19:19:01 +01:00
RedDevilus
19197fabe8 GameDB: God Of War 1 / 2
The GameDB changes were reverted but then the CRC hacks were removed so this fixes it.
2022-04-06 17:40:07 +01:00
Connor McLaughlin
3801825793 R3000A/R5900: Refactor interpreter/recompiler exits
Now, IOP breakpoints work nice and reliably in both interpreter and
recompiler, exiting as soon as possible, without leaving the event state
indeterminate.
2022-04-06 15:27:15 +01:00
Connor McLaughlin
25e15a16b1 VMManager: Add frame advance hotkey
Now that exits are consistent, this is easy.
2022-04-06 15:27:15 +01:00
Connor McLaughlin
5ac9419703 R5900: Make CPU exits consistent and safe
Previously, we would either throw an exception (ints), or longjmp out of
the recompiler when the execution state was checked. Unfortunately for
our stability, this happened at the end of the frame, just before it was
pushed to the GS, and in the middle of processing EE events (!).

Doing so not only meant that we executed a bunch of event
testing/exception code twice (once after we paused, again when we
resumed), but it also could potentially leave things in an inconsistent
state.

So instead, let's do it safely with a flag, replacing the old
iopBreakpoint flag, so there's no additional overhead on the hot path.
2022-04-06 15:27:15 +01:00
Connor McLaughlin
821e15f1ee Qt: Add QtHost::RunOnUIThread() 2022-04-06 15:22:39 +01:00
Connor McLaughlin
0efe03e726 Qt: Implement Host::RunOnCPUThread() 2022-04-06 15:22:39 +01:00
seta-san
577d6e735c Gamedb: Add Bumpy Trot Trial serial 2022-04-06 15:17:47 +01:00
Ty Lamontagne
7668123aaa gitignore: ignore bin/textures 2022-04-06 01:30:22 +02:00
Mrlinkwii
0b87d580c3 Gamedb: Add Hachi-One Diver serial. (#5828) 2022-04-05 20:40:14 +02:00
Connor McLaughlin
170a03cac6 GSDump: Drop last packet of truncated dumps 2022-04-05 12:08:06 +01:00
PCSX2 Bot
70d8acb812 PAD: Update to latest controller database. 2022-04-05 13:02:32 +02:00
TheLastRar
2670d5a9aa Core: Move Applying GameFixes into GameEntry
Also add similar logging to GS Hardware fixes (on Qt)
2022-04-05 11:12:14 +01:00
TheLastRar
44081671ac Config: Fix saving/loading EnableGameFixes in Core 2022-04-05 11:12:14 +01:00
refractionpcsx2
462b304bea GameDB: Update Simple Series entries 2022-04-05 11:06:58 +01:00
Odin Vex
059f58803c Remove erroneous unmanaged cleanup of managed code
`loadYamlFile` calls `OpenManagedCFile` which handles closing the file-handle used. Thus, closing the file-handle outside the API call to `OpenManagedCFile` is not necessary.
2022-04-05 11:04:51 +01:00
refractionpcsx2
e170e9281d GS: Fix reversed reversed GS copies. 2022-04-04 18:07:54 +01:00
Connor McLaughlin
5987e03463 GS: Force min/mag linear when trilinear is forced
Trilinear implies that min/mag will be linear. Less confusing, makes
sense, and the min/mag point + mip linear case is currently not handled
properly with regard to the GS registers.
2022-04-04 17:01:23 +01:00
Connor McLaughlin
ddbdfd47be GS: Make hardware renderer trilinear consistent
Trilinear without bilinear was inconsistent previously.
2022-04-04 17:01:23 +01:00
Connor McLaughlin
1b83e17d60 GS: Add automatic trilinear filtering level 2022-04-04 17:01:23 +01:00
AndreAuth
bc7ed4e7d0 GameDB: Metal Gear Solid 3 PAL - Fix blurry characters (#5819) 2022-04-04 11:33:16 +01:00
refractionpcsx2
283c7fa88c GS: Improve autoflush rect checks 2022-04-04 11:25:25 +01:00
Connor McLaughlin
d01ee3163d Qt: Add performance metrics to status bar 2022-04-03 23:59:05 +01:00
Mrlinkwii
90457e32b6 Gamedb: update changes to pdf 2022-04-03 10:09:05 +01:00
refractionpcsx2
4cb6c94693 CI/Docs: Update validation and document 2022-04-03 08:50:09 +01:00
refractionpcsx2
93c78a27b3 GS: Add interlace override to gamedb, revert earlier change 2022-04-03 08:50:09 +01:00
Connor McLaughlin
50452848e7 BiosTools: Bounds check strings in LoadBiosVersion() 2022-04-03 07:57:42 +01:00
Connor McLaughlin
4f70fd9583 VMManager: Make EE rec toggles reliable
Before, it'd swap out the Cpu while it was executing...
2022-04-03 07:57:02 +01:00
Connor McLaughlin
e6c8354ec8 EERec: Purge PCSX2_SEH define
No longer needed since we don't have 32-bit.
2022-04-03 07:57:02 +01:00
Connor McLaughlin
a1e77002c3 iR5900: Exit on NeedsReset not IsReset
This is an edge case which can be hit in Goemon, but also when changing
settings in Qt, as they will be applied at guest vsync time, which is
called within the JIT.

Also, do the reset before entering JIT code, rather than when the first
block is compiled.
2022-04-03 07:57:02 +01:00
Connor McLaughlin
099cd52381 gitignore: Remove unused portaudio files 2022-04-03 06:09:09 +02:00
lightningterror
0d1675fbaa GS-hw: Purge custom resolution entirely.
Code debt, not used anymore, get rid of it.
2022-04-02 16:54:26 +02:00
lightningterror
f021da5627 GS-tc-hw: Fix Normal Half pixel offset on 7x upscale. 2022-04-01 13:58:54 +02:00
refractionpcsx2
906480b8e2 GS: Only flush on PRIM if a new draw is requested 2022-04-01 10:48:22 +01:00
refractionpcsx2
38b83af714 GS: Improve interlace handling and odd frames 2022-04-01 10:48:01 +01:00
Tyler Wilding
05dab12b7c releases: simplify discord announcements, and link to the right page 2022-04-01 10:45:59 +01:00
TellowKrinkle
c0628a64a6 GS: Add Metal renderer to settings 2022-03-31 23:51:27 -05:00
TellowKrinkle
5ecaa9459d GS: Add Metal renderer 2022-03-31 23:51:27 -05:00
TellowKrinkle
24b2277206 GS: Give names to blend enums 2022-03-31 23:51:27 -05:00
TellowKrinkle
8e60d2c72e GS: Rename Int32 texture to PrimID
Not always Int32
2022-03-31 23:51:27 -05:00
TellowKrinkle
cfe2f9e6b4 Common: Add helpers for enum classes 2022-03-31 23:51:27 -05:00
TellowKrinkle
0a11b5898a CMake: Disable PCH for mm files 2022-03-31 23:51:27 -05:00
TellowKrinkle
be49de6fa0 Config: Format Pcsx2Config 2022-03-31 23:51:27 -05:00
RedDevilus
1ad52e918b GameDB: Caspian
Reduces ghosting but on normal vertex causes the rainbow corruption at the screen sides
2022-03-31 15:45:12 +01:00
Tzerinas
53388336d2 GameDB: Fixes for Tomb Raider Games
Added the FMV Hack for every game except Underworld and the missing mipmap Setting for the US version of Legend.
2022-03-31 15:44:58 +01:00
Chromaryu
4e1496e736 GameDB: Add Zwei AutoFix 2022-03-31 15:43:22 +01:00
RedDevilus
216c964d13 GameDB: Silent Hill Origins
Wildarms while making the alignment perfect in the 3D environment, messes with the maps.
2022-03-31 12:03:31 +01:00
Angel Toloza
6bb828eb8f GameDB : Atelier Marie + Elie: Salburg no Renkinjutsushi 1&2 (#5784) 2022-03-30 23:45:14 +01:00
Tzerinas
511845a1c4 GameDB: Corrected GSHW Fixes for Radiata Stories
Adds Special (Texture) and Align Sprite to Radiata Stories.
2022-03-30 23:39:28 +01:00
RedDevilus
89f10e1605 GameDB: ':' to '-' + GS and other fixes
Windows doesn't like you to use ':' in folders this caused issues for when CK1 did savestates in folders and now it's also messing with unable to add covers in Qt so better to replace them and also to avoid other issues now and the future.
GS HW Fixes and other fixes for:
- Adventures of Cookie & Cream, The
- Brothers in Arms - Earned in Blood / Road to Hill 30
- Black
- Chaos Legion
- God Hand
- Knockout Kings 2001
- Kuon
- Outrun 2006 / 2 SP
- Project Eden
- Psi-Ops - The Mindgate
- Punisher, The
- Ratchet Deadlocked (USA) / Gladiator (Europe) / 3 Up Your Arsenal
- Silent Hills Origins / Shattered Memories / 3 / 4
- SoulCalibur II / III

Also made sure that the comments and their spacing were consistent.
2022-03-30 23:38:18 +01:00
Connor McLaughlin
76b4e93604 Vulkan/ShaderCache: Don't delete cache when running 2 instances 2022-03-30 12:38:08 +02:00
Connor McLaughlin
cec089a271 D3D11/ShaderCache: Don't delete cache when running 2 instances 2022-03-30 12:38:08 +02:00
PCSX2 Bot
b4bd36c4b2 PAD: Update to latest controller database. 2022-03-28 18:04:15 +02:00
RedDevilus
338eb42b04 Qt: Reduce max SPU - Change Speed Preset
Qt has a leftover from the old SPU2-X values which is 3000 ms (3 seconds) latency meaning that if an user sets it to the max it will do something like this: Videoframe ~150 / 180 happens and it makes the first sound after 3 seconds for the first videoframe which is far too long. Also changed 1% speed as it messed with the GSdump player and too stuttery to be usable in other usecases.
2022-03-28 10:44:04 +01:00
lightningterror
8e42fce0aa gamedb: Add alignSprite to GOW 2.
Fixes water vertical lines.
2022-03-28 10:16:59 +02:00
lightningterror
a7900b342e GS-hw: Purge GodOfWar 1 and 2 crc hacks.
Not needed, can be solved with upscaling hw hacks, and gs db fixes are a thing.
2022-03-28 09:59:41 +02:00
Connor McLaughlin
506bbe1c08 GS/OpenGL: Don't emit #extension after #define for FXAA
This is technically not valid GLSL.
2022-03-28 09:24:51 +02:00
Connor McLaughlin
d32d8cc0ec Shaders/FXAA: Fix warnings with Vulkan compiler 2022-03-28 09:24:51 +02:00
Connor McLaughlin
0cb9655523 GS/Vulkan: Remove unused color attribute
Would likely be getting optimized out anyway.
2022-03-28 09:24:51 +02:00
Connor McLaughlin
3067bef82d GS/Vulkan: Implement FXAA 2022-03-28 09:24:51 +02:00
Connor McLaughlin
486764be03 GS/Vulkan: Implement shadeboost 2022-03-28 09:24:51 +02:00
Connor McLaughlin
5e336138d0 Qt: Add shadeboost settings 2022-03-28 09:24:51 +02:00
Connor McLaughlin
4a5180bc0a GS: Put shadeboost params in uniforms
Compiling variants for these is silly.
2022-03-28 09:24:51 +02:00
dependabot[bot]
dd28e33612 Bump peter-evans/create-pull-request from 3 to 4
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3 to 4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v3...v4)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 09:10:03 +02:00
dependabot[bot]
b66c0411df Bump actions/cache from 2.1.7 to 3
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 09:09:41 +02:00
arcum42
c59b114a1d Build: Remove cross compiling from build.sh. (#5713) 2022-03-27 17:38:41 -07:00
TheLastRar
352faeddb2 DEV9: Add Socket api mode 2022-03-27 16:16:19 +01:00
TheLastRar
140d44d826 DEV9: Add code for reading ARP, TCP & ICMP packets 2022-03-27 16:16:19 +01:00
TheLastRar
db220001f6 DEV9: Add cloning of packets 2022-03-27 16:16:19 +01:00
TheLastRar
5ac9b5576a DEV9: Add PayloadData classes 2022-03-27 16:16:19 +01:00
TheLastRar
b23873e0ed DEV9: Add adapter reset function 2022-03-27 16:16:19 +01:00
TheLastRar
284ec35699 DEV9: Add GetHeaderLength() to IP_Packet 2022-03-27 16:16:19 +01:00
TheLastRar
cb0e629dd3 DEV9: Make internal servers protected 2022-03-27 16:16:19 +01:00
TheLastRar
1aaadd6228 DEV9: Make DHCP_Server::GetGatewaysLinux() public
Needed for auto adapter on linux, if only to check if an adapter has a gateway
2022-03-27 16:16:19 +01:00
TheLastRar
e20a357340 DEV9: Allow user DHCP settings to be overridden 2022-03-27 16:16:19 +01:00
TheLastRar
fef2952d47 DEV9: Fix typo in DHCP_Packet 2022-03-27 16:16:19 +01:00
TheLastRar
f4b2e0dd7a DEV9: Correct PayloadPtr::WriteBytes() 2022-03-27 16:16:19 +01:00
Connor McLaughlin
d3aace98ac GS/OpenGL: Fix fb target conflict without fbfetch 2022-03-27 04:33:20 +01:00
Connor McLaughlin
3a7f82eb66 GS/HW: Fix fbmask not inserting barriers
Or, missing the fb copy for D3D/barriers off.

Regression from fbfetch PR.
2022-03-27 04:33:20 +01:00
Connor McLaughlin
3e24b678c4 Build: Don't install pcsx2 core static lib on Linux 2022-03-26 14:11:33 +00:00
Connor McLaughlin
2ab6ca06ed Qt: Fix compile issues on Linux 2022-03-26 14:11:33 +00:00
Connor McLaughlin
9ac5041b43 Qt: Fix double entries in audio output modules 2022-03-26 14:11:33 +00:00
Connor McLaughlin
9262422d01 Qt: Add missing null terminator in audio settings 2022-03-26 07:56:52 +00:00
Mrlinkwii
9f04becc7a GameDB : various game improvements 2022-03-25 17:00:57 +00:00
RedDevilus
8485af6cac GameDB: GS HW Fix XI
The game also needs round sprite half for the transitional areas and red forest because of vertical lines similar to Star Ocean 3.
+ other fixes, read the GameDB comments for more information.
Relevant games:
- Atelier Iris 3 - Grand Phantasm
- Baldur's Gate - Dark Alliance 1 / 2
- Call of Duty 2 - Big Red One
- Dark Cloud 1 / 2
- Mana Khemia 1 / 2
- Sims 2 - Castaway
- Valkyrie 2 - Silmeria
2022-03-25 16:31:07 +00:00
TheLastRar
48f7e6c63f DEV9: Add Qt UI 2022-03-25 13:50:25 +00:00
TheLastRar
e1fb84d6a3 DEV9: Separate HddCreate code from Wx
Also disable auto generating an image on boot if one is not found
2022-03-25 13:50:25 +00:00
TheLastRar
5db9a738c5 Config: Integrate internal DNS host list on Qt 2022-03-25 13:50:25 +00:00
TheLastRar
145e75624d Config: Allow setting DNS1/2 internal instead of manual/auto 2022-03-25 13:50:25 +00:00
Connor McLaughlin
d09b49e17c Qt: Hook up automatic mapping 2022-03-25 12:51:31 +00:00
Connor McLaughlin
fdc3ca1227 PAD: Add automatic mapping functions 2022-03-25 12:51:31 +00:00
Connor McLaughlin
51d47a1455 InputManager: Add generic input mappings 2022-03-25 12:51:31 +00:00
Connor McLaughlin
9504671919 PAD: Add macro buttons 2022-03-25 12:51:31 +00:00
Connor McLaughlin
e5248db844 StringUtil: Add SplitString() 2022-03-25 12:51:31 +00:00
Connor McLaughlin
551d013b63 Qt: Add shutdown hotkey 2022-03-25 12:51:18 +00:00
Connor McLaughlin
d65950cda2 VMManager: Add BIOS check on startup
Except when running GS dumps.
2022-03-25 12:51:18 +00:00
Connor McLaughlin
15c38a0a4e GSDumpReplayer: Add missing license header 2022-03-25 12:51:18 +00:00
TheLastRar
74ed14496b Qt: GS Settings Fixes 2022-03-25 10:26:23 +00:00
Connor McLaughlin
1fa6fb0a8c Qt: Add memory card settings 2022-03-25 10:26:09 +00:00
Connor McLaughlin
3dc6ae115f Qt: Implement (partial) audio settings 2022-03-25 10:26:09 +00:00
Connor McLaughlin
fa36b9b5cb MemoryCardFile: Add formatted/mtime to query, rename/delete ops 2022-03-25 10:26:09 +00:00
Connor McLaughlin
47fff9304b FileSystem: Add DeleteDirectory() and recursive variant 2022-03-25 10:26:09 +00:00
Mrlinkwii
29c0d93864 GUI/Docs : update compatibility URLs 2022-03-23 10:27:36 +00:00
RedDevilus
38ff521851 GameDB: Megaman + Nicktoons
Megaman X - Command Mission flickering FMV fix and fix for the lighting in the game Nicktoons Unite!
2022-03-22 22:02:30 +00:00
RedDevilus
34de1bffc6 GameDB: Remove outdated comments
The gameDB still had some leftover comments that aren't true anymore. In the past before 1.7.2002 / https://github.com/PCSX2/pcsx2/pull/3936 you needed to use full boot to correctly pass your chosen BIOS language to be piped to the game. Basically fast boot defaulted to the first entry in the available language list.
Full boot:
If you want to see BIOS logo - Good
Region check - Bad

Fast boot:
Immediately jump into the game - Good
Skips region check - Good
Now acts like full boot for languages - Good
2022-03-22 20:58:02 +00:00
Connor McLaughlin
8dc1592278 GSDumpReplayer: Fix ReadFIFO2 packet executing on wrong thread 2022-03-22 16:50:31 +00:00
Mrlinkwii
5b86205349 Gamedb: add 'VUSyncHack' to Totally Spies! Totally Party 2022-03-22 14:45:35 +00:00
Mrlinkwii
0d4fbd540e Gamedb: Fix 'SLES-54453' title 2022-03-22 14:27:39 +00:00
Connor McLaughlin
b9edabc236 Qt: Fix incorrect setting binding for display linear 2022-03-22 13:38:26 +00:00
Connor McLaughlin
180d9ae9c9 Qt: Correct EE/IOP console defaults 2022-03-22 13:38:26 +00:00
Connor McLaughlin
80cc2f0cb7 Qt: Log machine caps on startup 2022-03-22 13:38:26 +00:00
Connor McLaughlin
1927896442 GS: Fix some edge cases with fbfetch
Second alpha pass with A masked, DATE enabled, etc.
2022-03-21 20:24:09 +00:00
RedDevilus
bf9c1176b6 GameDB: Fix Midnightclub 3 + Add Evangelion Jo
Special texture to:
Midnight club 3
Evangelion - Jo
2022-03-21 20:23:54 +00:00
Tzerinas
166156519a GameDB: Fixes to TeamICO games.
Adds the Software Renderer FMV hack to ICO and Half-Pixel Offset (Vertex) to both games.
2022-03-21 20:16:46 +00:00
lightningterror
d89daa1b25 misc: A few more 32bit cleanups. 2022-03-21 20:56:03 +01:00
lightningterror
efc17f265c readme: Update to reflect recent drop of 32bit. 2022-03-21 20:28:33 +01:00
lightningterror
8427e6fd3e emitter test: Cleanup 32bit code. 2022-03-21 20:21:36 +01:00
lightningterror
f1ac712eba build: Remove _M_X86_64, __M_X86_64, _M_X86_32 defines.
32bit cleanup.
2022-03-21 20:21:36 +01:00
lightningterror
0d4394a749 core: Clean up 32bit code. 2022-03-21 20:21:36 +01:00
lightningterror
9dac598113 common: Clean up 32bit code. 2022-03-21 20:21:36 +01:00
lightningterror
6db573d255 emitter: Clean up 32bit code. 2022-03-21 20:21:36 +01:00
Connor McLaughlin
9b21f31b0d GS/Vulkan: Fix crash is vertex/index buffer causes exec 2022-03-21 18:36:31 +00:00
lightningterror
2fedecb809 GS-hw: Purge Evangelion crc hack.
It's broken, HPO special does the job.
Someone should add it to the hw gamefixes.
2022-03-21 17:25:25 +01:00
PCSX2 Bot
b24a8c70e3 PAD: Update to latest controller database. 2022-03-21 17:14:41 +01:00
RedDevilus
d6684efd26 GameDB: GS HW Batch X
Relevant:
Bully
Colosseum - Road to Freedom
Dark Chronicle (Dark Cloud 2)
Killzone
God of War
Gun
Midnight Club 3
Mortal Kombat - Deadly Alliance
Need for Speed Carbon / Most Wanted / Undercover
Prince of Persia - Sand of Time / The Two Thrones / Warrior Within
Resident Evil 4 (BioHazard 4)
Thrillville / Off the Rails
2022-03-21 15:04:45 +00:00
TellowKrinkle
644241959a GS: Fix inverted DSB check 2022-03-21 02:33:38 +00:00
TellowKrinkle
273c1b1922 GS: Clean up leftover definitions
Accidentally leftover during the blend op refactor
2022-03-21 02:33:38 +00:00
Connor McLaughlin
45682c382f GS: Add NO_COLOR flag to PS (depth-only) 2022-03-20 23:41:33 +00:00
Connor McLaughlin
4e6b86f8f4 GS/Vulkan: Use VK_ARM_rasterization_order_attachment_access if available 2022-03-20 23:41:33 +00:00
Connor McLaughlin
a6b4ca69db GS/Vulkan: Support rendering without D32S8 2022-03-20 23:41:33 +00:00
Connor McLaughlin
6b32e00097 GS: Make factors part of blend state
Instead of using the blend map indices.
2022-03-20 23:41:33 +00:00
Connor McLaughlin
19d310475b GS: Draw alpha pass when dual source blend is missing 2022-03-20 23:41:33 +00:00
Connor McLaughlin
a8b9df3952 GS: Utilize GL_EXT_framebuffer_fetch where available 2022-03-20 23:41:33 +00:00
Connor McLaughlin
bb75c78c1a GS: Add option to disable texture barriers/geometry shaders 2022-03-20 23:41:33 +00:00
Mrlinkwii
57ea137982 Gamedb: add missing serials 2022-03-20 23:25:42 +00:00
refractionpcsx2
9721ed0fb3 GS: Use pixel format mask for FBMSK checks 2022-03-20 23:24:42 +00:00
Mrlinkwii
224863fbd5 GameDB: adds 'VUSyncHack' to Panzer Elite Action - Fields of Glory 2022-03-20 17:40:43 +00:00
Mrlinkwii
1d459d8fab Gamedb: Remove VU rounding form 'Hitman - Contracts' 2022-03-20 15:30:00 +00:00
arcum42@gmail.com
33e0ac729e Core: Remove memcmp_mmx. 2022-03-20 12:54:58 +00:00
Connor McLaughlin
268ecf42c3 Build: Remove 32bit configs from vsprops 2022-03-20 12:53:42 +00:00
refractionpcsx2
708281f00b GS: Properly detect 16bit format on Texture Shuffle + Convert 2022-03-20 06:49:16 +00:00
RedDevilus
56b68a50e9 GameDB: Even more GS HW Fixes
Affects:
Ape Escape 3
Armored Core Last Raven
Berserk
Forever Kingdom
Front Mission 4 / 5
Need For Speed Underground 1 / 2
Kings Field 4 - The Ancient City
Test Drive Unlimited
Jak 2 / 3 / X
2022-03-20 05:57:18 +00:00
RedDevilus
e4048dc2dd CI: Update labeler to expand WX 2022-03-20 04:50:29 +00:00
TheLastRar
5949c772d1 Qt: Fix bugs relating to per-game settings 2022-03-20 04:13:45 +00:00
RafaelTrepaUnCarballo
63998b64cc fix comment format 2022-03-20 04:10:11 +00:00
RafaelTrepaUnCarballo
fbb3ea142a Add files via upload
Added gshack (wild arms hack) for all releases of Wild Arms Alter Code F
2022-03-20 04:10:11 +00:00
Tyler Wilding
435f760b5d GameDB: remove duplicate YAML keys 2022-03-20 04:03:03 +00:00
Tyler Wilding
f47129bd72 deps: update rapid-yaml to v0.4.1 2022-03-20 04:03:03 +00:00
Tyler Wilding
aa42acfe22 common: fix method name and clarify some behaviour 2022-03-20 04:03:03 +00:00
Tyler Wilding
ddfe6ac5c1 memcard: update ryml parsing for folder memory cards
also make the file handling safer
2022-03-20 04:03:03 +00:00
Tyler Wilding
624dff1b96 gamedb: move away from deprecated ryml::parse func 2022-03-20 04:03:03 +00:00
Tyler Wilding
8d498b564d deps: update rapid-yaml to latest commit
has a bug fix that we hit in folder memory cards
2022-03-20 04:03:03 +00:00
Christian Kenny
26561261bc Core: Remove unused code 2022-03-20 04:00:27 +00:00
Connor McLaughlin
44728be719 Misc: Fix incorrect printf of std::string_view 2022-03-20 04:00:13 +00:00
Tzerinas
678bb1218b GameDB: Add fixes for Tak Games
SoftwareRendererFMVHack for Tak 1&2, Half-Pixel Offset (Texture) for Guardians of Gross.
2022-03-20 04:00:04 +00:00
RedDevilus
c496e80eac PCSX2-GUI: Rename skipdraw and IDC for Partial Invalidation
Skipdraw and SkipDrawOffset isn't obvious to what it is. SkipDrawStart and SkipDrawEnd makes it obvious it's a range of values.
Also forgot to change the IDC for Disabling Partial Invalidation.
2022-03-20 03:59:38 +00:00
refractionpcsx2
269db188d0 Build: Remove 32bit from CMake. 2022-03-20 00:39:39 +00:00
refractionpcsx2
f5afbfd4f5 GS: Remove 32bit code from SW renderer 2022-03-20 00:39:39 +00:00
refractionpcsx2
ccd86a242c EE/VU JIT: Remove 32bit code 2022-03-20 00:39:39 +00:00
refractionpcsx2
42a5cb7ad2 Build: Remove 32bit targets from VS solution 2022-03-20 00:39:39 +00:00
Tyler Wilding
6977323d88 ci: remove redundant words from job names
its always 64bit now!
2022-03-19 21:19:48 +00:00
Tyler Wilding
7b1d03d45a ci: add link to previous release page in discord announcement 2022-03-19 21:19:48 +00:00
Tyler Wilding
8a4f1ef51a ci: stop building 32-bit
At this point -- not cleaning up the solution files / etc, only our actions.

Until the 32bit code itself is removed, we should still have an easy way to flip these back on.
2022-03-19 21:19:48 +00:00
Mrlinkwii
9b50bb2e81 Gamedb: remove no longer needed comments 2022-03-19 15:56:06 +00:00
Connor McLaughlin
4f27d779a1 GS/DX11: Fix incorrect format check for compressed textures 2022-03-19 03:57:20 +00:00
RedDevilus
73c6353351 Qt: Partial Invalidation
Some missing strings from the renaming.
2022-03-18 23:47:21 +00:00
Immersion95
f571b66a43 GameDB: HW fixes for Mega Man/Rockman X7 + Clamping mode fix (#5694) 2022-03-18 20:53:48 +00:00
BuildTools
901664ba44 GameDB: Rename fastTextureInvalidation
Attempt 2 renames fastTextureInvalidation to disablePartialInvalidation for more consistency with the new GUI name.
2022-03-18 13:52:36 +00:00
Immersion95
02012b5491 GameDB: HW fixes for Rockman X8
SoftwareRendererFMVHack for the NTSC-J & NTSC-K version of Megaman X8
2022-03-18 10:24:58 +00:00
TellowKrinkle
4f57e40c91 GS:SW: Fix lod on x64 2022-03-18 03:59:51 -05:00
RedDevilus
832e536a9e GameDB: Haunting Ground + 50 Cent and Level 5
Ranging from blurriness to font artifacts.
2022-03-18 08:44:33 +00:00
BuildTools
c2316ca5bc GUI: Rename Fast Texture Invalidation
Renames Fast Texture Invalidation to Disable Partial Invalidation.

Update GraphicsSettingsWidget.ui
2022-03-18 02:11:12 +00:00
refractionpcsx2
3535edcfa1 GameDB: Add partial preloading to Stolen 2022-03-17 18:40:11 +00:00
KrossX
a4932ed0f1 GameDB: Add DMABusy fix to Shining Wind 2022-03-17 14:33:07 +00:00
seta-san
515d9040a1 GameDB: Add gsHWFixes for Tales of Symphonia
Co-Authored-By: RedDevilus <martensregis@gmail.com>
2022-03-17 09:16:20 +00:00
Connor McLaughlin
fe3a743814 ImGuiManager: Cap usage percents to 100% 2022-03-17 09:10:12 +00:00
Connor McLaughlin
8e08cd772b PerformanceMetrics: Add GPU time 2022-03-17 09:10:12 +00:00
Connor McLaughlin
206f80c5f4 GS: Compute SW CPU per-thread not per-draw 2022-03-17 09:10:12 +00:00
RedDevilus
c6ce380042 GameDB: More GS HW Fixes
Some extra comments for Monster Lab and SSX Tricky.

New entries:

- Alter Echo
- Beyond Good and Evil
- Dragon Ball Z - Budokai Tenkaichi 2
- Fatal Frame 1 / 3
- Ghost in the Shell - Stand Alone Complex
- Global Defence Force
- Xenosaga 1 / 2 / 3
2022-03-17 08:57:58 +00:00
lightningterror
939d98d660 Qt: Allow skipdraw up to 10k max. 2022-03-17 02:44:14 +01:00
lightningterror
c9a3420f85 GS: Fix Wunused-variable warnings. 2022-03-17 00:50:28 +01:00
refractionpcsx2
9a1a399bac GameDB: Add a bunch of hw fixes and upscaling fixes 2022-03-16 23:40:53 +00:00
RedDevilus
c8aac1dca9 GameDB: Ace Combat + Soul Calibur + Metal Gear Solid Series
Missing mipmap from the Europese Ace Combat Zero/4/5, Align Sprite for them and Round Sprite. Align Sprite for SoulCalibur series.
Metal Gear 2 substance gets round sprite for font and Metal Gear 3 Subsistence gets Special (Texture) for blurriness.
2022-03-16 22:38:39 +00:00
lightningterror
14c17916f5 GS-hw: Optimize blending equations based on alpha value.
It will allow us to use free sw blending without texture barriers.

Will be especially helpful for opengl/vulkan.
2022-03-16 15:17:00 +01:00
RedDevilus
7b0576d7cc GameDB: Dog Island and COD Final Fronts (#5671) 2022-03-16 07:24:05 +00:00
Blackbird88
ecb118d5af GameDB: Add gsHWFixes for GTA LCS/VCS (#5662)
Co authored by @Blackbird88
2022-03-15 20:22:19 +00:00
RedDevilus
efbf187b35 GameDB: Upscaling GS Batch 2
Adds second batch of upscaling fixes.
2022-03-15 20:21:15 +00:00
Tzerinas
2ea3feba90 GameDB: Add Upscaling Fixes to Onimusha 3
Adds Half-Pixel Offset: Special (Texture) and Round Sprite (Full) to Onimusha 3: Demon Siege
2022-03-15 20:19:06 +00:00
Tzerinas
f265257efb GameDB: Add Software FMV to Grandia 2 and Xtreme
Adds the SoftwareRendererFMV hack to Grandia 2 and Xtreme. Also adjusted titles.
2022-03-15 20:18:43 +00:00
lightningterror
13cc0caed7 GS Debugger: Fix hw hacks behavior not properly disabling. 2022-03-15 15:46:24 +01:00
refractionpcsx2
2068240e1a GS: Adjust Auto Flush to catch edge cases
Affected Beyond Good and Evil water
2022-03-15 10:15:21 +00:00
Tzerinas
7f5901f022 GameDB: GS HW renderer fixes for Tales of the Abyss
Description of Changes
Add Half-Pixel Offset: Special (Texture) to Tales of the Abyss.
2022-03-15 09:38:24 +00:00
Tokman5
a022de6225 GameDB: Add gsHWFixes for Shutokou Battle 01. (#5659)
Co-authored-by: Tokman5 <isozin_1210@yahoo.co.jp>
2022-03-15 08:12:52 +00:00
RedDevilus
f5570b7f40 GameDB: Rogue Galaxy
Adds half roundsprite to make upscaled HW more like software mode such as minimap while fighting.
2022-03-15 08:11:17 +00:00
RedDevilus
7e1c48694a GameDB: Upscaling GS Batch 1
Fixes the lint and adds a bunch of upscaling fixes.
2022-03-15 00:54:38 +00:00
lightningterror
a546f61ea8 Qt: Fix Round sprite hack not applying. 2022-03-14 23:43:25 +01:00
PCSX2 Bot
7ecac10eee PAD: Update to latest controller database. 2022-03-14 22:20:49 +01:00
Mrlinkwii
ee2e10e86b GameDB: correct and update serials 2022-03-14 19:15:50 +00:00
RedDevilus
7752f44a90 GameDB: Documentation
Add values for GameDB, GUI options and the default to easier make GameDB changes
2022-03-14 19:14:40 +00:00
refractionpcsx2
e01fc3eb47 GS: Loosen requirement for half bottom 2022-03-14 19:14:26 +00:00
SaltyBet
910c8190e0 GameDB: Added missing variants of NAMCO games 2022-03-14 15:47:02 +00:00
SaltyBet
a62ccc0d69 GameDB: Auto GS HW renderer fixes for some NAMCO games
- Tekken 4
- Tekken 5
- Tekken Tag Tournament
2022-03-14 15:47:02 +00:00
Dreadmoth
4f47041108 GameDB: Metal Arms - Glitch in the System (PAL)
Force disable mVU Flag Hack to prevent SPS
2022-03-14 15:33:39 +00:00
Connor McLaughlin
16cfde0538 GS: Use single array for dump packets 2022-03-14 15:26:19 +00:00
Connor McLaughlin
6a15d46461 Qt: Improve boot filename autodetection 2022-03-14 15:26:19 +00:00
Connor McLaughlin
4331ae1925 VMManager: Support playing back GS dumps 2022-03-14 15:26:19 +00:00
Connor McLaughlin
4d85d916b7 GS: Move dump file loading to core 2022-03-14 15:26:19 +00:00
Connor McLaughlin
4f4b14dd4d GameList: Add GetEntryByCRC() 2022-03-14 15:26:19 +00:00
Connor McLaughlin
444e650711 StringUtil: Add StartsWithNoCase/EndsWithNoCase 2022-03-14 15:26:19 +00:00
refractionpcsx2
c65ccaa153 GS-Config: Clear missing manual GS fixes 2022-03-14 11:08:39 +00:00
Connor McLaughlin
6b54db9b75 GS/VertexTrace: Fix min/max when last provoking vertex unsupported
This was causing incorrect min/max alpha values due to the index swap,
which caused the sides of text boxes in KH to disappear (because the
alpha test optimized to always failing).

Closes #5639.
2022-03-14 08:47:32 +00:00
Mrlinkwii
3bab470db6 Docs : Add GS hardware fixes and MTVUSpeedHack 2022-03-13 18:33:37 +00:00
refractionpcsx2
adf01cb56a GS-Build: Fix Dump Verticles for linux 2022-03-13 05:01:51 +00:00
refractionpcsx2
bbe3af7f61 GS-Debug: Dump verticles with draws
- Move context dumping to the top so we see it as the game set, not after we've messed with it.
Thanks to tadanokojin for these changes
2022-03-13 03:46:16 +00:00
refractionpcsx2
3e7d32c807 GameDB: Give slightly clearer message for GS Fix override 2022-03-13 03:18:44 +00:00
refractionpcsx2
76e25cb738 GameDB: Add mipmapping/trilinear for Hot Shots/Everybody's Golf games 2022-03-13 02:34:29 +00:00
refractionpcsx2
8f0dc34847 GS: Improvements to MTBA address calculation 2022-03-13 01:55:08 +00:00
RedDevilus
fc6ec2cc02 GameDB: Transformers Armada: Prelude to Energon
Adds missing VIFFIFO + force disabling MTVU for not getting black screen
2022-03-13 01:53:48 +00:00
refractionpcsx2
34b7b07ff8 GameDB: Added a whole host of auto GS HW renderer fixes 2022-03-13 01:53:15 +00:00
Connor McLaughlin
6c33b73cdd GS: Make TC offset changable without recreating 2022-03-12 20:48:51 +00:00
Connor McLaughlin
1e86ba4120 GS: Append game serial/name to dump filename 2022-03-12 20:48:51 +00:00
Connor McLaughlin
89c79aa6c3 GSDump: Add embedded screenshot 2022-03-12 20:48:51 +00:00
Connor McLaughlin
4ed748fa30 GSDump: Add extensible header and serial
Serial is used to apply hw fixes.
2022-03-12 20:48:51 +00:00
Connor McLaughlin
5569e94f41 GS: Make setting change detection more fine grained
Avoids the slower full restart when it's not needed.
2022-03-12 20:48:51 +00:00
Connor McLaughlin
892eec79ed Workflows: Fix lint-gamedb for gsHWFixes 2022-03-12 20:48:51 +00:00
Connor McLaughlin
b248b4a8af GameDB: Add HW fixes for GTASA/GOW/GOW2 2022-03-12 20:48:51 +00:00
Connor McLaughlin
39fe467b64 GS: Purge CRCs of unused titles 2022-03-12 20:48:51 +00:00
Connor McLaughlin
1c301ec889 GS: Move point list palette to gamedb 2022-03-12 20:48:51 +00:00
Connor McLaughlin
de5690ddcb GS: Move texture-inside-rt flag to gamedb 2022-03-12 20:48:51 +00:00
Connor McLaughlin
f376c8f7ae GS: Remove second source of truth for HWMipmap 2022-03-12 20:48:51 +00:00
Connor McLaughlin
2e199d47a8 GS: Move automatic mipmapping override to gamedb 2022-03-12 20:48:51 +00:00
Connor McLaughlin
96269db93e GameDatabase: Add ability to override GS fixes 2022-03-12 20:48:51 +00:00
Connor McLaughlin
d35db63d73 GS: Reference GSConfig instead of using theApp
Removes multiple sources of truth, enables overrides.
2022-03-12 20:48:51 +00:00
refractionpcsx2
9d003486c2 GS-hw: Attempt to improve half screen detection 2022-03-12 12:28:18 +00:00
refractionpcsx2
0c4b85980c GS: Support local to local transfers that overwrite themselves 2022-03-12 12:27:43 +00:00
Connor McLaughlin
5961db6b9b GS/Vulkan: Elide render pass restarts on depth buffer toggle 2022-03-12 12:22:51 +00:00
Connor McLaughlin
d0039c2920 Gif_Unit: Vectorize analyzeTag() 2022-03-12 12:10:32 +00:00
TellowKrinkle
5bdec2f532 x86emitter: Fix x64 8-bit rmw codegen 2022-03-11 12:59:57 +00:00
refractionpcsx2
fd758bb307 GameDB: Added MTVU disable to InstantVU off games 2022-03-11 10:25:15 +00:00
refractionpcsx2
a11d09ebdf Git: Update GameDB Validation script 2022-03-11 10:25:15 +00:00
refractionpcsx2
d294064da6 GameDB: Disable MTVU on T-Bit games 2022-03-11 10:25:15 +00:00
refractionpcsx2
fd4a5acc40 MTVU: Try to make T-Bit more reliable.
Add MTVUSpeedHack option to GameDB so it can be forcefully disabled
2022-03-11 10:25:15 +00:00
refractionpcsx2
05a7a61257 GS/Autoflush: Handle different page widths/arrangements 2022-03-11 10:24:26 +00:00
refractionpcsx2
90a4a11d49 GS: Add Auto Flush for Z buffer draws
Adjust Burnout CRC hack
2022-03-11 10:24:26 +00:00
lightningterror
d9f914eb7c GS-hw: Move the Ad to As equation swap when alpha is masked to Basic level and higher on gl/vk.
Safer this way, otherwise need to take in to account when accumulation, non recursive, and blend mix is enabled, or manually enable them on Minimum level.

Everything that we need is enabled on Basic level.

Change is done for clamp 1 only.
2022-03-09 23:24:44 +01:00
TheLastRar
134242973b Config: Set a sane default value for HddSizeSectors 2022-03-09 10:07:54 +00:00
TheLastRar
92900d8dc8 Config: Fix manual subnet mask save/load 2022-03-09 10:07:54 +00:00
Ziemas
7a970e1d00 Filesystem: Properly convert stat return to bool.
Two of the overloads where wrong.
2022-03-09 09:33:51 +00:00
Connor McLaughlin
e8e0f355fc GS/WX: Fix default adapter causing unnecessary GS restarts 2022-03-09 09:14:36 +00:00
Mrlinkwii
3202fd88d2 Gamedb: add VU clamping to 'DT Racer' and update MGS2 hack 2022-03-09 00:10:00 +00:00
RedDevilus
1c66c904ab GameDB: Katamari games
Katamari games have become sensitive again to this hack. It's forcefully disabled for this PR to fix performance and other breaking issues.
2022-03-09 00:08:21 +00:00
lightningterror
784e090081 GS-hw: Improve how we handle blending when output is Cd.
Disable hw blending on Cd output,
Disable rgb write on Cd output.
2022-03-08 23:46:27 +01:00
Connor McLaughlin
2d08d3dc94 GL/Context: Drop GL string logging back to devbuilds 2022-03-08 10:39:50 +01:00
Connor McLaughlin
237b9754c6 Qt: Log graphics driver info on startup 2022-03-08 10:39:50 +01:00
Connor McLaughlin
74bbccdf59 Wx: Log graphics driver info on startup 2022-03-08 10:39:50 +01:00
Connor McLaughlin
062d625901 Vulkan/Context: Allow non-debug device when validation layers unavailable 2022-03-08 10:39:50 +01:00
Connor McLaughlin
3f30c2bda2 VulkanHostDisplay: Improve Vulkan version reporting 2022-03-08 10:39:50 +01:00
PCSX2 Bot
0702692746 PAD: Update to latest controller database. 2022-03-07 17:11:41 +01:00
dependabot[bot]
11a218b1aa Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-07 14:15:25 +01:00
Connor McLaughlin
f4acff1321 Qt: Fix incorrect dropdown value in game properties 2022-03-07 14:14:49 +01:00
Connor McLaughlin
a8ee746c39 Qt: Fix live changing game settings not applying 2022-03-07 14:14:49 +01:00
Connor McLaughlin
ddd5fc7bf3 VMManager: Fix brief unpause before shutdown 2022-03-07 14:14:04 +01:00
lightningterror
22dfe05287 GS-hw: Optimize blending when ALPHA.A is equal to ALPHA.B.
Set ALPHA A B to 0 (Cs), and ALPHA.C to 0 (As).
2022-03-07 14:13:19 +01:00
refractionpcsx2
fa78e1295a GS: Handle Auto Flush across pages + scissor, add TEXFLUSH
Fixes Jak 3 shadows, partially fixes Beyond Good and Evil water, improves Auto Flush performance hugely (x3 in Jak 2 @ 3x Native)
2022-03-06 03:07:37 +00:00
refractionpcsx2
4a634ca154 GS: Fix compilation of GS SW Int Rasterizer 2022-03-05 16:55:54 +00:00
refractionpcsx2
bd1f5d0888 GS: Adjust Tekken 5 CRC hack for fire effect, fixes sun bleed.
Fixes #2766
2022-03-05 15:55:36 +00:00
Connor McLaughlin
2f028c5f40 Qt: Implement CTRL+C and confirm shutdown 2022-03-04 17:41:28 +00:00
Connor McLaughlin
56c8843406 Qt: Add log options to debug menu 2022-03-04 17:41:28 +00:00
Connor McLaughlin
37c4c596b5 Qt: Fix a few warnings on Linux 2022-03-04 17:41:28 +00:00
Connor McLaughlin
7b0bde4f1f Qt: Move section/key in setting binder
It's passed in by value, so elide the copy.
2022-03-04 17:41:28 +00:00
Connor McLaughlin
5c5c7d64a8 Qt: Remove version check macros
Not needed anymore since we require Qt6 on all platforms.
2022-03-04 17:41:28 +00:00
lightningterror
565189d08c GS-hw: Fix Wunused-variable warning in GSRendererHW. 2022-03-03 22:27:40 +01:00
lightningterror
682580e318 GS-hw: Fix Wsign-compare warnings in GSRendererNew. 2022-03-03 22:27:40 +01:00
lightningterror
74e3d6470a GS-hw: Fix Wunused-but-set-variable warnings in GSTextureCache. 2022-03-03 22:27:40 +01:00
refractionpcsx2
b4e6a715fc EE/JIT: Flush const on LDL/LDR instructions 2022-03-03 16:18:16 +00:00
Mrlinkwii
85f0d44997 Gamedb: add patch for Cars 2022-03-03 11:29:52 +00:00
TellowKrinkle
294855700d GS:OGL: Don't memset C++ objects 2022-03-02 12:10:12 +00:00
TellowKrinkle
099ddfedc7 GS:Mac: Properly init vulkan on main thread 2022-03-02 12:02:15 +00:00
TellowKrinkle
d9e2bcef6d GS:Mac: Nicer message send 2022-03-02 12:02:15 +00:00
TellowKrinkle
7a628f1a12 WX: Make texture dump location configurable 2022-03-02 11:58:44 +00:00
Mrlinkwii
75bc680934 GameDB: add 'VUSyncHack' to 'Tiger Woods PGA Tour 2002' and update documentation 2022-03-02 11:36:11 +00:00
Connor McLaughlin
0c98b5ff76 GS/TextureCache: Don't let hash cache memusage go negative 2022-03-01 17:34:59 +00:00
arcum42
11918e5846 Disable warnings on several third party libraries. (#5519) 2022-02-28 21:14:52 -08:00
refractionpcsx2
2c33bf8c6f GUI/Qt: Update VU Sync option in Qt interface 2022-02-28 19:29:53 +00:00
refractionpcsx2
e833a67bb7 VU: Rework VUKickstart in to VUSync, swap behaviour 2022-02-28 19:29:53 +00:00
refractionpcsx2
6dc5087cbd VU: Run sync ahead on small blocks 2022-02-28 19:29:53 +00:00
PCSX2 Bot
eabda670ac PAD: Update to latest controller database. 2022-02-28 17:52:52 +01:00
Connor McLaughlin
845e7930d7 microVU: Move VU0 micro flag instance setup to program start
They're only used in micro mode, so no point updating them in a cop2
chain.
2022-02-28 15:07:15 +00:00
Connor McLaughlin
d20bfa240d EE: Add COP2 flag hack 2022-02-28 15:07:15 +00:00
Connor McLaughlin
ba27a46ac6 GS/TextureCache: Don't count replacements in hash cache budget
Large replacement textures were causing the hash cache to disable
itself. There's plenty of other massive VRAM sinks in PCSX2 that we need
to consider before we can say we're managing VRAM well anyway.
2022-02-28 09:38:12 +00:00
Connor McLaughlin
866e5bd929 GS/TextureReplacements: Disable generated mipmaps on compressed textures
They should be provided in the file.
2022-02-28 09:38:12 +00:00
TellowKrinkle
1beb5517a7 Pad: Fix connection of macOS GameController framework controllers 2022-02-28 09:51:11 +01:00
TheLastRar
a12ad1f627 Config: Clang format Pcsx2Config 2022-02-28 09:44:14 +01:00
TheLastRar
c18be9dde7 Dependencies: Remove LibXml 2022-02-28 09:44:14 +01:00
TheLastRar
4eba400170 DEV9: Don't enforce MTA requirement
Also CoUninitialize() needs to be called for all successful calls to CoInitialize/Ex(), not just those that return S_OK
2022-02-28 09:44:14 +01:00
TheLastRar
dc376ab161 DEV9: Clang format net.cpp 2022-02-28 09:44:14 +01:00
TheLastRar
5ff49a78eb Config: Add DEV9 options to global struct
Additionally switch to using std::string in various locations in DEV9
2022-02-28 09:44:14 +01:00
TheLastRar
6df50992c4 DEV9: Remove old settings/log directory functions 2022-02-28 09:44:14 +01:00
TheLastRar
5d2bcfaa38 DEV9: Fix off by one error on LBA range check 2022-02-28 09:44:14 +01:00
TheLastRar
990d7ad0f7 DEV9: Correct DEV9 include in Tap 2022-02-28 09:44:14 +01:00
TheLastRar
510283cd4d DEV9: Rename DEV9's Config.h to DEV9Config.h 2022-02-28 09:44:14 +01:00
TheLastRar
dcc183179a DEV9: Use fs namespace instead of ghc 2022-02-28 09:44:14 +01:00
TheLastRar
30bc9b04c5 DEV9: Use UTF8 strings on windows for AdapterEntry 2022-02-28 09:44:14 +01:00
dependabot[bot]
8aaeb1c7ce Bump actions/setup-node from 2 to 3
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 2 to 3.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 09:25:18 +01:00
AKuHAK
1984c68516 PCSX2: Add ability to combine CLI options --elf or --irx with --gameargs
Exception: if full path to host: contains spaces, then arguments will be ignored. To avoid this you can use relative paths when possible.
2022-02-28 09:20:01 +01:00
refractionpcsx2
c81c89d6d9 GUI/Qt: Fix startup project for debugger 2022-02-28 07:34:52 +00:00
refractionpcsx2
9ce2405f3f GUI/Qt: Fix loading ELF files from menu 2022-02-28 07:05:15 +00:00
refractionpcsx2
21fba45a3c GameDB: Added patch for PowerDrome US 2022-02-27 15:22:42 +00:00
refractionpcsx2
a0bbdcefb3 GS: Ignore 24bit on DATE and Handle Reversed Color and Z
Clamp Framebuffer width to 1-32
2022-02-27 15:22:42 +00:00
lightningterror
753da789a0 GS-hw: Adjust DATE selection.
Remove fbmask check from DATE,
Enable DATE_BARRIER with one barrier when alpha isn't written and there is no alpha test.
2022-02-26 17:48:27 +01:00
lightningterror
cd5ce6e162 GH-workflows: Remove os mentions for auto pad db update.
Not needed anymore.
2022-02-24 14:52:41 +01:00
Connor McLaughlin
5a25cc171d GS: Add texture dumping and replacement system 2022-02-24 10:18:49 +00:00
Connor McLaughlin
32dc68f103 GS: Support BC1/BC2/BC3/BC7 compressed texture formats 2022-02-24 10:18:49 +00:00
Connor McLaughlin
69a500d657 GS: Add Swap() to GSTexture 2022-02-24 10:18:49 +00:00
Connor McLaughlin
ed9f34de5f Common/FileSystem: Add EnsureDirectoryExists() 2022-02-24 10:18:49 +00:00
iMineLink
d6f1291c0b GS: skip no output draws. 2022-02-24 10:12:59 +00:00
iMineLink
01079f5162 GS: upscale regardless of PCRTC enabling. 2022-02-24 10:12:59 +00:00
RedDevilus
9b0dc287c1 PCSX2-GUI: Rename Interlacing to Deinterlacing
So to sketch what is an annoying issue is that this for years has been wrongly presented to users.
None Interlacing = Interlacing but if used with a no-interlacing patch it will look like progressive but PCSX2 or really the internal PS2 side only detects interlacing mode. Which blows my mind that the user wouldn't be wrong to assume that None Interlacing = Interlacing.
Weave = Interlacing method (saw-tooth)
Bob = Likely the sharpest but can do vertical bouncing.
Blending = A bit blurry but the most consistent and has no bouncing.

I didn't change the code just the visual presentation to the users.

Example in gif format: https://upload.wikimedia.org/wikipedia/de/1/1e/Interlaced_Animation.gif
2022-02-24 00:38:01 +00:00
lightningterror
bb92566781 GS-hw: Don't trigger no overlap check for DATE_BARRIER on d3d11.
d3d11 doesn't support DATE_BARRIER, it's better to let the Date one cases handle it as it will be more accurate.
2022-02-23 20:48:00 +01:00
Connor McLaughlin
17b1c664a8 GS: Add option to disable status indicators
Fast forward/pause icons.
2022-02-23 15:45:47 +00:00
Connor McLaughlin
2eaba084c7 GS/TextureCache: Fix target not getting invalidated in some cases
This would happen when there was a source from local memory with the
same pointer as the target.

Fixes sky getting messed up in the Jak 3 menu when the hash cache is
enabled.
2022-02-23 15:45:19 +00:00
arcum42@gmail.com
ff75ab73cc Qt: Fix qt compilation on linux. 2022-02-22 19:23:51 +00:00
RedDevilus
3c54593456 Qt: Add themes
Ranging from ColorBlind themes to flashy to pastel. Based on the Fusion factory. 3 Light and 1 Dark extra themes (2 light and 2 dark themes on master) with enough variability and choice.
It's just a placeholder for when other factories are implemented and perhaps even viable for future community-based static or dynamic ones.
2022-02-22 16:13:09 +00:00
RedDevilus
39dfb2e606 Qt: Resize default headersize BIOS
Qt: Resize default headersize BIOS

The first column was too small and visually makes it harder to see what BIOS you have.
2022-02-22 16:13:09 +00:00
PCSX2 Bot
4e7ade8612 pad-windows/unix: Update to latest controller database. 2022-02-21 21:22:07 +01:00
seta-san
664013e7ad Qt: Fix type on graphics panel (#5553) 2022-02-21 19:10:14 +00:00
Connor McLaughlin
9d51c64d92 GS: Support mipmaps in hash cache 2022-02-21 16:50:57 +01:00
Connor McLaughlin
ee82c7834d GS: Auto-disable hash cache when it's too large 2022-02-21 16:50:57 +01:00
Connor McLaughlin
b389c6e103 GS: Only allocate valid page array when needed 2022-02-21 16:50:57 +01:00
Connor McLaughlin
b3a2d3c1e4 GS: Track hash cache memory usage 2022-02-21 16:50:57 +01:00
Connor McLaughlin
5d33af13ca GS: Add full (hash cache) texture preloading option 2022-02-21 16:50:57 +01:00
Connor McLaughlin
6b2a851dec GS/Vulkan: Fix uploading large (>64MB) textures 2022-02-21 16:50:57 +01:00
Connor McLaughlin
3b3072801c GS/OpenGL: Fix uploading large (>16MB) textures 2022-02-21 16:50:57 +01:00
Connor McLaughlin
9ed33d4337 GS/HW: Fix mipmap level not updating on live config change 2022-02-21 16:50:57 +01:00
Mrlinkwii
728b3eb5db Core: remove not needed logging 2022-02-21 10:46:29 +01:00
Connor McLaughlin
f73398ea84 GS/Vulkan: Fix warning when compiling RGBA8->RGB5A1 shader
Also gets rid of the program info log length check, since that's been
long removed in glslang.
2022-02-20 14:03:33 +00:00
lightningterror
2b646c2153 GS-hw: Disable dithering if blend mix is enabled.
It breaks stuff since we do a mix of hw/sw.
2022-02-20 02:31:03 +01:00
lightningterror
f83692c0df GS-ogl: Remove GL_ARB_get_texture_sub_image.
Not used.
Also remove some not used commented out defines.
2022-02-19 18:08:05 +01:00
lightningterror
b8236b1b1c GS-hw: Partially revert #5540
Allow to wrap on colclip.
For real tho, ideal solution is sw blend, doing any clamp/wrap is wrong on blend mix.
2022-02-19 00:38:13 +01:00
lightningterror
1a3d77b2c0 GS-hw: Fix d3d11 depth sample shader.
Also adjust some comments to match updated shader names.
2022-02-18 19:21:01 +01:00
lightningterror
816ee9e545 GS-hw: Prefer sw blend for clr_blend1_2 on ultra blending.
Opengl/Vulkan: Prefer sw blend over hw for clr_blend1_2 on ultra blending, doing hw is less accurate and will introduce rounding issues.

Direct3D11: Prefer sw blend over hw for clr_blend1_2 only when primitives don't overlap.
2022-02-18 19:06:49 +01:00
lightningterror
06766ddb98 GS-hw: Don't wrap on 16bit destination format for blend mix.
Helps Dog's Life blending, we shouldn't wrap as we do more blend math afterward which will be wrong if we wrapped before.
2022-02-18 19:00:54 +01:00
lightningterror
7151848406 GS-hw: Rename alpha_clamp to blend_mix. 2022-02-18 19:00:54 +01:00
Ziemas
45b5347092 SPU2: Don't cap pitch setting on register write.
While 0x3FFF is indeed the highest playable pitch I think that the
register is 16 bits wide and that the cap is enforced by the pitch
counter algorithm.

This fixes the air time ticking sound in Jak X.
2022-02-18 12:32:04 +00:00
Ty Lamontagne
5b6986c230 Core: Export recompiler offsets 2022-02-16 17:51:40 +00:00
Connor McLaughlin
de195d9b20 Qt: Add game summary and audio/memcard placeholders 2022-02-16 17:34:53 +01:00
Connor McLaughlin
b47552c08f Qt: Add per-game settings UI 2022-02-16 17:34:53 +01:00
Mrlinkwii
48dabd3ca2 QT: Add icon for Hk BIOS. 2022-02-15 20:54:27 +01:00
lockhart
91ac0368e3 GameDB: Add Ratchet & Clank demo and Spider-Man 3 Fixes + several new entries as well as the removal of the virtual-on Ontario program fixes.
This commit fixes several entries from the GameIndex, removes the clamping fixes from Virtual On ontario program which wasn't needed, adds several rounding fixes to Ratchet 1 titles to fix the Hydrodisplacer Behaviour and adds several entries as well.

For Ratchet 1, After having done tests on actual hardware,

the results shows that even real hardware will behave badly on the retail version....

However, the demo does indeed have an issue, so let's fix that.

Also, this fixes an oversight made for Spiderman 3 in the past, now the proper fix is applied.
2022-02-15 12:58:27 +00:00
Connor McLaughlin
dfe4bc199f GS/HW: Use integers for depth conversion shaders
Fixes z-fighting in reflections in DBZ BT3, maybe others?
2022-02-15 10:41:37 +01:00
PCSX2 Bot
1630404621 pad-windows/unix: Update to latest controller database. 2022-02-14 21:06:50 +01:00
Mrlinkwii
02c66491e8 Gamedb: add 'VUKickstartHack' to 'Jet Li - Rise to Honor' 2022-02-14 18:29:57 +00:00
refractionpcsx2
d4b1d9abe5 GS-hw: Increase 32->16bit conversion accuracy
Improves Dogs life (no longer goes completely black right away, but has decal problems)
Vastly improves texture quality in Spider-Man 3 when using Framebuffer Conversion to fix the textures
2022-02-14 14:50:21 +00:00
Ty Lamontagne
6ab77be8fc COP2: Move COP2 timing messages to release builds. 2022-02-14 01:52:44 +00:00
RedDevilus
6cf518e7df actions: Add windows category for SDL
Upcoming Qt will feature native support for multiple controllers + remapping for all relevant OSes. This makes the step a bit easier.

Rationale:
Windows has cleaner code (becoming just like OnePad) and no more DS4/DualSense/Switch Pro/... wrapper such as steam or DS4Windows (ryochan7) though will still work if you want it.
Linux will have OnePad legacy remapping.
Mac will have feature parity to some extent.
2022-02-14 01:50:57 +00:00
Mrlinkwii
8f1745bf44 Gamedb: add EETimingHack to 'Obscure 2' and patch to 'Snoopy Vs Red Baron' 2022-02-14 01:50:39 +00:00
lightningterror
38f1ae34ad GS-hw: Prefer sw blend when one barrier is already enabled and prims don't overlap.
More accurate, speed will be the same.
2022-02-13 14:11:51 +01:00
refractionpcsx2
ad415945a6 GS-hw: Apply clamp/wrap when FBMask enabled 2022-02-11 19:33:38 +01:00
Frank Hartung
a44fe29b8d CMake: add back HarfBuzz to fix build (#5510)
- pango relies on HarfBuzz & pulls in its headers
2022-02-10 17:56:19 -08:00
RedDevilus
c1d96fc876 CI: Label Qt into GUI/Qt
The label has recently been changed into GUI/Qt for more clarity that it touches upon a GUI toolkit just like WX. Also added the 3rdparty for the binary.
2022-02-10 21:04:28 +01:00
Florin9doi
65db50df5d Qt: Add icon for Cn BIOS. 2022-02-10 21:02:55 +01:00
Blackbird88
f009d6f9e7 GameDB: Add missing Gran Turismo demos 2022-02-09 10:56:25 +00:00
Mrlinkwii
ed8bd18dfb GameDB: disable mVUFlagHack for Maken Shao 2022-02-09 10:21:52 +00:00
PCSX2 Bot
af648334d1 pad-linux: Update to latest controller database. 2022-02-07 17:11:12 +01:00
987123879113
8f4ce02d05 GameDB: Update Bemani game titles and add new entries for Japanese DDR X and SuperNOVA2 2022-02-07 02:52:57 +00:00
C.W. Betts
9b7e87c043 Mark static functions in headers as static inline:
This quiets unused function warnings (-Wunused-function) which is on by default on Xcode.
2022-02-07 02:32:56 +00:00
C.W. Betts
cae8e6ae79 Change a couple of includes from angle brackets to quotes:
This makes Xcode happy, as it interprets angled brackets as system headers or headers inside of frameworks.
2022-02-07 02:32:56 +00:00
iMineLink
1a2272ad43 GS: partially revert "c1e5e45431863bc206686c49b8fb4fa2775be9a2".
overwrite the target pitch when an overlapping write is detected
with the write pitch itself.
fixes the broken splashscreen in This is Football 2002.
2022-02-07 02:17:19 +00:00
iMineLink
fede91a98b GS: update target pitch on frame lookup.
fix Jurassic Park - Operation Genesis loading disk logo.
2022-02-07 01:42:54 +00:00
Connor McLaughlin
7e8c6fcc9d Wx: Fix live vsync changes not applying 2022-02-07 01:42:40 +00:00
Connor McLaughlin
0ca3167595 Vulkan: Implement adaptive vsync (FIFO-relaxed) 2022-02-07 01:42:40 +00:00
Connor McLaughlin
c74cc9bc12 HostDisplay: Fix vsync getting lost on window changes 2022-02-07 01:42:40 +00:00
iMineLink
061fff6f17 cmake: copy resources in build folder. 2022-02-06 16:01:39 +00:00
lightningterror
2aaabdd2ea GS-hw: Cleanup crc stuff.
Merge the following crc lists, gets rid of duplication since code is shared:
BurnoutDominator, BurnoutRevenge, BurnoutTakedown ->BurnoutGames

GetaWay, GetaWayBlackMonday ->GetaWayGames

GT3, GT4, GTConcept, TouristTrophy ->PolyphonyDigitalGames

Yakuza, Yakuza2 -> YakuzaGames

ValkyrieProfile2, StarOcean3, RadiataStories -> TriAceGames

Rename defines Dx_and_OGL to CRC_Partial, Dx_only to CRC_Full, Aggressive to CRC_Aggressive
2022-02-06 16:21:30 +01:00
lightningterror
2f06ed2af8 GS-hw-tc: Remove JackieChanAdv crc hack.
Game seems to work fine currently.
2022-02-06 15:45:49 +01:00
Florin9doi
52252de3a6 GameDB: Add missing NTSC-J games (#5491)
Co-authored-by: Florin9doi <Florin9doi@users.noreply.github.com>
2022-02-06 13:58:09 +00:00
Florin9doi
ff725980c3 Game DB: Add missing PAL games to GameIndex Correct AFL Football serial
PR #5490
Co-authored-by: Florin9doi <Florin9doi@users.noreply.github.com>
2022-02-06 13:57:12 +00:00
lightningterror
d6d420b1f7 QT: Add missing Texture Inside RT option. 2022-02-06 13:17:28 +01:00
TellowKrinkle
977e8a4c54 GS:HW: Fix scale of color → 8 bit converted textures 2022-02-06 05:04:56 +00:00
iMineLink
b8188a7954 GS: remove bw equality check in tex in rt.
fixes jak mipmapping.
2022-02-06 04:53:09 +00:00
refractionpcsx2
8ac57db117 GS: Don't process CLUT load condition on invalid PSM 2022-02-05 15:13:48 +00:00
RedDevilus
5cc66e4d36 Qt: Resize Windows + Change Framerate Presets + Lower OSD time
The main window will now correctly display the full Toolbar. Interface Settings will not go out of bounds. The OSD message for cheats and patches has been changed and the overall timing of the static (not dynamic) OSD messages are now 5 seconds instead of 10 seconds which is pretty long. Tested on 1920 x 1080 + 2560 x 1080 on 125% and 150% DPI scaling.
2022-02-05 14:09:34 +00:00
Connor McLaughlin
d9d2022096 InputManager: Missing motor bindings are not errors 2022-02-05 14:09:11 +00:00
Connor McLaughlin
1ea38b1981 Qt: Fix current tab resetting when switching renderers 2022-02-05 14:09:11 +00:00
Connor McLaughlin
d63a36216f Qt: Fix default values for software mipmap/AA1 2022-02-05 14:09:11 +00:00
s-andro
9ac935ed94 CRC: Gran Turismo 4 [PlayStation 2 Racing Pack] 2022-02-05 09:01:41 +01:00
s-andro
02bb2b7477 GameDB: Gran Turismo 4 [PlayStation 2 Racing Pack] 2022-02-05 09:01:41 +01:00
TheLastRar
9cfce59547 DEV9: Check for null ifa_addr in PCAPGetIfAdapter 2022-02-05 00:51:50 +00:00
lightningterror
99f0d5c685 GS-hw: Properly enable/disable each channel based on fbmask, adjust fbmask detection when to do blending for 16bit/24bit.
Optimization.
2022-02-04 23:28:24 +01:00
lightningterror
f84cb1c9cc GS-hw: Optimize fbmask on 16bit format.
Set fbmask to 0 if unused bits are the ones enabling it, they aren't used anyway.
2022-02-04 19:27:08 +01:00
lightningterror
ae4733c59d GS-hw: Purge LordOfTheRingsThirdAge crc hack.
Shadows are now rendered correctly on all renderers.
2022-02-04 18:53:28 +01:00
Connor McLaughlin
2629c92a00 GS/Vulkan: Fix HDR resolve to cleared target
Fixes shadows in LOTR: Third Age.
2022-02-04 18:32:53 +01:00
Ty Lamontagne
4ccb922d1a Debugger: Make memory search size depend on platform 2022-02-04 16:52:27 +00:00
Ty Lamontagne
8113e9a168 Debugger: Fix memory search drawing and sizing
Now it should be sized a little better
A little funky on dpis greater than 100%
(sorry wx is not easy to work with)
2022-02-04 16:52:27 +00:00
Ty Lamontagne
a632f3c5cb Core: Lighten IOP breakpoint load
standardizeBreakpintAddress calls on the IOP just return the address unmodified. Considering this is called at least once every load / store instruction when there is an IOP OR EE memcheck enabled, it's pretty hot.
2022-02-04 16:52:27 +00:00
Tokman5
e64e2f2c4e Debugger: add register name pattern 2022-02-04 15:34:46 +00:00
RedDevilus
f6d49eb5b9 Qt: More sizing + improve hotkeys code
There were other sizing issues with region and CRC that are now have better width. Taking the liberty to organise the hotkeys as it is laid on the GUI-level + adding missing hotkeys. There is still much work to be done.
2022-02-04 02:26:01 +00:00
lightningterror
ee4f498a13 GS-hw: Re add alpha c check for clr_blend1_2.
Removed it by accident, nobody saw nothing.
2022-02-03 23:37:01 +01:00
lightningterror
3bdb1f8550 GS-hw: No PABE for hw clr_blend1_2 optimization.
Will require sw blend.
2022-02-03 23:34:59 +01:00
RedDevilus
971f060029 Qt: Fix type table sizing + spaces
Type table in the main window was not wide enough. Also adding spaces in some strings and removing some redundant spaces in others.
2022-02-03 15:22:08 +00:00
Connor McLaughlin
2684fd6b62 GS: Add depth copy convert shader 2022-02-03 15:20:35 +00:00
lightningterror
6085c5bf01 GS-hw: Enable Ad to As blend swap when it detects barrier(fbmask) on d3d11..
Allow to run it on basic level, fb is already read so there is no extra cost and is more accurate.
2022-02-03 10:16:16 +01:00
lightningterror
550f0d9936 GS-hw: Cleanup some stuff from clr3 blend. 2022-02-03 01:11:08 +01:00
lightningterror
9c00554118 GS-hw: Allow to run clr_blend1 and clr_blend2 over sw blending.
As or F case only, no Ad.

Allow condition to run when there are no texture barriers (gl/vk),
or copying the fb (d3d11).
Run when colclamp is 1 as hw blend will clamp value to 0-1.
Check for texture barriers, don't run if any is enabled.
2022-02-03 01:11:08 +01:00
lightningterror
ec7e8989a6 GS-hw: Move the sw blend for BLEND_C_CLR3 to High level and upper.
Reading the frame buffer is slow, let's allow hw blend to run, can partially handle it.
2022-02-03 01:11:08 +01:00
lightningterror
3ca4272230 GS-hw: Implement hw, hw/sw, sw blending on Ad when alpha write is masked.
Idea is to replace Ad with As when alpha write is masked,
then expand/let blend mix, accumulation blend non recursive blend or hw clr blend to
do the blending with Ad swapped as As.

We are doing this to try to bring some originally higher blending modes to lower levels
where we can do the draws with less texture barriers instead (gl/vk),
as for d3d11 this allows to run blending on the draws since previously the cases weren't handled properly,
it will be slower on d3d11 since we will be reading the frame buffer but it's better than nothing.

D3D11: It is enabled on Medium blending or higher, if draw is fbmask then it will enable
it on basic blending too.

OpenGL/Vulkan:
It is enabled based on the previous blending modes:
accumulation blend -> either minimum or basic level, depending on colclamp.
non recursive blend -> either minimum or basic level, depending on colclamp.
blend mix -> basic and higher level.
hw clr blend -> minimum and higher level.

All:
Prefer full sw blend when primitives don't overlap, sw fbmask or full barrier is used, it is more accurate.
2022-02-03 01:11:08 +01:00
lightningterror
ae14afd5f7 GS-hw: Combine BLEND_C_CLR2_AF and BLEND_C_CLR3_AS in one shader bit.
Free a shader bit.
2022-02-03 01:11:08 +01:00
RedDevilus
3d40b23496 GameDB: Beatmania entries
Adding missing entries so that Ziemas can be happy.
2022-02-02 23:52:59 +00:00
TellowKrinkle
88c0c41a70 CMake: Use relative paths for package mode
Allows relocating install prefix without recompiling
2022-02-02 17:09:48 -06:00
TellowKrinkle
176917caf4 CMake: Require gettext for translations on macOS
MacOS uses modified po files, which means it can't use the precompiled mos
2022-02-02 17:09:48 -06:00
TellowKrinkle
e2e8fdafb1 CMake: Make translation macro a function
Macros can set variables in the parent scope but we don't need that here
2022-02-02 17:09:48 -06:00
TellowKrinkle
aad8b09d81 CMake: Remove all argument option from translations macro
There's no reason you wouldn't want it
2022-02-02 17:09:48 -06:00
TellowKrinkle
90e3d9e460 CMake: Move translation file processing to main pcsx2 directory
Reduces workarounds for cmake dumbness
2022-02-02 17:09:48 -06:00
TellowKrinkle
baf9e4a9af CMake: Properly use MACOSX_PACKAGE_LOCATION for translations on macOS
Translations are now properly tracked by CMake and will be regenerated if you delete them
2022-02-02 17:09:48 -06:00
TellowKrinkle
1b453d0436 GUI: Move translations to resources directory
Also fixes finding translations in package mode builds
2022-02-02 17:09:48 -06:00
TellowKrinkle
49b1a496b1 GS: Fix OSD scaling on hidpi displays 2022-02-02 16:29:19 -06:00
TellowKrinkle
50afd83bc6 GUI: Fix scale factor on macOS 2022-02-02 16:29:19 -06:00
TellowKrinkle
85934dcbe2 GS: Track DPI change events 2022-02-02 16:29:19 -06:00
Connor McLaughlin
095ff20e2b GS/DX11: Fix binding depth as tex + fbmask 2022-02-02 20:05:54 +01:00
Connor McLaughlin
3a91ed2571 Vulkan/Context: Remove unused memory type functions
VulkanMemoryAllocator takes care of this.
2022-02-02 17:39:53 +00:00
Connor McLaughlin
20c534fc46 Vulkan/Context: Fix incorrect app name/version 2022-02-02 17:39:53 +00:00
Connor McLaughlin
0c0bd8be98 GS/Vulkan: Use fence counter for upload cmdbuffer selection
Readbacks don't increment the frame number, but submit the cmdbuffer.

Fixes incorrectly rendered status bar in Devil May Cry.
2022-02-02 17:39:53 +00:00
RedDevilus
ead6f9f4cd CI: Automatically label Qt
This will label PRs that touches on Qt-related files.
2022-02-02 17:33:41 +00:00
Connor McLaughlin
2328d9e107 ImGui/Vulkan: Don't leak font image/memory on reupload 2022-02-02 11:50:34 +00:00
Connor McLaughlin
87aa8333a8 ImGuiManager: Fix double init of font texture 2022-02-02 11:50:34 +00:00
Connor McLaughlin
f1de985304 GS: Reset/restore API state when changing OSD scale
Closes https://github.com/PCSX2/pcsx2/issues/5451
2022-02-02 11:50:34 +00:00
TellowKrinkle
5d3cbf8d1a GS: ReadAndExpandBlock4H_32 improvements 2022-02-02 09:34:30 +00:00
TellowKrinkle
c24ed8d47b GS: Use smartblend on WriteColumn32 2022-02-02 09:34:30 +00:00
TellowKrinkle
cbf4a83b3f GS: Minor Zen optimizations 2022-02-02 09:34:30 +00:00
TellowKrinkle
a6887715c7 GS: Faster palette lookup for AVX2 platforms with slow VPGATHERDD 2022-02-02 09:34:30 +00:00
TellowKrinkle
e2169bc1da GS: Consolidate repeated BlockH code 2022-02-02 09:34:30 +00:00
TellowKrinkle
89f3b46a9e GS: AVX2 ReadBlock4P 2022-02-02 09:34:30 +00:00
TellowKrinkle
d64e838b6d GS: AVX2 WriteBlock functions 2022-02-02 09:34:30 +00:00
TellowKrinkle
263e495561 GS: Make xmm → ymm zext/sext functions take GSVector4i
Removes the need for casts everywhere
Also renames them to remove the `c`, the fact that they take a GSVector4i should make it clear
2022-02-02 09:34:30 +00:00
TellowKrinkle
127433628d GS: AVX2 ReadAndExpandBlock4(HH|HL)_32 2022-02-02 09:34:30 +00:00
TellowKrinkle
29e8da0944 GS: pshufb-based ReadAndExpandBlock4(HH|HL)_32 2022-02-02 09:34:30 +00:00
TellowKrinkle
a2992c86e6 GS: AVX2 ReadAndExpandBlock8[H]_32 2022-02-02 09:34:30 +00:00
TellowKrinkle
1cc796b1a7 GS: AVX2 ReadAndExpandBlock4_32 2022-02-02 09:34:30 +00:00
TellowKrinkle
679cc7af38 GS: pshufb-based ReadAndExpandBlock4_32 2022-02-02 09:34:30 +00:00
TellowKrinkle
c4b3239e33 GS: Improved ReadColumn4 2022-02-02 09:34:30 +00:00
TellowKrinkle
4139da82b9 GS: Remove special casing alignment on AVX+
Extra code, unneeded as AVX+ has fast unaligned loads
2022-02-02 09:34:30 +00:00
TellowKrinkle
bdc7dc2cd8 GS: ReadColumn8 AVX2 path 2022-02-02 09:34:30 +00:00
TellowKrinkle
244a4da28a GS: ReadBlock16 performance improvements 2022-02-02 09:34:30 +00:00
TellowKrinkle
e7e0dbd29a GS: Drop SSE3 ReadColumn16
It was no faster than the SSE2 one and requires loading an extra shuffle vector
2022-02-02 09:34:30 +00:00
TellowKrinkle
1f6b2e629b GS: Use broadcast loads on AVX2
Broadcast loads are free on AVX2 processors, might as well use them
2022-02-02 09:34:30 +00:00
Connor McLaughlin
793ba944d6 GS/Vulkan: Prefer coherent for upload and cached for download buffers 2022-02-02 00:30:56 +00:00
Connor McLaughlin
438480517b GS/Vulkan: Prevent GS state overriding present viewport/scissor 2022-02-02 00:30:56 +00:00
Connor McLaughlin
e3b4d13c47 HostDisplay: Remove levels/layers from HostDisplayTexture
Wasn't implemented for updates, and we're not going to use it any time
soon.
2022-02-02 00:30:56 +00:00
Connor McLaughlin
3caebb31ae Qt: Add save state loading/loaded/saved events 2022-02-02 00:23:49 +00:00
Connor McLaughlin
8b9eee4961 Qt: Add QtUtils::StringViewToQString() 2022-02-02 00:23:49 +00:00
Mrlinkwii
280f5adb22 Readme: add note about Vulkan drivers 2022-02-02 00:22:06 +00:00
iMineLink
16cfcad0bf GS: fully support target rescaling in TC, take 2. 2022-02-02 00:21:48 +00:00
Tyler Wilding
51431d22ba memcard: fix YAML emitting bugs 2022-02-02 00:21:07 +00:00
Tyler Wilding
ef3bc9202b memcard: don't fail on bad yaml, but this isn't the underlying issue... 2022-02-02 00:21:07 +00:00
refractionpcsx2
cdae169922 GS: Add Point Pallete SW Render for 120-en no Haru
Fixes #5211
2022-02-02 00:14:41 +00:00
RedDevilus
c45a7a2ef6 GameDB: Urban Reign
EE cyclerate +1 will fix the issue but a compromise on default is to enable EE-Timing-hack. Ee cyclerate +1 can be combined with or without EETiming.
2022-02-01 23:02:58 +00:00
Mrlinkwii
ddf16b71c2 GameDB: add eerounding to 'Neopets - The Darkest Faerie' 2022-02-01 22:59:00 +00:00
Connor McLaughlin
d29f843525 GS/HW: Don't disable depth testing for channel shuffle
Mercenaries needs it. But we can skip it when z testing is off.
2022-02-01 12:40:40 +01:00
Connor McLaughlin
8ce8ac4404 GS/Vulkan: Handle case where DS == Texture
Technically we can handle this as another feedback loop, but in my
opinion it's not worth it, since there's only two games I've seen which
do this - Ico and Mercenaries.
2022-02-01 12:40:40 +01:00
TellowKrinkle
b55e59e665 GS: Fix region repeat bounds checking for zero crossings 2022-02-01 02:58:09 -06:00
TellowKrinkle
598a3b5d7b GS:HW: Avoid REGION_REPEAT when possible
We don't support upscaling for it right now
2022-02-01 01:24:35 +00:00
TellowKrinkle
8c16e3231e GS:HW: Add a few clamp mode optimizations 2022-02-01 01:24:35 +00:00
TellowKrinkle
eca5eced63 GS:HW: Handle coordinate wrapping on target-sized sources 2022-02-01 01:24:35 +00:00
TellowKrinkle
e87d8da1fb GS:TC: Track whether or not textures use their clamp modes 2022-02-01 01:24:35 +00:00
TellowKrinkle
f5fba1cbd1 GS: Add BitScanReverse polyfill 2022-02-01 01:24:35 +00:00
TellowKrinkle
06b4c3faab GS: Fix minmax of REGION_REPEAT 2022-02-01 01:24:35 +00:00
TellowKrinkle
6d0b9b3747 GS:HW: Don't scale rt when converting to texture
Scale texture coordinates instead
2022-02-01 01:24:35 +00:00
TellowKrinkle
92f2cef4d1 GS:HW: Default rt size to 0 2022-02-01 01:24:35 +00:00
lightningterror
5fdfbd470b Revert GS-hw: Exclude triangles from no prim overlap fb read on dx11.
Issue fixed in #5422
2022-01-31 19:13:45 +01:00
Connor McLaughlin
75b5f70196 CI: Build Qt binaries 2022-01-31 16:46:23 +00:00
PCSX2 Bot
b68be77865 pad-linux: Update to latest controller database. 2022-01-31 17:11:37 +01:00
refractionpcsx2
105aab0345 QT-SDL: Fix SDL Input compilation 2022-01-31 14:29:03 +00:00
Connor McLaughlin
9c3270a2de InputManager/SDL: Drop version checks
They're not needed since we're always using the latest SDL.
2022-01-31 14:21:38 +00:00
Connor McLaughlin
5c33e9666a Qt: Enable SDL2 input source for Qt 2022-01-31 14:21:38 +00:00
Connor McLaughlin
aeb9403b67 3rdparty: Add SDL2 2022-01-31 14:21:38 +00:00
Connor McLaughlin
50735567c9 Qt: Fix crash when disconnecting controller which isn't last in list 2022-01-31 13:56:28 +00:00
Connor McLaughlin
0e83c992c3 InputManager/XInput: Fix inverted/incorrect axes 2022-01-31 13:56:28 +00:00
Connor McLaughlin
dac7106df8 Qt: Make input binding dialog match widget 2022-01-31 13:56:28 +00:00
refractionpcsx2
11b467e455 QT: Remove 32bit build targets (which don't exist)
Use a separate environment varible for our QT folder to save conflicts
2022-01-31 12:40:25 +00:00
TellowKrinkle
7cc2437ef7 Core: Enable GS Debugger with DevMode flag 2022-01-31 12:54:57 +01:00
TellowKrinkle
8d4ffc0713 GSDumpGUI: Add framelimiter 2022-01-31 12:54:57 +01:00
TellowKrinkle
5ec5fb17ca GSDumpGUI: .gs.xz support 2022-01-31 12:54:57 +01:00
TellowKrinkle
234d643dd3 GSDumpGUI: Parse all the packets in a transfer 2022-01-31 12:54:57 +01:00
TellowKrinkle
7288a1fcb2 GSDumpGUI: Don't expand everything by default 2022-01-31 12:54:57 +01:00
TellowKrinkle
b8b23cd359 GSDumpGUI: Show packet data in main entry 2022-01-31 12:54:57 +01:00
TellowKrinkle
c05eaa9382 GSDumpGUI: Make window resizable 2022-01-31 12:54:57 +01:00
TellowKrinkle
6d14bda7b0 GSDumpGUI: Format floats with %g 2022-01-31 12:54:57 +01:00
TellowKrinkle
e2fd951ff3 GSDumpGUI: Cleanup 2022-01-31 12:54:57 +01:00
Mrlinkwii
bf598d5fe9 GameDB: add 'EETimingHack' to 'Indiana Jones and the Emperor's Tomb' 2022-01-31 10:42:55 +00:00
iMineLink
32f420dbe5 GS: fix overlap check in hw tc.
Textures can span a single block indeed.
Fixes Jak 3 desert rendering.
2022-01-31 09:39:54 +00:00
TellowKrinkle
6d0e35ddcb CMake: Prevent people from doing in-tree builds
Can create weird messes with include directories
2022-01-30 20:07:34 -06:00
dependabot[bot]
f9f4557841 Bump node-fetch in /.github/workflows/scripts/releases/announce-release
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.5 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.5...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 19:06:25 +01:00
dependabot[bot]
d441cdba71 Bump node-fetch
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.5 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.5...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 19:06:11 +01:00
dependabot[bot]
9f24fb618f Bump node-fetch
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.5 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.5...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 19:05:39 +01:00
refractionpcsx2
9d43641765 Build-QT: Fix error in VS Project 2022-01-30 15:27:20 +00:00
Connor McLaughlin
93f9ae8a31 Qt: Add work in progress interface 2022-01-30 14:29:18 +00:00
Connor McLaughlin
c2ca0852d9 Build: Add pcsx2core variant for Qt 2022-01-30 14:29:18 +00:00
Connor McLaughlin
8bedfc257f Common: Don't define __i386__ on Windows
It breaks Qt.
2022-01-30 14:29:18 +00:00
Connor McLaughlin
b709810079 PAD/Host: Add default settings 2022-01-30 14:29:18 +00:00
Connor McLaughlin
d4721d50f7 VMManager: Permit setting reload without active VM 2022-01-30 14:29:18 +00:00
Connor McLaughlin
14b54e554e InputManager: Add device/motor enumeration, connect callbacks 2022-01-30 14:29:18 +00:00
Connor McLaughlin
7555091d56 InputManager: Add UpdateSettings() to sources 2022-01-30 14:29:18 +00:00
Connor McLaughlin
dbc176fe25 GS/DX11: Don't bind 16 SRVs every draw
That's just silly.
2022-01-30 14:17:12 +00:00
Connor McLaughlin
0a45385d48 GS/DX11: Only copy draw area when sampling RT/depth
Should save a decent chunk of VRAM bandwidth outside of channel
shuffles.
2022-01-30 14:17:12 +00:00
Connor McLaughlin
f33ee27f56 GS: Get rid of extra binding for channel shuffle
Having this binding was redundant, as there's no "normal" texture
sampled when we're doing a channel shuffle, and it caused issues in
Vulkan when the render target or depth buffer the source.

Also fixes the Urban Chaos HLE shader.

Fixes validation errors in GT4, NFS: Carbon, Urban Chaos, probably
others too.
2022-01-30 14:17:12 +00:00
tellowkrinkle
5444b575f3 GS: Prefer one-frame-old textures 2022-01-28 18:17:31 -06:00
iMineLink
6361cd8268 GS: add TextureInsideRt flag to selected games. 2022-01-29 00:03:10 +00:00
iMineLink
0055fcf489 GS: add tex in rt hw hack in GUI. 2022-01-29 00:03:10 +00:00
iMineLink
b7899d0c8c GS-hw, TC: search tex in wrapping RT.
Improves Beyond Good & Evil shadow.
2022-01-29 00:03:10 +00:00
iMineLink
c1e5e45431 GS-hw, TC: search tex in rt in dirty targets.
Also move any target BW update from InvalidateVideoMem to LookupTarget.
Fixes Indiana Jones map rendering in cutscenes.
2022-01-29 00:03:10 +00:00
iMineLink
44d0966892 GS: improve GSDirtyRect psm conv., add bw field. 2022-01-29 00:03:10 +00:00
iMineLink
be0932f538 GS-hw, TC: add some const modifiers. 2022-01-29 00:03:10 +00:00
iMineLink
6cfa740f90 GS-hw: reset RT size on reset. 2022-01-29 00:03:10 +00:00
iMineLink
1bd8ec786b GS-hw, TC: log InvalidateLocalMem calls. 2022-01-29 00:03:10 +00:00
iMineLink
9a276d7289 GS-hw, TC: invalidate targets from LRU to MRU. 2022-01-29 00:03:10 +00:00
iMineLink
ac63d41daf GS-hw: lookup source before target.
- this avoids the currently used target to
become the MRU in its cache and correctly keeps
the target used by the previous draw as the MRU
during the lookup source call.
2022-01-29 00:03:10 +00:00
iMineLink
bd0a8a642b GS-hw, TC: log LookupSource calls. 2022-01-29 00:03:10 +00:00
iMineLink
3e9b38044f GS-hw, TC: improve tex in rt. 2022-01-29 00:03:10 +00:00
lightningterror
d8ca9b5f39 GS-hw: Replace depth +bilinear assert with log, also do some cost, fix some logs.
Assert was annoying when debugging, being hit too often.
2022-01-27 19:57:29 +01:00
lightningterror
e9f8e5eebd GS-hw: Properly disable skipdraw when userhacks are disabled. 2022-01-27 18:55:46 +01:00
lightningterror
bf2613ee49 GS-hw: Adjust how clr_blend is handled based on blend level on d3d11.
Blend level High and lower: Prefer clr_blend.
Blend level Full, prefer clr_blend when ALPHA.C != 1, otherwise sw when primitives don't overlap.
Blend level Ultra, remains the same but we can probably prefer clr_blend when alpha again is As or F, let's play it safe and leave it as it is for now.
2022-01-27 12:09:35 +01:00
lightningterror
3b691da8d1 GS-hw: Implement alternative hw blending for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad.
Alpha destination value is wrong so let us try to compensate.

Multiply Cs by (255/128) in shader.
Will work best if Cs is 0.5 or less,  if it's higher than 0.5 then the closer to 1 the less accurate it gets.

Ofc it is best to use sw blending but it will help if sw blending is not present/selected for specific draw, will help d3d11 quite more.
2022-01-27 12:09:35 +01:00
Ty Lamontagne
4955a4ef98 GS-wx: Add extra check for shader options when VK is selected 2022-01-27 08:46:48 +01:00
lightningterror
ca55d86187 GS-hw: Exclude triangles from no prim overlap fb read on dx11.
Fixes mgs3 regression on ultra blending.
2022-01-25 21:34:35 +01:00
refractionpcsx2
5974856924 GS: Adjust auto interlace mode with scanmask(frame) 2022-01-25 00:18:01 +00:00
Mrlinkwii
bdb7c65ab0 Gamedb: remove EETimingHack from 'Paris-Dakar 2' 2022-01-24 21:19:03 +00:00
Florin9doi
45ba8690a9 USB: CaptureEye/OV511p webcam emulation 2022-01-24 21:06:03 +00:00
refractionpcsx2
7054190832 Revert "GS: fully support target rescaling in TC."
This reverts commit 2a2564cf45.
2022-01-24 21:02:10 +00:00
PCSX2 Bot
dbd997b551 pad-linux: Update to latest controller database. 2022-01-24 17:45:11 +01:00
refractionpcsx2
369bda13f8 GS: Only autoflush on draws of same format
Move overlap check to State
2022-01-24 12:00:37 +00:00
lightningterror
c9216e5625 GS-hw: Remove useless shader line from CLR As/Af case. 2022-01-24 11:42:54 +01:00
lightningterror
93af9656d0 GS-hw: Fix clr 1 case shader.
Forgot to rename.
2022-01-24 11:11:38 +01:00
refractionpcsx2
bcade5bb9d mVU: Clean up branch chain handling 2022-01-23 20:31:08 +00:00
refractionpcsx2
59ab303c5c mVU: Rework multiple branch chaining 2022-01-23 20:31:08 +00:00
lightningterror
4ab9d1a493 GS-hw: Implement alternative hw blending for Cd*As, Cd*F.
Do hw blend for Cd*As, Cd*F, expand the clear color blend method as it is almost the same.

Most helpful for dx11 ofc, for gl/vulkan will help with rendering on lower
levels of blending without needing a barrier.
2022-01-23 20:59:35 +01:00
refractionpcsx2
f1576eeb32 GameDB: Patch for Midnight Club 2 T-Bit 2022-01-23 18:35:30 +00:00
iMineLink
1f851887d9 GS: fix Majokko A-La-Mode 2 palette rendering. 2022-01-23 17:56:46 +00:00
iMineLink
2a2564cf45 GS: fully support target rescaling in TC.
Also avoid redundant clears when the target
is going to be completely drawn when rescaling.
2022-01-23 17:56:46 +00:00
Connor McLaughlin
b5a78763f8 GameList: Add game list and scanner functions 2022-01-23 17:15:48 +00:00
Connor McLaughlin
728e1ffdd0 VMManager: Introduce new manager functions
VMManager takes the place of all the core thread stuff for Qt.
2022-01-23 17:15:48 +00:00
Connor McLaughlin
14c9cfb310 InputManager: Add InputManager implementation 2022-01-23 17:15:48 +00:00
Connor McLaughlin
b511a54445 MemoryCardFile: Add routine to enumerate cards 2022-01-23 17:15:48 +00:00
Connor McLaughlin
f446e5ad3d SaveState: Save screenshot in state archive 2022-01-23 17:15:48 +00:00
Connor McLaughlin
c263c12448 HostDisplay: Add GetDriverInfo() 2022-01-23 17:15:48 +00:00
Connor McLaughlin
ed9b6f0d3f Vulkan/Context: Get driver properties 2022-01-23 17:15:48 +00:00
Connor McLaughlin
d3152bee9c GS: Add heuristic-based internal FPS 2022-01-23 17:15:48 +00:00
Connor McLaughlin
a504b429bd GS: Use global upscale multiplier 2022-01-23 17:15:48 +00:00
refractionpcsx2
7b6db5ad7a IPU DMA: If no underflow occurs on QWC = 0, end DMA.
Explanation in changes
2022-01-23 15:52:02 +00:00
Connor McLaughlin
398f675412 GS/Vulkan: Add image format check to features 2022-01-23 15:51:37 +00:00
Connor McLaughlin
d18bf338b6 Host: Fix ReportFormattedErrorAsync() 2022-01-23 15:51:37 +00:00
Connor McLaughlin
3091d28615 GS: Release host display if GS init fails
That way we don't try to create it when it already exists next attempt.
2022-01-23 15:51:37 +00:00
lightningterror
ab2365b475 GS-hw: Disable BLEND CD when full barrier is already enabled. 2022-01-22 23:59:02 +01:00
refractionpcsx2
7d356a2d20 GS: Force Blend TFF when scanmsk is used on the frame 2022-01-22 22:03:14 +00:00
refractionpcsx2
e5a4f27e79 VU: Adjust path for conditional evil blocks
Add patch for Pac-man World Rally
2022-01-22 21:43:45 +00:00
TellowKrinkle
9cbcda0f7b GS: Fix alpha blend mode clamping 2022-01-22 19:40:20 +01:00
Mrlinkwii
93b2cd6002 GameDB: add fixes for Simple Series vol.7 and other games 2022-01-22 17:06:18 +00:00
Mrlinkwii
411ed1e0c7 GameDB: add 'SkipMPEGHack' to "David Beckham Soccer" 2022-01-22 15:12:17 +00:00
TheLastRar
e5c4fe003b Build: Use git tag for file version on windows, attempt 2 2022-01-21 23:41:07 +00:00
TellowKrinkle
d6293ab081 Revert "Build: Use git tag for file version on windows"
This reverts commit 7f2a9f6806.
2022-01-20 23:17:43 -06:00
TheLastRar
38a5431ceb Build: Update file copyright to 2022
Also update the copyright year of SysForwardDefs.h
2022-01-20 22:52:09 +00:00
TheLastRar
7f2a9f6806 Build: Use git tag for file version on windows 2022-01-20 22:52:09 +00:00
lightningterror
6ab69e5c1c GS-hw: dbg: Fix blend debug logs. 2022-01-20 21:36:16 +01:00
lightningterror
cd902a12b3 GS-hw: Always enable full sw blend on full barrier, disable accumulation mode (hw/sw blend).
Full barrier requires full sw blend, disable accumulation mode for it (sw fbmask, date_barrier).
2022-01-20 21:02:25 +01:00
lightningterror
72809e8724 GS-hw: Purge TenchuFS, TenchuWoH crc hacks.
d3d11 will require high blending to render properly.
2022-01-20 21:02:25 +01:00
lightningterror
610cad00bf GS-hw: Move fbmask for texture shuffle on Basic level.
Shouldn't be that slow, right?
Also update comments.

Previous High level is now Medium.
2022-01-20 21:02:25 +01:00
lightningterror
4f5bbebcd8 GS-hw: Move blend mix condition to blend switch case.
Cleaner.
2022-01-20 21:02:25 +01:00
lightningterror
33f88039d7 GS-hw: Disable accumulation blend when there is fbmask with no overlap.
Using a mix of hw/sw will be slower, so let's just do full sw blend, we already read the fb.
2022-01-20 21:02:25 +01:00
lightningterror
2cf6b5052d GS-hw: Enable sw blend when prims don't overlap on basic blend with fbmask.
FBMASK already reads the fb so let's allow it to run sw blending since there will be no cost, only if fbmask is already running.
2022-01-20 21:02:25 +01:00
lightningterror
8cb680f34e GS-hw: Remove fbmask check for Genji.
Fb will be read when primitives don't overlap, no need for the mask check now.
2022-01-20 21:02:25 +01:00
lightningterror
f089ef3fbe GS-hw: Allow to sample the framebuffer when primitives don't overlap on d3d11.
All: check when prims don't overlap.

High: When there is no blend mix, accu blend, recursive.

Full: When there is no accu blend, or recursive.
alpha is higher than 1.

Ultra: When there is no accu blend or recursive blend.

Allow to check for overlap on d3d11.
Support sw colclip when prims don't overlap on d3d11.
Support sw pabe when prims don't overlap on d3d11.
2022-01-20 21:02:25 +01:00
lightningterror
e1d2d4b863 GS-hw: Fix interaction with hdr and sw colclip on PABE.
PABE will do full sw blend so we need to disable hdr and enable sw colclip instead.
2022-01-20 08:10:29 +01:00
lightningterror
d0b34dc04c GS-hw: Implement BLEND CD.
Allow hw blend only to do the math, output will be Cd, no need to run costly barriers, will help Vulkan/Opengl.

Disable colclip on BLEND CD as there is no wrapping, will help all renderers, especially on hdr cases.
2022-01-20 08:10:29 +01:00
refractionpcsx2
6a8cffe615 GameDB: Correct Kessen 2 Korean patch 2022-01-19 18:00:40 +00:00
Connor McLaughlin
d08101a5f4 GS/Vulkan: Fix combining DATE/barriers with HDR 2022-01-19 14:40:42 +01:00
Connor McLaughlin
7b6a26367a R5900: Use unsigned ops for add/sub 2022-01-17 20:08:11 +01:00
Connor McLaughlin
08ecf3f582 iR5900: Use unsigned math for constant prop of add/sub
Signed overflow is undefined.
2022-01-17 20:08:11 +01:00
arcum42@gmail.com
8d38e97c0b PAD: Clean up the remains of the old logging code from when this was Onepad. 2022-01-17 20:03:23 +01:00
iMineLink
4c167cf528 GS: remove redundant clears from tc. 2022-01-17 20:02:16 +01:00
iMineLink
7d27b675d0 GS: sparse targets need to be cleared on fetch. 2022-01-17 20:02:16 +01:00
PCSX2 Bot
0ef7e82548 pad-linux: Update to latest controller database. 2022-01-17 19:34:44 +01:00
iMineLink
8db0b52821 GS: optimize xxHash usage in palette hashing. 2022-01-16 11:54:58 +00:00
Connor McLaughlin
364199916f GS: Hash local memory blocks instead of expanded textures 2022-01-16 11:54:28 +00:00
iMineLink
42066ecaba GS: use xxHash to hash palettes. 2022-01-16 03:28:28 +00:00
Connor McLaughlin
986b5a2afe GS/DX11: Use shader cache 2022-01-16 03:17:04 +00:00
Connor McLaughlin
921689aa04 Common: Add D3D11 shader cache/compiler classes 2022-01-16 03:17:04 +00:00
TellowKrinkle
283dcaffe2 GS: Support wrapping off-the-end offsets in GSOffset 2022-01-16 02:00:53 +00:00
Christian Kenny
074ffacf9d GS: Don't apply offset when using SLBG. Fixes The Suffering video monitors 2022-01-15 23:19:55 +00:00
Silent
f1d3177b69 GUI: Make aspect ratio/frame limiter OSD messages keyed
Keyed messages don't pile up so spamming turbo/frame limiter
keys will not generate multiple messages now.
2022-01-15 13:51:54 +01:00
Mrlinkwii
fa50e9dd20 GameDB: add VUKickstartHack to Ghosthunter 2022-01-15 12:12:14 +00:00
icup321
d4de43a062 GameDB: Add eeRoundMode to Teen Titans & Scaler and fixes to other games (#5338) 2022-01-14 22:13:06 +00:00
TellowKrinkle
af795985fc GS:SW: Allow up to 32 threads without breaking 2022-01-14 19:24:51 +01:00
TellowKrinkle
610b19d646 GS:SW: Fix crash when scanline count wasn't divisible by thread count 2022-01-14 19:24:51 +01:00
arcum42
95c8915d78 Fix several gcc warnings. (#5232) 2022-01-13 12:19:23 -08:00
Mrlinkwii
6bdfec743c GameDB: add EETiming to 'Kya: Dark Lineage' 2022-01-13 11:40:24 +00:00
refractionpcsx2
e270c46703 GIF: Separate GIF Reset and GIF DMA Reset
The two shouldn't be reset together anyway, the GIF has no control over the DMA.
2022-01-13 09:53:11 +00:00
Mrlinkwii
0c0a866481 GameDB: add serials from #4535
Co-Authored-By: icup321 <28464642+icup321@users.noreply.github.com>
2022-01-13 09:52:36 +00:00
Mrlinkwii
28ca0aed48 GameDB: add patch to MX Unleashed Migrated
Co-Authored-By: icup321 <28464642+icup321@users.noreply.github.com>
2022-01-13 09:52:36 +00:00
lightningterror
ca9ab100e5 GS-hw: Add crc ids for Ape Escape 2.
Sp, De, It, Fr versions.
2022-01-13 03:32:33 +01:00
icup321
73732bfb29 GS-hw: Add/remove crc ids.
Add CRCs for (almost) all versions of R&C, WOC, & J&D.
Remove all non-retail crc versions.
Re-add Crash 4 version CRC, it's retail actually.

Original PR #4535

Close #4535
2022-01-13 03:17:24 +01:00
refractionpcsx2
048e7f4c1b GUI: Convert Power plan name to UTF-8 2022-01-12 18:45:47 +00:00
lightningterror
d041df8254 GS-hw: Don't enable blending when only alpha is written.
Optimization.
2022-01-12 18:15:50 +01:00
lightningterror
8e8b9a3cff GS-wx: Add tooltip for Preload Textures. 2022-01-11 15:11:43 +01:00
lightningterror
b7b65d7361 GS: Fix tooltips, d3d11 blend, add vulkan in tooltips. 2022-01-11 15:11:43 +01:00
lightningterror
6263c8a0cd GS-wx: Fix d3d11 blend option, broke during Vulkan merge.
Merge the option with GL/VK.
2022-01-11 15:11:43 +01:00
lightningterror
3c92054a6e GS-hw: Move PABE shader bit to the top of sw blending.
Early return when there is no sw blending, no need to run the blend code.
Optimization.
2022-01-11 13:15:56 +01:00
Connor McLaughlin
cf2b6a895f GS/DX11: Get rid of local context reference in GSTexture11 2022-01-11 12:30:11 +01:00
Connor McLaughlin
5bdb34521d GS/HW: Add a field for LOD clamp to sampler
This way SampleLevel for manual LOD doesn't get clamped.
2022-01-11 12:30:11 +01:00
Connor McLaughlin
e1e83c11cc GS: Compute mipmap levels in base device
Also fixes the incorrect number of levels.
2022-01-11 12:30:11 +01:00
Connor McLaughlin
0f5b17de0f GS/DX11: Implement automatic/manual LOD in pixel shader 2022-01-11 12:30:11 +01:00
Connor McLaughlin
568d9a3e30 GS/HW: Correct min lod/minification filter for mipmaps 2022-01-11 12:30:11 +01:00
Connor McLaughlin
1518b793dc GS/DX11: Fix mipmap textures and support trilinear 2022-01-11 12:30:11 +01:00
Connor McLaughlin
6182b46033 GSState: Minimum texture size is 1x1, not 2x2
Fixes out of bounds uploads when full mipmapping is enabled.
2022-01-11 12:30:11 +01:00
refractionpcsx2
4194553450 CDVD: Centralise cdvd.Ready updates + add MECHA_INIT bit 2022-01-10 22:57:09 +00:00
PCSX2 Bot
5f5a696717 pad-linux: Update to latest controller database. 2022-01-10 20:42:54 +01:00
lightningterror
35d516e140 GS: Fix GetRecommendedCRCHackLevel for Vulkan.
Issue #5312
2022-01-10 20:42:06 +01:00
refractionpcsx2
fb5e5cc13f CDVD: Don't delay abort commands on DVDs, at least for now..
Fixes #5301
2022-01-10 11:28:10 +00:00
lightningterror
aa475a8d2e GS-hw: Rename DATE_GL42 DATE_GL45.
DATE_GL42 -> DATE_PRIMID
DATE_GL45 -> DATE_BARRIER
2022-01-09 17:54:13 +01:00
Mrlinkwii
fa5c023d33 GameDB: add game fix to Cocoto Funfair 2022-01-09 16:08:58 +00:00
Connor McLaughlin
22d8e6f79f GS/SW: Use target instead of texture for upload 2022-01-09 16:35:34 +01:00
Connor McLaughlin
126ae4a0f0 GS/Vulkan: Handle uploads to render targets 2022-01-09 16:35:34 +01:00
Connor McLaughlin
68f18245a7 GS/DX11: Implement merge feedback write 2022-01-09 16:35:34 +01:00
Mrlinkwii
e2e25b7134 GameDB: fix some entries 2022-01-09 15:35:08 +00:00
Mrlinkwii
32088647c3 GameDB: add some missing serials 2022-01-09 13:27:06 +00:00
Mrlinkwii
baf8df9597 GameDB: add patches to Koukaku Kidoutai and fixes for other games 2022-01-09 13:25:16 +00:00
lightningterror
34aa266260 vcxproj: Add vulkan shaders and group shaders in renderer category. 2022-01-08 18:22:40 +01:00
refractionpcsx2
8c887c2eee CDVD: Adjust error timing and modify error used for high sector. 2022-01-08 17:07:43 +00:00
lightningterror
a95250cabb GS-hw: Purge WildArms4 and WildArms5 crc hacks.
Issue got resolved before 1.6 release.
2022-01-08 09:27:27 +01:00
lightningterror
96bc6807ae github: auto labeler: Add GS Vulkan label. 2022-01-08 08:35:02 +01:00
Connor McLaughlin
81a139b875 Vulkan: Force textures to be allocated in device local memory 2022-01-08 05:19:45 +00:00
Connor McLaughlin
1a3c20f0f7 Vulkan: Use memory budget extension where available 2022-01-08 05:19:45 +00:00
Connor McLaughlin
4f735d0201 GS: Prevent out of bounds copy for half_right TC target copies 2022-01-08 05:19:45 +00:00
Connor McLaughlin
ec0543335e GS: Fine gained change detection for mips/trifilter/anisotropy 2022-01-08 05:19:45 +00:00
Connor McLaughlin
0872d024f9 GSDevice: Add ClearSamplerCache() method 2022-01-08 05:19:45 +00:00
Connor McLaughlin
0ce21c91ef GS: Allocate mipmaps for Basic+ and only on non-copy textures 2022-01-08 05:19:45 +00:00
Connor McLaughlin
220c7c271b GS/Vulkan: Use VK_EXT_provoking_vertex where supported 2022-01-08 05:19:45 +00:00
Connor McLaughlin
bf389b94d6 GS: Add texture preloading option 2022-01-08 05:19:45 +00:00
Connor McLaughlin
6187f36c33 Vulkan/StreamBuffer: Use VulkanMemoryAllocator 2022-01-08 05:19:45 +00:00
Connor McLaughlin
73df4e4abf GS: Only swap DATE_GL42 with DATE_GL45 when full barriers are used
Saves the expensive draw splitting/barriers when mixed software blending
is used.
2022-01-08 05:19:45 +00:00
Connor McLaughlin
1a8a5a5e8e GS: Add Vulkan renderer 2022-01-08 05:19:45 +00:00
Connor McLaughlin
c4ab6280c6 Frontend: Add VulkanHostDisplay 2022-01-08 05:19:45 +00:00
Connor McLaughlin
a27b6a113a Common: Add Vulkan helper classes 2022-01-08 05:19:45 +00:00
Connor McLaughlin
a60ded5c94 3rdparty: Add Vulkan headers 2022-01-08 05:19:45 +00:00
Connor McLaughlin
5ff67d4b2d 3rdparty: Add glslang 2022-01-08 05:19:45 +00:00
Connor McLaughlin
874e3d976f GSTexture: Implement Save() using common code 2022-01-08 05:19:45 +00:00
Connor McLaughlin
90e1284d83 GS: Move mipmap generation flag to GSTexture 2022-01-08 05:19:45 +00:00
Connor McLaughlin
75518b71ea GS: Fix forced trilinear + full mipmapping
i.e. generate mips when not provided by the game and trilinear filtering
is forced on.
2022-01-08 05:19:45 +00:00
Connor McLaughlin
b355efd73a GS: Separate shader convert for float -> 16/32bit int 2022-01-08 05:19:45 +00:00
Connor McLaughlin
8e920d727f GS: Make GL_NNN macros device independent 2022-01-08 05:19:45 +00:00
Connor McLaughlin
5976be55f4 GS: Use textures instead of render targets for target copies
Saves the clear.
2022-01-08 05:19:45 +00:00
Ty Lamontagne
4c3df1a963 CMake: Pass -fsanitize=address to the linker when USE_ASAN 2022-01-08 00:15:51 +00:00
lightningterror
5b44f495ee GS-hw: Improve DATE selection.
Check for fbmask, accurate path isn't supported so just to DATE.
Check for FBA, all pixels will be 128 or more so use Fast path DATE_one.
2022-01-08 01:15:19 +01:00
refractionpcsx2
3951e15446 VIF: If Force break + Reset requested, Reset gets priority
Fixes #5275
2022-01-07 17:37:10 +00:00
lightningterror
b9da7c6f27 GS-d3d11: Enable amd broken point sampler hack only for amd.
Intel and Nvidia don't need it, get rid of it for them.
2022-01-07 14:06:53 +01:00
refractionpcsx2
c5ae4a6957 CDVD: If you abort, actually abort. 2022-01-06 14:16:31 +00:00
Connor McLaughlin
e40c2f97f0 SysThreadBase: Fix double init of SPU2 etc 2022-01-06 11:46:01 +00:00
Connor McLaughlin
1dbc11bdd5 IPU: Fix software renderer FMV hack without AR change 2022-01-06 09:05:41 +00:00
Connor McLaughlin
299edae7c0 GSDump: Fix renderer override 2022-01-06 07:32:32 +00:00
refractionpcsx2
86309bd837 GS SW: Adjust order SW is destroyed, fixes GS Dump crash 2022-01-06 07:15:01 +00:00
refractionpcsx2
0312e9026d Core: Savestate version bump 2022-01-05 17:13:50 +00:00
refractionpcsx2
a7bafb60e9 CDVD: Improve Break/Abort handling 2022-01-05 17:13:50 +00:00
refractionpcsx2
602769b9d0 CDVD: Add Eject IRQ 2022-01-05 17:13:50 +00:00
refractionpcsx2
e76546f8e4 CDVD: Implement speed register, fix up SpindleCtrl
Also Set the drive as not spinning when ejected
2022-01-05 17:13:50 +00:00
Mrlinkwii
a9ef1680ce GameDB: Removal of some patches and adding some fixes 2022-01-04 14:10:37 +00:00
trostboot
670ddef944 GameDB: Add VU Kickstart Hack to Dark Cloud 2/Dark Chronicle (#5266)
Co-authored-by: trostboot <trostboot@gmx.de>
2022-01-04 13:56:24 +00:00
TellowKrinkle
be6b8dce25 VTLB: Fix ppmap allocation in 64-bit 2022-01-04 13:01:49 +00:00
Connor McLaughlin
75fd20f5df 3rdparty: Add xxhash.h 2022-01-04 13:00:40 +00:00
Connor McLaughlin
f0509a6631 3rdparty: Add Vulkan Memory Allocator 2022-01-04 13:00:33 +00:00
PCSX2 Bot
702319c4ca pad-linux: Update to latest controller database. 2022-01-03 17:14:01 +01:00
iMineLink
d5bd187930 GS: fix loopPagesWithBreak last iteration logic. 2022-01-03 14:21:04 +00:00
RedDevilus
753036f0c8 ProgramLog: Comment out deleted keymapping 2022-01-03 10:18:59 +00:00
iMineLink
cfc763b488 gitignore: update gs debug gl filename. 2022-01-03 09:45:56 +01:00
Connor McLaughlin
7edfeab0b7 3rdparty: Remove freetype 2022-01-03 09:45:31 +01:00
Connor McLaughlin
226b0540c5 GS: Enhance stats 2022-01-02 15:06:39 +00:00
Connor McLaughlin
0c36647506 GS: Rewrite presentation interface and OSD 2022-01-02 15:06:39 +00:00
Connor McLaughlin
1348c8880e Add font resources 2022-01-02 15:06:39 +00:00
Connor McLaughlin
9334285edd 3rdparty: Add imgui 2022-01-02 15:06:39 +00:00
Connor McLaughlin
2330d3a056 GS: Use hardware point/line expansion where supported in GL 2022-01-02 15:06:39 +00:00
Connor McLaughlin
bce54a64ff GS: Use flat/nointerpolation for IIP=0 instead of GS 2022-01-02 15:06:39 +00:00
Connor McLaughlin
bd43400ad8 GS/OpenGL: Set features in Create() instead of constructor 2022-01-02 15:06:39 +00:00
Connor McLaughlin
b16c75324e GSState: Move m_dev to base class 2022-01-02 15:06:39 +00:00
TellowKrinkle
0ddef1169d GS: Fix config default label alignment 2022-01-01 16:58:26 -06:00
TellowKrinkle
4da09bd841 GS: Fix missing space in config dialog 2022-01-01 16:58:26 -06:00
TellowKrinkle
6811cd617b GS: Add system default adapter config option 2022-01-01 16:58:26 -06:00
TellowKrinkle
4e762c75b0 GS: Move adapter list stuff to module in GSUtil
Will be helpful for when renderers other than DX that let you choose adapters are added
2022-01-01 16:58:26 -06:00
TellowKrinkle
f471c30036 GS: Default adapter_index to -1 to indicate default 2022-01-01 16:58:26 -06:00
TellowKrinkle
aaed932a67 PAD:SDL: Remove fallback code for unsupported SDL versions 2022-01-01 16:36:15 -06:00
TellowKrinkle
5f168b1a1e PAD: Store rumble intensity as float
No longer have to worry about what the max value should be
Unlocks > 50% rumble power on new rumble API
2022-01-01 16:36:15 -06:00
TellowKrinkle
5d6f0d7e47 PAD: Call SDL_GameControllerUpdate during pad testing 2022-01-01 16:36:15 -06:00
TellowKrinkle
cf176f1b99 CMake: Remove SDL1.2 option
Not sure if it worked before but it definitely doesn't work now
2022-01-01 16:36:15 -06:00
TellowKrinkle
d97e867c07 GHActions: Cache patchelf 2022-01-01 16:36:15 -06:00
TellowKrinkle
3d0654dd48 PAD:SDL: Let users set their own hints from the config 2022-01-01 16:36:15 -06:00
TellowKrinkle
e688840703 PAD:SDL: Set some hints 2022-01-01 16:36:15 -06:00
TellowKrinkle
8bf272e806 PAD:SDL: Switch to SDL_GameControllerRumble for rumble
Old method was deprecated according to https://github.com/libsdl-org/SDL/issues/4435#issuecomment-896432954
2022-01-01 16:36:15 -06:00
TellowKrinkle
0744bc4004 GHActions: Build latest SDL on linux
Package manager version too old
2022-01-01 16:36:15 -06:00
TellowKrinkle
918f8cbe16 PAD: Format some things 2022-01-01 16:36:15 -06:00
xantares
b6dafff524 Rename ConfigSoundtouch.cpp to ConfigSoundTouch.cpp (#5238)
Fixes build on a case-sensitive filesystem
2021-12-31 16:51:36 -06:00
Mrlinkwii
34686dc167 GameDB: remove patches for 'Neo Contra' and add EE rounding and clamping 2021-12-30 15:15:38 +00:00
Ty Lamontagne
c0c75bf18e Linux: Fix executable case in PCSX2-linux.sh 2021-12-30 14:04:02 +00:00
lightningterror
66cfb403c6 GS-d3d11: MaxAnisotropy value range is 1-16, clamp it. 2021-12-29 15:45:41 +01:00
lightningterror
0375f9c0ae GS-wx: Aniso can run with nearest texture filtering so let's leave it.
Option just disabled the toggle, it would still run on opengl.
2021-12-29 15:45:41 +01:00
lightningterror
11ac758d78 GS-d3d11: Mirror anisotropic filtering behavior on Direct3D11.
Don't run aniso filter on m_convert.pt and m_convert.ln samplers.
Running m_convert.pt broke shadows on color clipping.

Also use the aniso bit from hw renderer.

Aniso will now behave the same as on OpenGL.
2021-12-29 15:45:41 +01:00
Filipe da Silva Santos
9e705b2f53 FileSystem: follow c++17 and unbreak FreeBSD 2021-12-28 19:11:18 -06:00
Filipe da Silva Santos
b475108ff3 ryml: unbreak non-Linux Unices 2021-12-28 19:11:18 -06:00
Florin9doi
ab34dff152 USB: Save Sony prints in BMP format 2021-12-29 00:38:52 +00:00
Florin9doi
6a3f093cfa USB: Sony DPP-MP1 printer emulation 2021-12-29 00:38:52 +00:00
lightningterror
04ef9af703 GS-hw: Optimize PABE.
Add an early condition to check if alpha is lower than 128, if so then no blending so early exit.
2021-12-28 18:39:32 +01:00
TellowKrinkle
b773ab3fb4 GHActions: Fix game controller db updater 2021-12-28 18:04:19 +01:00
refractionpcsx2
32085dc009 CDVD: Add detection for PS2 Linux Disc 2 2021-12-28 12:17:42 +00:00
refractionpcsx2
18fdfc26aa Core: Savestate version bump 2021-12-28 12:17:42 +00:00
refractionpcsx2
f50d2fa48e CDVD: Add more error checking, set seek status 2021-12-28 12:17:42 +00:00
refractionpcsx2
e82859c979 CDVD: Separate SCMD/NCMD Fifo's set to right size 2021-12-28 12:17:42 +00:00
refractionpcsx2
99bb35f109 CDVD: Added missing busy/ready checks 2021-12-28 12:17:42 +00:00
refractionpcsx2
8637f8ee9b CDVD: Extra error handling and fix some flag details 2021-12-28 12:17:42 +00:00
refractionpcsx2
1e11d40828 CDVD: Improve status handling/implement sticky status 2021-12-28 12:17:42 +00:00
refractionpcsx2
5546b102eb CDVD: Replace cdvd.Ready handling 2021-12-28 12:17:42 +00:00
refractionpcsx2
7d9c8c9172 CDVD: Add some error handling, fix up some IRQ stuff 2021-12-28 12:17:42 +00:00
refractionpcsx2
8dd51b7207 CDVD: Zero sector handling and fix CdStop 2021-12-28 12:17:42 +00:00
lightningterror
746c5b603f GS: Try to fix -Wreorder warning. 2021-12-28 10:09:08 +01:00
qurious-pixel
d0de8d22fe MISC: codacy fixes 2021-12-28 08:54:17 +00:00
qurious-pixel
231b8e9481 reference the app-variables.sh apprun-hook file 2021-12-28 08:54:17 +00:00
qurious-pixel
f9f36700bb Update AppRun 2021-12-28 08:54:17 +00:00
qurious-pixel
ba9fced3db Create app-variables.sh 2021-12-28 08:54:17 +00:00
Connor McLaughlin
c192ecf6b7 GSDumpDialog: Cache length instead of querying every packet
Length() internally calls fseek() to end, ftell(), and fseek() back
again (really slow).

Shaves several seconds off loading large gs dumps.
2021-12-28 07:43:28 +00:00
Connor McLaughlin
6ee029e14b PAD: Add platform independent implementation 2021-12-28 05:22:45 +00:00
Connor McLaughlin
935f880fa7 USB: Fix compilation of USBNull on Windows 2021-12-28 05:22:45 +00:00
Connor McLaughlin
47d046c5fe DEV9: Prepare for Qt 2021-12-28 05:22:45 +00:00
Connor McLaughlin
4305e17cbe SPU2: Prepare for Qt (add Host wrapper) 2021-12-28 05:22:45 +00:00
Connor McLaughlin
c5c4cdd0b4 PINE: Disable for Qt (for now) 2021-12-28 05:22:45 +00:00
Connor McLaughlin
252562db90 Misc: #ifdef out last bits of wx-dependent code 2021-12-28 05:22:45 +00:00
Connor McLaughlin
a898682f3e Host: Add layered settings interface for per-game settings 2021-12-28 05:22:45 +00:00
Connor McLaughlin
7829094668 3rdparty: Add simpleini 2021-12-28 05:22:45 +00:00
Connor McLaughlin
042c23a545 Config: Add folder initializers 2021-12-28 05:22:45 +00:00
Connor McLaughlin
af2b9e3a4c Config: Add SPU2 options to global struct 2021-12-28 05:22:45 +00:00
Connor McLaughlin
b3b7c55b9a Host: Add ReportErrorAsync() and formatted variant 2021-12-28 05:22:45 +00:00
Connor McLaughlin
1859ede325 GameDatabase: Use resource abstraction to read yaml 2021-12-28 05:22:45 +00:00
Connor McLaughlin
2c32c374fb GameDatabase: Don't include rapidyaml in header
Name clashes with Qt.
2021-12-28 05:22:45 +00:00
Connor McLaughlin
65d22406a3 SettingsWrapper: Fix enums being stored as ints 2021-12-28 05:22:45 +00:00
Connor McLaughlin
92689a60ae Common/StringUtil: Add whitespace strip methods 2021-12-28 05:22:45 +00:00
Connor McLaughlin
1a598ccf0d Common/StringUtil: Add wide string conversion for non-windows 2021-12-28 05:22:45 +00:00
Italo Di Renzo
e50feb74fd Add "Clear missing files" option to recent ISO list (#4975)
* GUI: Add "Clear missing files" option to Recent ISO list

* GUI: Show list of files to remove in confirmation dialog.
2021-12-27 20:50:04 -08:00
arcum42
af067a8c84 Default to a native build. Remove --clean-plugins. (#5132) 2021-12-27 20:31:27 -08:00
tellowkrinkle
61a196bc3d GS: Move afix check to high blend level 2021-12-27 20:18:47 -06:00
lightningterror
6a431daffc GS-hw: Extend Blend mix to work when alpha is higher than 1.
Clamp the alpha(As/Af) to 1 in the shader, it is already clamped to 1 in hw blend unit.
It should allow to better render the effects, still not fully accurate but it's closer to what we want.
Hopefully it helps D3D11 more.
2021-12-27 20:22:41 +01:00
Mrlinkwii
1aad3e6cc8 GameDB: add VU clamping to "Ultimate Spider-Man" and fixes to other games 2021-12-27 18:02:16 +00:00
refractionpcsx2
c8d42e32ed GameDB: Properly use vuRoundMode child node 2021-12-27 03:47:52 +00:00
refractionpcsx2
514cc6edb8 IPU: Unbreak previous change with IDEC sync
Testing in Production y'all
2021-12-26 23:44:50 +00:00
lightningterror
208d3ffa7b GS-hw: Fix pabe regression from renderers merge.
Only OpenGL should disable accumulation and blend mix to allow reading the framebuffer next.

Also pabe will only be accurate with non recursive blend on d3d11 only so enable it for it only.
2021-12-26 19:12:28 +01:00
refractionpcsx2
25dd92f8c0 IPU: Modify IDEC sync position.
Previously broke the Onimusha patch, sorry
2021-12-26 14:56:52 +00:00
Connor McLaughlin
3f81b7e56d GL/ShaderCache: Time various shader compilation tasks 2021-12-26 13:21:51 +00:00
Connor McLaughlin
99b7333991 GS/OpenGL: Add option to disable shader cache 2021-12-26 13:21:51 +00:00
Connor McLaughlin
a2ae4ba441 GS/OpenGL: Get rid of interface blocks for convert shaders 2021-12-26 13:21:51 +00:00
Connor McLaughlin
4e1b2792c9 GS/OpenGL: Move some uniform buffers to program uniforms 2021-12-26 13:21:51 +00:00
Connor McLaughlin
55695bb5bc GS/OpenGL: Use ShaderCache 2021-12-26 13:21:51 +00:00
Connor McLaughlin
6e064da536 GS/OpenGL: Use programs instead of separate pipelines 2021-12-26 13:21:51 +00:00
Connor McLaughlin
69ff12645c Common: Add GL/ShaderCache 2021-12-26 13:21:51 +00:00
Connor McLaughlin
efb93d22d9 Common: Add GL Program wrapper class 2021-12-26 13:21:51 +00:00
Connor McLaughlin
cdb0068dcc Common: Add MD5Digest 2021-12-26 13:21:51 +00:00
Connor McLaughlin
b0a0d714c4 Common: Add HashCombine.h 2021-12-26 13:21:51 +00:00
refractionpcsx2
7e36ee243c GameDB: Fix Round/Clamp nodes 2021-12-26 11:58:27 +00:00
Sergeanur
21bc56a8ba GS: Simulate scan mask 2021-12-26 11:51:25 +00:00
refractionpcsx2
e920c0fe3e VS: Fix filters 2021-12-26 10:37:43 +00:00
refractionpcsx2
31992fb398 GameDB: Fix loading patches for some games 2021-12-26 08:43:06 +00:00
refractionpcsx2
dc65599fae GameDB: Remove no longer required patches 2021-12-26 04:48:49 +00:00
refractionpcsx2
eb9dc7b70d IPU: BDEC/IDEC wait for IPU0 to drain before proceeding 2021-12-26 04:48:49 +00:00
refractionpcsx2
06bf2502a6 IPU: Tidy up and fix up toIPU DMA, remove some hacks 2021-12-26 04:48:49 +00:00
refractionpcsx2
242655bac9 IPU: Tidy up some DMA and FIFO behaviour 2021-12-26 04:48:49 +00:00
refractionpcsx2
8335b3ee77 IPU: Only fill IPU with required data, no more. 2021-12-26 04:48:49 +00:00
refractionpcsx2
a0c8ad9511 Savestate: Bump version 2021-12-26 04:48:49 +00:00
refractionpcsx2
d775a9364b IPU: Set DMA to only transfer on request (or reset) 2021-12-26 04:48:49 +00:00
Ty Lamontagne
1695124472 Linux / Windows CMake Builds: Change output executable to lowercase
No reason to be uppercase.
2021-12-25 15:11:17 +00:00
Tyler Wilding
70145eb150 macos: add undef to fix macOS builds 2021-12-25 15:11:01 +00:00
Tyler Wilding
dacd7d94d9 memcard: fix saving and loading handling on new yaml lib 2021-12-25 15:11:01 +00:00
Tyler Wilding
85bd8555c0 common: add some file-path helpers to Path ns 2021-12-25 15:11:01 +00:00
Tyler Wilding
6920b4e366 gamedb: handle yaml parsing errors properly 2021-12-25 15:11:01 +00:00
Tyler Wilding
bda3835cb1 memcard: migrate folder memory cards to rapidyaml 2021-12-25 15:11:01 +00:00
Tyler Wilding
83e5aa6137 gamedb: migrate GameDB implementation to rapidyaml 2021-12-25 15:11:01 +00:00
Tyler Wilding
4719e52c6e fs-api: extend host API to allow retrieval of a resource file path 2021-12-25 15:11:01 +00:00
Tyler Wilding
e313eadcd2 common: pull our string functions into common 2021-12-25 15:11:01 +00:00
Tyler Wilding
be952e40ba vs: update project configuration to include rapidyaml 2021-12-25 15:11:01 +00:00
Tyler Wilding
4d4b24f8b0 cmake: support rapidyaml 2021-12-25 15:11:01 +00:00
Tyler Wilding
9533fa25c3 deps: remove yaml-cpp and add rapidyaml 2021-12-25 15:11:01 +00:00
lightningterror
013c9072b9 GS-hw: Move the blend mix alpha check after sw blending selection.
Optimization.
2021-12-25 14:52:07 +01:00
lightningterror
bf8dc05fac GS: Redo GetAlphaMinMax.
Cleaner this way, also fix recent regression on Full Blend with alpha max.
2021-12-25 14:52:07 +01:00
Connor McLaughlin
f4b38662fa GS/Null: Move methods to cpp file 2021-12-24 11:01:00 +00:00
Connor McLaughlin
ea41cce5ef GS: Add missing override specifier to a few files 2021-12-24 11:01:00 +00:00
TellowKrinkle
013c292ffb GS: Fix looping over pages of textures with massive strides 2021-12-23 19:10:19 -06:00
refractionpcsx2
cb18f11133 GS: Added auto Mipmap support in hardware for Jurassic Park 2021-12-23 08:25:52 +00:00
TellowKrinkle
ea25f49c65 Common: Fix GetWorkingDirectory on unix 2021-12-23 07:49:14 +00:00
Connor McLaughlin
5d15d5958e GS: Only copy draw area for colclip/DATE 2021-12-22 11:41:57 +01:00
Connor McLaughlin
efed92b15c GS/OpenGL: Move scaling factor to shader constant 2021-12-22 11:41:57 +01:00
Connor McLaughlin
7d39d02e98 GSDeviceOGL: Don't set scissor unconditionally 2021-12-22 11:41:57 +01:00
Connor McLaughlin
e006442e4f GSRendererNew: Remove another constant buffer copy 2021-12-22 11:41:57 +01:00
Connor McLaughlin
212848e931 GSDevice: Force inline accessor methods
Don't want to make debug builds slower.
2021-12-22 11:41:57 +01:00
Connor McLaughlin
732de53d1b GS: Get rid of second constant buffer for alpha pass 2021-12-22 11:41:57 +01:00
Connor McLaughlin
08c00eed1e GS: Unify constant buffers between renderers 2021-12-22 11:41:57 +01:00
refractionpcsx2
2a1c3d1f33 GS: Fix texture offset Y vector 2021-12-20 16:30:26 +00:00
lightningterror
5f57084ed9 GS-hw: Run GetAlphaMinMax only when required for Blend Mix.
Optimization.
2021-12-20 16:23:43 +01:00
lightningterror
9368e29d62 GS-d3d11:fx: Flip x and y dithering positions. 2021-12-19 22:24:30 +01:00
TellowKrinkle
ae8751e9ca GS:DX11: Use GSHWDrawConfig selector structs 2021-12-19 22:21:10 +01:00
TellowKrinkle
a11b8c4750 GS:OGL: Use GSHWDrawConfig selector structs 2021-12-19 22:21:10 +01:00
TellowKrinkle
1e7e23df96 GS: Less memcmp
It has a lot of work to do for its fancier return value
2021-12-19 22:21:10 +01:00
TellowKrinkle
8395e00835 GS: Remove now-unused renderers 2021-12-19 22:21:10 +01:00
TellowKrinkle
66bc1bdc77 GS: Add new shared hw renderer 2021-12-19 22:21:10 +01:00
TellowKrinkle
b8984661d9 GS: Use shared enum for blend level
Even if DX11 doesn't support all modes we can just use the ones it does support from the enum
2021-12-19 22:21:10 +01:00
Mrlinkwii
ea98a1c9f9 GameDB: change VUclamping on "Sled Storm" 2021-12-19 16:45:31 +00:00
Connor McLaughlin
9173b40e2e SPU2: Add function to pause output stream 2021-12-19 15:14:04 +00:00
Connor McLaughlin
59e5b1918f SPU2/XAudio: Get rid of exceptions 2021-12-19 15:14:04 +00:00
Connor McLaughlin
ab4b7b8ee6 SPU2: Remove unused methods from output modules 2021-12-19 15:14:04 +00:00
Connor McLaughlin
7f0f153ebd 3rdparty: Remove Portaudio 2021-12-19 15:14:04 +00:00
Connor McLaughlin
f3d51a242d SPU2: Remove Portaudio and SDL2 output modules 2021-12-19 15:14:04 +00:00
Connor McLaughlin
88ce192610 SPU2: Add Cubeb SndOut driver 2021-12-19 15:14:04 +00:00
Connor McLaughlin
bd489647e9 3rdparty: Add cubeb 2021-12-19 15:14:04 +00:00
Florin9doi
c36666b4d4 USB: Gametrak/RealPlay 2021-12-19 13:33:04 +00:00
Connor McLaughlin
97727cae2c GS/OpenGL: Don't delete null objects for PBO 2021-12-18 14:12:37 +00:00
Connor McLaughlin
f412b6818e GS/OpenGL: Fix incorrect VAO cleanup
This wasn't an issue in wx, since the whole context/device gets torn
down and recreated when you pause/unpause, or change settings.

But on Qt it is, since the context/device is preserved for a
faster/lighter settings apply.
2021-12-18 14:12:37 +00:00
Mrlinkwii
e8aea86e75 GameDB: Add EE Clamping to 'Digimon Battle Chronicle' and fixes to other games (#5178) 2021-12-18 14:04:18 +00:00
Connor McLaughlin
fac171fa95 CDVD: Check file actually opened before proceeding
If you loaded an invalid file, particularly with compression, the file
open may fail, leading to a division by zero (on block size), or trying
to read from nothing.
2021-12-18 13:41:56 +00:00
refractionpcsx2
fa1b6493da CDVD GZip: Correct type causing index creation to fail 2021-12-17 11:46:31 +00:00
refractionpcsx2
e58766745c Log: Restore BIOS Found message 2021-12-16 11:45:12 +00:00
Mrlinkwii
d8a9c5b479 Gamedb add gamefixes to 'Titeuf Mega-compet' and patch 'Yamiyo ni Sasayaku - Tantei Sagara Kyouichirou' series 2021-12-15 17:17:18 +00:00
Mrlinkwii
9a4d8ba934 Gamedb: add more 2k games patches 2021-12-15 10:52:22 +00:00
refractionpcsx2
ab816543c8 CDVD: Fixed typo opening gzip files
Fixes #5162
2021-12-15 09:38:04 +00:00
refractionpcsx2
37ccd81985 GS: Avoid some unnecessary flushes
CLUT only updates if valid index type used in PSM
2021-12-14 18:28:21 +00:00
refractionpcsx2
42dad4ade8 GS: Check CLUT dirty write on vertex kick 2021-12-14 18:28:21 +00:00
refractionpcsx2
b2ac035862 VS: Fix location of shaders in project 2021-12-14 17:47:53 +00:00
refractionpcsx2
f42d7eec74 CDVD: Don't set as Reading when buffering. 2021-12-14 10:35:12 +00:00
refractionpcsx2
e4ef41f86a CDVD: Fix some read timing logic 2021-12-14 10:35:12 +00:00
Mrlinkwii
103dd3954a missing UI and game elements. 2021-12-14 09:22:31 +00:00
Tokman5
2f9577a28e Add "Jikkyou Powerful Pro Yakyuu 2009" to GameIndex.yaml 2021-12-14 08:06:34 +00:00
Gauvain 'GovanifY' Roussel-Tarbouriech
33ec4d9430 msvc: fix issues with size() not being correctly evaluated as const 2021-12-13 09:34:24 +00:00
Gauvain 'GovanifY' Roussel-Tarbouriech
209f09ca7a pine: send serial without gui beautification 2021-12-13 09:34:24 +00:00
Gauvain 'GovanifY' Roussel-Tarbouriech
2e6af75f1d pine: add vle replies 2021-12-13 09:34:24 +00:00
Gauvain 'GovanifY' Roussel-Tarbouriech
f68122a380 ipc: rename to pine 2021-12-13 09:34:24 +00:00
TellowKrinkle
d51bdccf7f CMake: Remove gio dependency on macOS 2021-12-13 03:29:16 -06:00
iMineLink
7d8377b133 GS-hw: define some consts only in debug mode. 2021-12-13 08:06:52 +01:00
iMineLink
80d3a8a757 GS-hw, TC: don't linearly interpolate downloads.
Greatly improves Burnout games clouds rendering
with even (x2, x4, ...) upscaling factors.
2021-12-13 08:06:52 +01:00
iMineLink
2e6c5cde29 GS-hw: rework surface fetching.
Factorized code.
Always clear render targets and depth stencils
when being fetched.
"force_texture_clear" OGL only config removed.
2021-12-13 08:06:52 +01:00
iMineLink
0f2768dca4 GS-hw, TC: improve LookupTarget.
allow propagation of increased target size and
correct the rescaling.
2021-12-13 08:06:52 +01:00
iMineLink
d5be095482 GS-hw: fix burnout black sky and no clouds.
Achieved with a combination of OI+OO hacks that operate
during level loading to consolidate the rendering results
in the GS local memory.

* OI_BurnoutGames to perform small draws directly in local memory:
** improved OI_PointListPalette to draw clouds CLUT,
** improved SwSpriteRender to draw sky texture;
* OO_BurnoutGames used to download clouds texture from GPU.
2021-12-13 08:06:52 +01:00
iMineLink
b315625a94 GS-hw: resize rt and ds before draw if necessary. 2021-12-13 08:06:52 +01:00
iMineLink
6b51462fa0 GS-hw: use CanUpscale to check for upscaling. 2021-12-13 08:06:52 +01:00
iMineLink
373e698545 GS-hw, TC: fix tex scaling for native res draws.
The GSTextureCache::ScaleTexture method did not work
correctly when an old texture with a scale factor
different from 1 was recycled for a draw which was forced at
native resolution (the old scale factor was kept).
2021-12-13 08:06:52 +01:00
iMineLink
3b309c6d4e GS: dump alpha channel too. 2021-12-13 08:06:52 +01:00
kenshen112
8e93e9f516 CMake: Switch Wayland find script and usage to use imported targets
Also clears warning about mismatched names getting sent to FIND_PACKAGE_HANDLE_STANDARD_ARGS
2021-12-13 00:23:52 -06:00
kenshen112
ac8582eca7 CMake: Set minimum version first
Makes policy enabling based on minimum version work properly
Also increases minimum version to 3.11 because we actually do use 3.11 features
2021-12-13 00:23:52 -06:00
kenshen112
e6f72fdde7 GHActions: Enable Wayland in CI builds 2021-12-13 00:23:52 -06:00
Connor McLaughlin
9166218d07 EERec: Remove zero-distance jmp in full fpu mode 2021-12-13 00:56:50 +00:00
Mrlinkwii
c0b1bde94b Gamedb: add EEclamping to 'Dark cloud 2' 2021-12-12 22:31:30 +00:00
Mrlinkwii
756a679262 Gamdb:add EE clamping to 'Chou Saisoku! Zokusha King B.U.' 2021-12-12 21:35:54 +00:00
Mrlinkwii
13b19b35c0 GameDB: add patches to the 'Netsu Chu!' series and 'Samurai 7' series 2021-12-12 18:16:46 +00:00
Mrlinkwii
cadb70d1e4 Gamedb: add EEtiminghack to 'MGS2' and change VU and EE rounding for 'Primal' and add missing entries 2021-12-12 12:30:47 +00:00
TellowKrinkle
4cb4844e8d AppImage: Fix resource location 2021-12-12 06:10:47 -06:00
TellowKrinkle
556c7ca080 CMake: Don't include non-windows files on non-windows 2021-12-12 06:10:47 -06:00
TellowKrinkle
962db4bfc4 Resources: Move fxaa.fx to out of dx11 directory
It was used by both DX and OGL
2021-12-12 06:10:47 -06:00
TellowKrinkle
da651cabe4 Resources: Move shaders to shared shader/ directory 2021-12-12 06:10:47 -06:00
TellowKrinkle
e03076c6ff CMake: Fix macOS resource packaging
Previously was just putting in empty folders
2021-12-12 06:10:47 -06:00
refractionpcsx2
122968e63a CDVD: No rotational delay for seeks less than buffered sectors
Fixes Shadow Hearts Covenant hangs
2021-12-12 06:33:01 +00:00
Connor McLaughlin
6beac26727 GS/OpenGL: Fix an unused variable warning 2021-12-12 03:27:43 +00:00
Connor McLaughlin
3073281d13 CMake: Fix package mode 2021-12-12 03:27:43 +00:00
TellowKrinkle
0e0e23eefb PAD: Use files on disk instead of embedded resources 2021-12-12 03:27:43 +00:00
Connor McLaughlin
bcec38bd97 Patch: Make variables static 2021-12-12 03:27:43 +00:00
Connor McLaughlin
bd706f99b2 GlobalCommands: Remove FreezeGS
This was ifdefed out anyway...
2021-12-12 03:27:43 +00:00
Connor McLaughlin
501af632f7 IopBios: Use FileSystem for host access 2021-12-12 03:27:43 +00:00
Connor McLaughlin
a143122804 CI: Copy resources into AppImage 2021-12-12 03:27:43 +00:00
Connor McLaughlin
92aa426bba Move cheats_ws.zip to resources directory 2021-12-12 03:27:43 +00:00
Connor McLaughlin
96a1ce2fb2 CI: Fix path to GameIndex.yaml 2021-12-12 03:27:43 +00:00
Connor McLaughlin
c203a09435 Wx: Add check for resources directory before starting 2021-12-12 03:27:43 +00:00
Connor McLaughlin
c4084b4162 Add PerformanceMetrics to replace multiple sources of truth 2021-12-12 03:27:43 +00:00
Connor McLaughlin
2a7c948a57 GameDatabase: Store enums instead of strings 2021-12-12 03:27:43 +00:00
Connor McLaughlin
46912595ea GameDatabase: Move out of gui 2021-12-12 03:27:43 +00:00
Connor McLaughlin
120ee6c673 Get rid of wxChar in EnumToString 2021-12-12 03:27:43 +00:00
Connor McLaughlin
112238fbd7 Config: Add cache folder 2021-12-12 03:27:43 +00:00
Connor McLaughlin
38e288ef6a Common: Add utility classes 2021-12-12 03:27:43 +00:00
Connor McLaughlin
35322cf49b BiosTools: Add autoloader 2021-12-12 03:27:43 +00:00
Connor McLaughlin
8d44e1af0e CDVD: Remove wx from file access 2021-12-12 03:27:43 +00:00
Connor McLaughlin
16af078b3b BiosTools: Remove wx 2021-12-12 03:27:43 +00:00
Connor McLaughlin
3e968b4390 GS: Use files on disk instead of embedded resources 2021-12-12 03:27:43 +00:00
Connor McLaughlin
0029dac32d Host: Add the ability to read files from the resources directory 2021-12-12 03:27:43 +00:00
Connor McLaughlin
a083343c6e Common: Add FileSystem 2021-12-12 03:27:43 +00:00
refractionpcsx2
c277ee1d34 GS: D3D11 Download texture use rect 2021-12-10 11:06:36 +00:00
refractionpcsx2
ebe8592a8d GS: Fix typo on GS download
Fixes #5131
2021-12-10 09:49:50 +00:00
lightningterror
6c3e357d9e GS-ogl: Optimize fragment shader uniform buffer.
Couple MaxDepthPS with TA and Af vector.

Vectors are free so let's use them.

Optimization.
2021-12-10 03:44:47 +01:00
TellowKrinkle
64455620e8 GS: Use actual names for GL convert shaders 2021-12-09 05:26:26 -06:00
TellowKrinkle
fc799778de GS: Use actual names for DX11 convert shaders 2021-12-09 05:26:26 -06:00
TellowKrinkle
e04e0e38d1 GS:GL: Move TextureOffset to vs cb
It's used by the vs, why would you put it in the ps cb?
2021-12-09 05:26:26 -06:00
TellowKrinkle
8d6569be95 GS: Remove separate GSTextureCaches 2021-12-09 05:26:26 -06:00
TellowKrinkle
8b086a3898 Common: Clean up ScopedAlloc 2021-12-09 05:26:26 -06:00
TellowKrinkle
a4b8c33cf3 GS: Convert texture format to enum 2021-12-09 05:26:26 -06:00
TellowKrinkle
1d37ba47f4 GS: Make GSTexture::Type an enum class 2021-12-09 05:26:26 -06:00
TellowKrinkle
8d480c28ce GS: Remove unused virtuals from GSDevice 2021-12-09 05:26:26 -06:00
TellowKrinkle
6e38f40f96 GS: Convert ShaderConvert to enum class 2021-12-09 05:26:26 -06:00
arcum42
017c37f212 Only pass C++ flags to C++ files. (#5115) 2021-12-08 21:10:21 -08:00
TellowKrinkle
6eee4cb38a Core: Remove empty file
Had everything commented out and there's already a file with the same name and things not commented out in CDVD
2021-12-08 11:18:42 +00:00
TellowKrinkle
1f6a14261c VS: Add missing filters 2021-12-08 11:18:42 +00:00
refractionpcsx2
14e8d840ff GS SW: Handle flat prims without float conversion 2021-12-08 10:57:00 +00:00
lightningterror
125b9ea1e1 GS-hw: Purge SoTC crc hack.
No longer needed, fixed by #5110
2021-12-08 11:48:29 +01:00
lightningterror
e6b1e1948e GS-d3d11: Add a condition to not enable blend_mix if sw blending is already enabled.
Not yet needed but will be useful for sw blending when prims don't overlap.
2021-12-08 11:36:22 +01:00
lightningterror
ba1072f470 GS-ogl: Don't enable blend_mix if sw blend is already enabled.
Less accurate.
2021-12-08 11:36:22 +01:00
lightningterror
1fb29de082 GS-ogl: Try to use a mix of hw/sw blending in more situations.
When alpha is less than 128:
Do Cs*F or Cs*As in shader.
Do Cs*(As + 1) or Cs*(F + 1) in shader.
Do Cs*(1 - As) or Cs*(1 - F) in shader.

Optimization, might be faster as we will require less barriers.
2021-12-08 11:36:22 +01:00
lightningterror
f79e5ab559 GS-d3d11: Try to use a mix of hw/sw blending in more situations.
When alpha is less than 128:
Do Cs*F or Cs*As in shader.
Do Cs*(As + 1) or Cs*(F + 1) in shader.
Do Cs*(1 - As) or Cs*(1 - F) in shader.
2021-12-08 11:36:22 +01:00
Mrlinkwii
c3a9fd469e GameDB: add VU clamping to 'MVP Baseball 2003' 2021-12-08 10:29:05 +00:00
Mrlinkwii
c8abc909fa GameDB:add EEclamping full to 'Shinobido Takumi' 2021-12-07 20:00:15 +00:00
Mrlinkwii
401a9f4c62 GameDB: add patches to the 'K-1 World' series games and EE clamping full to 'D1 Professional Drift Grand Prix Series' 2021-12-07 15:51:13 +00:00
lightningterror
f1edb0c960 GS-ogl: Disable accumulation blend on PABE.
Requires accurate sw blending.
2021-12-07 10:12:58 +01:00
lightningterror
d73335e4d3 GS-d3d11: Don't enable PABE on accumulation blend.
Requires full sw blending.
2021-12-07 10:11:02 +01:00
TellowKrinkle
7a554be7a7 GS: Fix compiler warning and possible memory leak on exception 2021-12-06 05:44:16 +01:00
TellowKrinkle
31b6ff6046 GS: Use static_assert over assert where possible 2021-12-06 05:44:16 +01:00
lightningterror
38ab0630e6 GS-ogl: Update SetupCBMisc buffer only when GXBY channel is used, and cleanup some variables.
Optimization.
2021-12-06 03:15:48 +01:00
lightningterror
b5fa9deb30 GS-d3d11: Update ChannelShuffle buffer only when GXBY channel is used, and cleanup some variables.
Optimization.
2021-12-06 03:15:48 +01:00
lightningterror
4e8bae1703 GS-ogl: Sample depth on green channel. 2021-12-06 03:15:48 +01:00
lightningterror
464ce1c3cd GS-d3d11: Sample depth on green channel. 2021-12-06 03:15:48 +01:00
lightningterror
bb55c320c1 GS Debugger: Fix Length of dump. 2021-12-05 10:57:24 +01:00
TheLastRar
af585bffa9 DEV9: Add DEV9: prefix to "Can't open Device" log message 2021-12-05 03:53:33 +01:00
TheLastRar
bde4868b67 DEV9: Enable pcap non-blocking 2021-12-05 03:53:33 +01:00
TheLastRar
3835fc5ad1 DEV9: Don't shadow return value of GetAdaptersAddresses 2021-12-04 06:09:01 +01:00
Tyler Wilding
7b815b5f07 actions: increase linux build times as well until cache is reliable
We can rely on the cache more once the following issue is resolved - https://github.com/actions/cache/issues/342#issuecomment-673371329

Once we can, we should be able to dynamically set the timeout according to the cache-hit/miss
2021-12-04 06:05:38 +01:00
Tyler Wilding
754c6126b1 actions: Only announce pre-release releases in the discord 2021-12-04 05:57:05 +01:00
Mrlinkwii
2dc2a32e45 GameDB: add 'VUKickstartHack' to 'Crash Twinsanity' 2021-12-04 02:56:22 +00:00
lightningterror
7a579303b9 GS-d3d11:fx: Split color clamp/wrap in it's own function.
Use the function for both sw blending and dithering, less code duplication.
2021-12-03 19:59:29 +01:00
lightningterror
03401e377b GS-ogl:glsl: Split color clamp/wrap in it's own function.
Use the function for both sw blending and dithering, less code duplication.
2021-12-03 19:59:29 +01:00
Ziemas
ff4ec6d843 SPU: Change dummy SP check for consistency 2021-12-03 19:37:19 +01:00
Ziemas
0dc3dcd9ed SPU: Start the sample pointer at -1
This makes videos in Stolen work again.
2021-12-03 19:37:19 +01:00
Ziemas
ed3237f808 SPU: Use hex values for sample pointer 2021-12-03 19:37:19 +01:00
Tyler Wilding
9321c3c334 gh: remove 32-bit Windows 11, it doesn't exist 2021-12-03 19:24:05 +01:00
Tyler Wilding
adc7d41183 gh: add minimal issue template for issues that don't pertain to games
A lot of the required information we enforce is not applicable to application level bugs
2021-12-03 19:24:05 +01:00
Tyler Wilding
4ca69d8818 gh: Update issue-templates to include Win11 2021-12-03 19:24:05 +01:00
Mrlinkwii
cca52e271b Gamedb: add 'VIFFIFOHack' to 'Men in Black II: Alien Escape' 2021-12-02 19:29:28 +00:00
TellowKrinkle
a2e15bbc87 GHActions:macos: Install glib
Looks like GHActions changed what things they preinstall
2021-12-02 15:08:18 +01:00
Mrlinkwii
9d6ad0303c GameDB: Add fixes for 'Shadow Man - 2econd Coming' and 'Ghosthunter' games. 2021-12-02 14:01:47 +00:00
Mrlinkwii
bbaa23c22d Readme : update links 2021-12-01 22:43:36 +00:00
Ziemas
bacb860cc1 GUI: Allow relative elf file paths on command line. (#4451) 2021-11-30 10:06:17 +01:00
Ziemas
7a4191e16d Fix compilation with LTO on GCC 2021-11-30 02:25:06 +00:00
PCSX2 Bot
0fa620e3ba pad-linux: Update to latest controller database. 2021-11-29 17:17:26 +01:00
dependabot[bot]
96642d8bc3 Bump mathieudutour/github-tag-action from 5.6 to 6.0
Bumps [mathieudutour/github-tag-action](https://github.com/mathieudutour/github-tag-action) from 5.6 to 6.0.
- [Release notes](https://github.com/mathieudutour/github-tag-action/releases)
- [Commits](https://github.com/mathieudutour/github-tag-action/compare/v5.6...v6.0)

---
updated-dependencies:
- dependency-name: mathieudutour/github-tag-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 16:01:55 +01:00
dependabot[bot]
8a26c3783a Bump actions/cache from 2.1.6 to 2.1.7
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.6 to 2.1.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2.1.6...v2.1.7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 13:21:27 +00:00
lightningterror
d2742a177c GS-d3d11: Properly set afix in EmulateBlending.
Accumulation blend -> afix is already handled in shader, no need to set it for hw blending too.
SW blending -> done in shader.
HW blending - > set only when it is actually used, Alpha C.

GS-d3d11: Properly set afix in EmulateBlending.

Accumulation blend -> afix is already handled in shader, no need to set it for hw blending too.
SW blending -> done in shader.
HW blending - > set only when it is actually used, Alpha C.
2021-11-26 21:25:16 +01:00
TellowKrinkle
6d4713e069 GS: Alloc sw renderer things on custom heap 2021-11-26 13:44:07 -06:00
TellowKrinkle
342170b077 GS: Add new heap for SW renderer allocations 2021-11-26 13:44:07 -06:00
TellowKrinkle
df02d784d6 GS: Throw from vmalloc on failure 2021-11-26 13:44:07 -06:00
tellowkrinkle
340874996e CMake: Always default CMAKE_BUILD_PO off
Git files getting modified by build is just as much of a pain in release builds as it is in devel builds
2021-11-26 13:02:25 -06:00
lightningterror
3bd89154d3 GS-wx: Fix some gui interaction.
Fix interaction of Anisotropic filtering with Nearest Texture Filtering and GPU Palette Conversion.
Fix interaction of Trilinear Filtering with selected renderer.

Options should gray out properly now.
2021-11-26 18:32:58 +00:00
Connor McLaughlin
1e198fbb83 GS/OpenGL: Use CreateRenderTarget() for temp HDR target
Probably won't change much, except maybe with sparse textures,
where it'll use less video memory.
2021-11-25 23:26:31 +01:00
TellowKrinkle
01855fc66a GHActions: Don't shallow clone submodules
Shallow clones tend to be 5-10s slower
2021-11-24 15:43:56 -06:00
refractionpcsx2
7ac045b5e2 GS: Partial revert of #5061 2021-11-24 01:01:55 +00:00
lightningterror
03f1617ff5 GS-GSState: Mask out AA1 on triangles.
AA1 is not supported on hw renderers so ignore flushing the prims on triangles.

Should provide a nice speed boost on games that use AA1 on triangle prims.
2021-11-24 00:14:03 +01:00
lightningterror
c75b20e37d GS-hw: Also disable Blending when AA1 and ABE or PABE are both set on lines.
There's no need to blend them since there is no implementation.
2021-11-24 00:14:03 +01:00
lightningterror
08f72596d4 GS-hw: EmulateBlending move early return to the top.
Optimization.
2021-11-24 00:14:03 +01:00
lightningterror
dcd1f90ae7 GS-hw: Disable Z writes on AA1 flag when prim are lines.
When AA1 flag is enabled Z is not written on lines since coverage is always less than 0x80.
2021-11-24 00:14:03 +01:00
lightningterror
c10603d161 GS-hw: Disable alpha blending when only AA1 flag is enabled.
There is no hw implementation of AA1.

Alpha blending shouldn't be enabled by AA1 flag, only ABE and PABE flags.
2021-11-24 00:14:03 +01:00
Mrlinkwii
7ea335e59b GameDB : fix Fuuraiki 2 patch 2021-11-23 11:55:23 +00:00
lightningterror
d20cb91d90 Gs-d3d11:fx: Adjust sw blend shader a bit.
Use As and Cs in pabe code, makes more sense.

Get rid of Cv vector, use Color parameter for operations instead like on gl.
2021-11-23 09:02:54 +01:00
lightningterror
e38d754e86 Gs-ogl:glsl: Adjust sw blend shader a bit.
Get rid of Color_pabe vector, makes more sense to use As and Cs in pabe code.
2021-11-23 09:02:54 +01:00
refractionpcsx2
afacc47f33 CDVD: Adjust DMA timing based on PS1 timings.
Bus width is 16bit on the PS2 and 8bit on PS1, so serves to reason the DMA would be twice the speed. (PS1 is 24 cycle per word)
2021-11-22 22:18:32 +00:00
refractionpcsx2
5803cc441e GS: Improve FixedTEX0 accuracy 2021-11-22 22:17:59 +00:00
Mrlinkwii
d60c66deee GameDB: purge patches for 'Knockout Kings 2002' 2021-11-22 21:42:26 +00:00
PCSX2 Bot
d7797a50f5 pad-linux: Update to latest controller database. 2021-11-22 20:55:52 +01:00
Mrlinkwii
87bbebed36 Gamedb: remove the patch for Virtua Fighter 4 2021-11-22 17:51:51 +00:00
Mrlinkwii
3aa33bf0b1 Gamedb :add 'GIFFIFOHack' to 'FIFA 2005'and EE clamping for 'D1 Professional Drift Grand Prix Series 2005' 2021-11-22 15:41:25 +00:00
Christian Kenny
e37afd6976 3rdparty: Upgrade soundtouch lib to 2.3.1 2021-11-22 15:38:03 +00:00
Christian Kenny
791f2a63ac 3rdparty: Upgrade xbyak to 6.00 2021-11-22 15:37:44 +00:00
refractionpcsx2
1917f2b98a GS: Re-remove part of Clamp Repeat opt.
This is kind of not needed, it's handled above really.
2021-11-22 10:35:19 +00:00
Connor McLaughlin
78b74f1115 GLLoader: Remove glCopyTextureSubImage2D() wrapper
Not needed anymore.
2021-11-22 05:53:44 +01:00
Connor McLaughlin
8ea24d9ff9 GS/OpenGL: Use shader+draw for CopyRectConv 2021-11-22 05:53:44 +01:00
Ty Lamontagne
f36d5fdbdf Debugger: Format search hits with proper specifier 2021-11-21 22:00:49 +01:00
RedDevilus
d421fc6e6f GUI: Bring back F6 string (Aspect Ratio)
Fixes regression from https://github.com/PCSX2/pcsx2/pull/4140
2021-11-21 20:28:23 +00:00
refractionpcsx2
90c4c9e96b Build: Fix clang
Stupid thing, the actions builds were fine!
2021-11-21 18:43:37 +00:00
refractionpcsx2
0a79892923 microVU: Preserve XGKIck cycles in delay slot
Also added handling for xgkick sync on single instructions
2021-11-21 17:18:34 +00:00
refractionpcsx2
d88f638fbc GS: Redo the Texture min/max opt 2021-11-21 17:18:11 +00:00
Christian Kenny
d29121a871 Core: Reset game loaded/started variables on recompiler shutdown. 2021-11-21 03:25:37 +00:00
Christian Kenny
5b8e983478 ELFHeader: Detect CRC properly for PSX games, improve formatting of game serial output. 2021-11-21 03:25:37 +00:00
Christian Kenny
24d47cb10b Don't update saveslot info if VM isn't running yet 2021-11-21 03:25:37 +00:00
Christian Kenny
ae7b84a85f Savestates: Use folders for organizing savestates per game. 2021-11-21 03:25:37 +00:00
Mrlinkwii
161240045f Gamedb: add various fixes for various games and removal of patches 2021-11-21 03:03:21 +00:00
refractionpcsx2
fe85fc9d25 GIF: Modify fifo read behaviour
Fixes some glitching in Need for Speed Underground 2
2021-11-21 03:01:03 +00:00
arcum42
b8a2cd1b06 PAD: Call one joint pad header in most of pcsx2, not two. (#4985)
Add Gamepad.h

Cleanup.

Remove the Windows version of PAD.h as well.

Update CMakeLists.txt

Revert language changes.
2021-11-20 18:57:58 -08:00
refractionpcsx2
eee51828cb Build: Remove old unused cheatscpp.h file 2021-11-21 00:22:34 +00:00
refractionpcsx2
1eddd9017b 3rd Party: Update rogue file to correct license.
Got missed in an update as they switched to auto generation, but the license was switched prior to us last updating the library. See this commit: 819c6a8d68 (diff-dcf9d0451a6397210424fc9699e209255660a4d3b3072c2f1b35048df8df4092)
2021-11-20 23:33:48 +00:00
tellowkrinkle
9c0582a103 wx: Fix pxExplore on macOS (#4989)
* wx: Fix `pxExplore` on macOS

Trying to open file urls in a browser does not actually launch a file explorer in macOS

* wx: Remove pxExplore/pxLaunch

Was barely used
2021-11-19 18:35:50 -08:00
arcum42
6cd8b34abb Update the FAQ, as well as some general cleanup. (#5033)
* Update the FAQ, as well as some general cleanup.

* A few more adjustments.

* Change indentation.

* Minor changes.

* Remove the information about the time, which was incorrect.

* Life is like a hurricane...

* Modify Windows controller information.

* Add more ways to contribute.
2021-11-19 16:22:44 -08:00
Ty Lamontagne
47075bec49 Debugger: Make memory dialog transparent
Was supposed to do this in my initial memory search pr but ended up removing while fighting with git accidentally.
2021-11-19 00:53:05 +00:00
lightningterror
8eb6cbd400 GS-gui: Change blending option from None to Minimum.
None doesn't actually fully disable sw blending, so the option is a bit inaccurate, rename it to Minimum instead.

Also slightly update tooltip.
2021-11-17 22:44:51 +01:00
TellowKrinkle
8f394b5c3f GHActions:macos: Remove gtk3 dependency 2021-11-17 14:23:15 -06:00
TellowKrinkle
2245315b60 CMake: Remove gtk dep on macOS
We only need gio now
2021-11-17 14:23:15 -06:00
Connor McLaughlin
0d40661b33 VSProps: Set MultiProcessorCompilation in CodeGen props 2021-11-16 10:08:20 +00:00
refractionpcsx2
e015b91ed1 CDVD: Don't allow DMA read if DMA isn't running 2021-11-16 09:31:34 +00:00
PCSX2 Bot
de577709d9 pad-linux: Update to latest controller database. 2021-11-15 17:19:19 +01:00
refractionpcsx2
52c6d79975 VS: Organise filter confusion between GS and GIF files 2021-11-14 21:57:33 +00:00
refractionpcsx2
512064f1b5 GS: Only reload Auto MIPs on TEX base change 2021-11-14 21:57:33 +00:00
Ty Lamontagne
a396b50610 Debugger: Allow access to all of 0xBXXXXXXX 2021-11-14 20:19:33 +00:00
TellowKrinkle
67299fcd9f Core: Remove __packed macro 2021-11-14 13:52:20 -06:00
TellowKrinkle
f7476dfb63 Core: Replace alignment macros with alignas 2021-11-14 13:52:20 -06:00
TellowKrinkle
87f7672dbf GS: Remove windows includes from GS.h 2021-11-14 13:52:20 -06:00
TellowKrinkle
648a958290 GS: Split GS.h into multiple smaller headers 2021-11-14 13:52:20 -06:00
TellowKrinkle
ed90e2fcf9 GS: Header cleanup 2021-11-14 13:52:20 -06:00
TellowKrinkle
b74be70ffc GS: Switch integer typedefs to match rest of pcsx2
Had to capitalize the names of some struct params that had the same names
2021-11-14 13:52:20 -06:00
TellowKrinkle
2351431d71 Misc: Remove custom countof macros in favor of std::size 2021-11-14 13:52:20 -06:00
TellowKrinkle
7435f76609 Misc: Move GS preprocessor defs to main PCSX2 file 2021-11-14 13:52:20 -06:00
TellowKrinkle
d2c1a4a7fb Core: Add header for PCSX2-specific preprocessor definitions 2021-11-14 13:52:20 -06:00
TellowKrinkle
e37fbfddc3 Misc: Better GCC defs
Less warnings about fastcall being unsupported, proper __assume implementation
2021-11-14 13:52:20 -06:00
TellowKrinkle
8ab884a89e Misc: Format Pcsx2Defs.h 2021-11-14 13:52:20 -06:00
Mrlinkwii
42f438146c GameDB: add ee-rounding and vu-rounding to various entries 2021-11-14 16:31:25 +00:00
TellowKrinkle
08b1b350db wx: Remove wxString implicit conversion to std::string on windows
Can be lossy, and no one likes a lossy implicit conversion
2021-11-13 18:44:26 -06:00
TellowKrinkle
cbcd9b5004 wx: Remove wxString implicit constructor from std::string
On windows, it uses the current system's character encoding instead of utf-8, which breaks a lot of things.  We should avoid it.
2021-11-13 18:44:26 -06:00
TellowKrinkle
162a0bbe46 CMake: Fix duplicate definition of WavFile on Windows 2021-11-13 18:44:26 -06:00
refractionpcsx2
69d50e583e GameDB: Patches for MX Vs ATV Unleashed SPS 2021-11-13 18:51:11 +00:00
orbea
40a8384087 Update libchdr
Fixes https://github.com/PCSX2/pcsx2/issues/5009
2021-11-13 01:11:37 +00:00
lightningterror
6053b2b5c9 GS-wx: Adjust some checkboxes to be in alphabetical order. 2021-11-12 20:32:18 +01:00
TellowKrinkle
7e17497c1e GS: Require hardware renderer for hacks in wx config 2021-11-12 20:15:07 +01:00
TellowKrinkle
b573be918e wx:GS: Grow notebook with GS settings pane 2021-11-12 20:15:07 +01:00
TellowKrinkle
2fada14a65 GS: Fix Half Pixel Offset and Half Screen Fix config swap 2021-11-12 20:15:07 +01:00
TellowKrinkle
cf64a2bc8e GS: Rename accurate date config option 2021-11-11 18:18:28 -06:00
TellowKrinkle
39fd3479b7 Core: Add dev mode config 2021-11-11 18:18:28 -06:00
TellowKrinkle
536133289f wx:GS: Pad all the things 2021-11-11 18:18:28 -06:00
TellowKrinkle
3f280649a9 GS: Make spinners full width in wx config
Lines up nicer with other elements
2021-11-11 18:18:28 -06:00
TellowKrinkle
6c80aa8c98 GS: Add D3D11 blend mode selector to wx config 2021-11-11 18:18:28 -06:00
TellowKrinkle
65c39f600f GS: Renderer and upscale prerequisites for wx config 2021-11-11 18:18:28 -06:00
TellowKrinkle
3b5a9f6c6a GS: More generic prerequisite checking for wx config 2021-11-11 18:18:28 -06:00
TellowKrinkle
665db4bdad wx: Stop tripping wx3.1+ asserts in gs config 2021-11-11 18:18:28 -06:00
TellowKrinkle
b34e7fa303 GS: Add X and Y labels to wx settings texture offset 2021-11-11 18:18:28 -06:00
kojin
abc0458d4f GS: remove image header from wx settings dialog 2021-11-11 18:18:28 -06:00
kojin
1e35398a84 GS: new wx config dialog working on windows 2021-11-11 18:18:28 -06:00
kojin
be3253bf87 d3d: abstract some dxgi functionality
- adapters are now referenced by index instead of string matching, hopefully this will make a few things easier
- add a setting to enable dxgi/device debugging (instead of hiding it behind a compiler macro)
- improve logging
- remove some d3d cruft from gsutils
2021-11-11 18:18:28 -06:00
arcum42
241a762d04 GS: Switch to wx config dialog 2021-11-11 18:18:28 -06:00
TellowKrinkle
b944687191 GS: Clean up wx config code 2021-11-11 18:18:28 -06:00
arcum42
736c66ee31 GS: Add tooltips to the wx settings dialog 2021-11-11 18:18:28 -06:00
arcum42
d96f31d01b GS: Add new wx version of GS settings dialog 2021-11-11 18:18:28 -06:00
Mrlinkwii
e30c096d87 GameDB:add 'GIFFIFOHack' to 'Gunfighter 2 - Legend of Jesse James' 2021-11-11 09:15:35 +00:00
Ty Lamontagne
be71b98c55 Debugger: Update enums and fix 32 bit support
Also move bitcast to a proper location
2021-11-11 00:41:40 +00:00
Ty Lamontagne
6bec3162f6 Debugger: Use bit_cast where needed, cleanup some stuff 2021-11-11 00:41:40 +00:00
Ty Lamontagne
c863876dee Debugger: Implement CtrlMemorySearch 2021-11-11 00:41:40 +00:00
TellowKrinkle
f5d0542f06 DEV9-GUI: Rearrange config interface
Fixes HDD Size ticks from 1 to 10 (40,50,60,...) and less squished together.
2021-11-11 00:40:23 +00:00
RedDevilus
b1650eb503 PCSX2-GUI: Fix Groupboxes to align correctly
Make things look more symmetrical and structured.
Affects Audio Settings (SPU2) , Gamepad Settings (PAD) + Network and HDD Settings (DEV9).
For audio settings the slider will no longer do 0.5 steps when you change from TimeStretch. Reduce max audio latency from 750 to 200 (less is better if your PC can handle it).
Windows SPU2 codebase is in dire need of a rehaul on how it handles this behaviour (not convert it multiple times).
2021-11-11 00:40:23 +00:00
Mrlinkwii
82b090e234 GameDB: add nearest rounding to 'Hitman - Contracts' and various fixes 2021-11-10 14:14:52 +00:00
lightningterror
7f1e416d31 GS-ogl: Remove device, driver checks in GLLoader.
Duplicate, it is already handled elsewhere.

Also cleanup some stuff.
2021-11-10 02:27:18 +01:00
Ty Lamontagne
4312bf711c Debugger: Fix breakpoint window on linux 2021-11-09 18:07:46 +01:00
Ty Lamontagne
f8061448d1 Debugger: Reset breakpoint skip on savestate load 2021-11-09 18:06:54 +01:00
PCSX2 Bot
e934bec4b7 pad-linux: Update to latest controller database. 2021-11-08 17:27:08 +01:00
TellowKrinkle
4e5d7ba8ef GS:SW: Fix fog on x64 avx2 2021-11-08 09:19:05 +00:00
TellowKrinkle
59fd815c3d GS: Faster GSOffset::PAHelper 2021-11-07 03:44:31 +00:00
TellowKrinkle
b901c6af71 GS: Switch back to row+column for pixel lookups
Code for the full calculation was way too complicated to run for every pixel in a loop
2021-11-07 03:44:31 +00:00
TellowKrinkle
b2fb6c7804 GS: Don't calculate a pageOffset per bp 2021-11-07 03:44:31 +00:00
TellowKrinkle
84c5f8f738 GS: Remove rowOffset 2021-11-07 03:44:31 +00:00
TellowKrinkle
39c7f11b98 GS: Pixel loop optimizations 2021-11-07 03:44:31 +00:00
TellowKrinkle
86a2d73931 GS: Clean up old GSOffset remnants 2021-11-07 03:44:31 +00:00
TellowKrinkle
8eb50c3517 GS: Switch to new non-cached GSOffset 2021-11-07 03:44:31 +00:00
TellowKrinkle
d9defb19f9 GS: Add new GSOffset class 2021-11-07 03:44:31 +00:00
TellowKrinkle
874804bcfd GS: Add block/page loop functions to GSSwizzleInfo 2021-11-07 03:44:31 +00:00
TellowKrinkle
b0f9662811 GS: Add srav and blend backwards compat to GSVector4i 2021-11-07 03:44:31 +00:00
TellowKrinkle
24850823a2 GS: Use new swizzle calculation class 2021-11-07 03:44:31 +00:00
TellowKrinkle
951604475b GS: Add class for swizzle calculations 2021-11-07 03:44:31 +00:00
Ty Lamontagne
74f3bb2aa9 Debugger: Make the register list DPI aware 2021-11-07 03:43:55 +00:00
Tyler Wilding
4442b798c9 CDVD: set the correct RTC year when input recording 2021-11-07 02:21:01 +00:00
Tyler Wilding
f10a8de2c1 input-rec: Use a constant RTC for power-on recordings 2021-11-06 16:24:53 +00:00
Tokman5
329b29269b GameDB: Add and fix Power Pros series 2021-11-06 16:23:02 +00:00
Mrlinkwii
5b3ffe6bab GameDB: add EE clamping to 'Shadow of Zorro' and 'Evil Twin - Cyprien's Chronicles'
GameDB: add EE clamping to 'Shadow of Zorro' and 'Evil Twin - Cyprien's Chronicles'
2021-11-06 16:20:04 +00:00
Joey
fb14500b41 pad-linux: Abort 'set all btns' on escape key + gui fixes (#4809) 2021-11-06 00:44:08 -07:00
TellowKrinkle
ad29594d08 Use correct clock for GS fps calculations on unix 2021-11-05 23:11:53 -05:00
tellowkrinkle
37e2142cca Common: Fix Darwin thread times
Percentages will now actually be percentages instead of permille (units of 1/1000)
Was caused by trying to match Windows's returns of 100ns units, but then reporting 1µs units from `GetThreadTicksPerSecond()`
2021-11-05 23:11:53 -05:00
tellowkrinkle
1e5f1de12c CMake: Increase deployment target to 10.13
Allows use of throwing `optional` and `variant` methods
2021-11-05 23:11:53 -05:00
tellowkrinkle
0f93dbcd5e USB: Make save state non-required
Fixes save state loading for systems using a null USB plugin (macOS, BSD)
2021-11-05 23:11:53 -05:00
RedDevilus
e415d85dbe GameDB: Add and fix SingStar Entries
I noticed we had a ton of missing SingStar serial + minor other fixes.
2021-11-05 15:59:29 +00:00
Mrlinkwii
4c8bf53e69 CI:Add build date to program log of nightly builds 2021-11-05 01:16:08 +00:00
refractionpcsx2
83fcd4bd1f SPU: Kind of revert last ADMA change. Clear as reading.
This is a temporary measure while we run some hardware tests, the previous change broke Burnout 3's engine sounds.
2021-11-04 20:13:18 +00:00
TellowKrinkle
bfd960ad1b GHActions:Linux: Upgrade to Clang 9 2021-11-04 20:11:15 +00:00
qurious-pixel
6b81808ecc gcc compatibility for older distros
Add compatibility layer for using newer gcc on older distros.
- use AppImageKit-checkrt
- copy build system stdc++ and gcc_s
2021-11-04 20:11:15 +00:00
TellowKrinkle
c615a6f6e2 GHActions:Linux: Upgrade to GCC 10 2021-11-04 20:11:15 +00:00
TellowKrinkle
40b522b42f GHActions:Linux: Remove unneccessary packages 2021-11-04 20:11:15 +00:00
TellowKrinkle
f2655b763f GHActions:Linux: Clean up setup scripts 2021-11-04 20:11:15 +00:00
TellowKrinkle
fd145e65aa GS: Remove virtual destructor from GSAlignedClass
No point, and made it not a standard layout type
2021-11-04 19:32:27 +00:00
TellowKrinkle
6596b7f27e GS: Enable AVX2 on x64 2021-11-04 19:32:27 +00:00
TellowKrinkle
9d767838d6 GS: Remove old DrawScanline code generators 2021-11-04 19:32:27 +00:00
TellowKrinkle
f55219bb1b GS: Replace 6 DrawScanline code generators with one merged one 2021-11-04 19:32:27 +00:00
TellowKrinkle
805b647c73 GS: Remove old SetupPrim code generators 2021-11-04 19:32:27 +00:00
TellowKrinkle
fd0351ca8f GS: Replace 6 SetupPrim code generators with one merged one 2021-11-04 19:32:27 +00:00
TellowKrinkle
ed5a7802f3 Common: Add non-constant offsetof macro 2021-11-04 19:32:27 +00:00
TellowKrinkle
44f8317b7e GS: Add new code generator for easy native-isa codegen 2021-11-04 19:32:27 +00:00
TellowKrinkle
0200933ddd GS: Don't catch code generation exceptions
If codegen throws an exception, it ends up just crashing when you jump to the incompletely-generated code which is kind of useless
2021-11-04 19:32:27 +00:00
lightningterror
f712b2b63a GSDeviceOGL: Fix Wunused-private-field warnings. 2021-11-04 11:18:26 +01:00
Tyler Wilding
71923e7cba actions: cleanup discord embed links and add release body 2021-11-03 23:46:45 +00:00
refractionpcsx2
532d14611c GS: Properly loop when reading 32bit CLUT from offset 2021-11-03 18:24:57 +00:00
refractionpcsx2
3a91a07d51 GS: Fix up CLUT offset handling in 32bit I8 mode 2021-11-03 18:24:57 +00:00
refractionpcsx2
6a8287ea9f EE JIT: Backup shift on LDR/L if rs==rt 2021-11-03 18:03:09 +00:00
Tyler Wilding
dc051541bd actions: create automatic controller db updating workflow 2021-11-03 16:40:36 +01:00
lightningterror
3265c2a614 GS-ogl: Put GL_ARB_get_texture_sub_image code under a define.
Code is currently disabled, no need to check for the extension.
2021-11-03 16:37:55 +01:00
lightningterror
f798401e93 GS-ogl: Remove checks for extensions we don't yet use.
They serve no purpose, no need to check unless we actually use them

GL_ARB_compute_shader,
GL_ARB_shader_storage_buffer_object,
GL_ARB_texture_view,
GL_ARB_vertex_attrib_binding,
GL_ARB_multi_bind
2021-11-03 16:37:55 +01:00
2305 changed files with 257702 additions and 390180 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
# These are supported funding model platforms
github: [PCSX2]

View File

@@ -0,0 +1,78 @@
# Docs - https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Application Bug Report
description: Found a problem with the application itself (ie. bad file path handling, UX issue)? Help us improve it.
title: "[BUG]: "
labels: [Bug]
# assignees:
# - octocat
body:
- type: markdown
attributes:
value: |
## Important: Read First
Please do not make support requests on GitHub. Our issue tracker is for tracking bugs and feature requests only
If you need help configuring the emulator please make a request on our forums or contact us on discord
If you are unsure, start with [discord](https://discord.com/invite/TCz3t9k) or the [forums](https://forums.pcsx2.net/index.php)
Please make an effort to make sure your issue isn't already reported
### Please Avoid Issues Pertaining to the Following:
- We are **not** accepting bug reports for **PSX mode** at this time
- If you are interested in helping contribute to PSX mode please do so on the forums. Otherwise our recommendation is that you use a [proper PSX emulator](https://emulation.gametechwiki.com/index.php/PlayStation_emulators)
- We do **not** accept issues relating to **upscaling** at this time
- We are aware of the various problems with upscaling. The issue spans many games and having hundreds of issues for the same fundamental issues isn't particularly helpful. There are several workarounds for graphical problems that come as a result of upscaling
- Please try your game at native resolution before creating an issue
- If your bug is the result of upscaling please use the forums or discord for assistance with various upscaling workarounds. Additionally, the unofficial PCSX2 [Wiki](https://wiki.pcsx2.net/Main_Page) often lists various fixes for upscaling issues
- type: textarea
id: desc
attributes:
label: Describe the Bug
description: "A clear and concise description of what the bug is"
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduction Steps
description: "Steps to reproduce the behavior"
validations:
required: true
- type: textarea
id: expect
attributes:
label: Expected Behavior
description: "A clear and concise description of what you expected to happen"
validations:
required: false
- type: input
id: rev
attributes:
label: PCSX2 Revision
description: "Please ensure you are on the latest version before making an issue"
placeholder: "Example: v1.7.1337"
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
options:
- Windows 11
- Windows 10 (64bit)
- Windows 8.1 (64bit)
- Linux (64bit) - Specify Distro Below
- macOS (Monteray)
- macOS (BigSur)
- macOS (Catalina)
- macOS (Mojave)
validations:
required: true
- type: input
id: os-distro
attributes:
label: If Linux - Specify Distro
placeholder: "Example: Arch"
validations:
required: false

View File

@@ -1,6 +1,6 @@
# Docs - https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
name: Bug Report
description: Found a problem? Help us improve.
name: Emulation Bug Report
description: Problem in a game (ie. graphical artifacts, crashes)? Help us improve it.
title: "[BUG]: "
labels: [Bug]
# assignees:
@@ -54,9 +54,6 @@ body:
Please make sure your system meets our requirements for OS version, CPU and GPU
- [System Requirements](https://github.com/PCSX2/pcsx2#system-requirements)
We **do not** accept bug reports for **unsupported operating systems**.
- [For macOS Support](https://forums.pcsx2.net/Thread-Native-Mac-Testing-Build)
Performance issues as a result of not meeting our hardware requirements are not valid
Please read our known issues pages for AMD and Intel drivers.
@@ -69,7 +66,7 @@ body:
attributes:
label: PCSX2 Revision
description: "We only accept bug reports for the latest dev version. Please try upgrading before making an issue."
placeholder: "Example: dev-525"
placeholder: "Example: v1.7.1337"
validations:
required: true
- type: dropdown
@@ -77,11 +74,9 @@ body:
attributes:
label: Operating System
options:
- Windows 10 (32bit)
- Windows 11
- Windows 10 (64bit)
- Windows 8.1 (32bit)
- Windows 8.1 (64bit)
- Linux (32bit) - Specify Distro Below
- Linux (64bit) - Specify Distro Below
- macOS (Monteray)
- macOS (BigSur)

23
.github/labeler.yml vendored
View File

@@ -27,11 +27,19 @@
'GUI/WX':
- 'pcsx2/gui/*'
- 'pcsx2/gui/**/*'
- 'pcsx2/SPU2/wx/*'
- 'pcsx2/SPU2/wx/**/*'
- 'pcsx2/PAD/Linux/wx_dialog/*'
- 'pcsx2/PAD/Linux/wx_dialog/**/*'
- 'pcsx2/GS/Window/GSwxDialog.h'
'GUI/Qt':
- 'pcsx2-qt/*'
- 'pcsx2-qt/**/*'
- '3rdparty/Qt/*'
- '3rdparty/Qt/**/*'
'GameDB':
- '**/GameIndex.*'
'Installer | Package':
- 'nsis/*'
- 'nsis/**/*'
- 'build.sh'
# Tools / Features
@@ -65,15 +73,24 @@
'GS':
- 'pcsx2/GS/*'
- 'pcsx2/GS/**/*'
'GS: Direct3D':
'GS: Direct3D 11':
- 'pcsx2/GS/Renderers/DX11/*'
- 'pcsx2/GS/Renderers/DX11/**/*'
'GS: Direct3D 12':
- 'pcsx2/GS/Renderers/DX12/*'
- 'pcsx2/GS/Renderers/DX12/**/*'
'GS: Hardware':
- 'pcsx2/GS/Renderers/HW/*'
- 'pcsx2/GS/Renderers/HW/**/*'
'GS: OpenGL':
- 'pcsx2/GS/Renderers/OpenGL/*'
- 'pcsx2/GS/Renderers/OpenGL/**/*'
'GS: Vulkan':
- 'pcsx2/GS/Renderers/Vulkan/*'
- 'pcsx2/GS/Renderers/Vulkan/**/*'
'GS: Metal':
- 'pcsx2/GS/Renderers/Metal/*'
- 'pcsx2/GS/Renderers/Metal/**/*'
'GS: Texture Cache':
- 'pcsx2/GS/Renderers/*TextureCache*.*'
- 'pcsx2/GS/Renderers/**/*TextureCache*.*'

View File

@@ -0,0 +1,14 @@
# CI Documentation
## Releases
```mermaid
sequenceDiagram
PCSX2 Repo->>Actions: PR is merged or commit is pushed to master
Actions->>PCSX2 Repo: Increment latest tag and push, create a draft release
Actions->>Actions: Kicked off pipeline on the tag push, build relevant configs
Actions->>PCSX2 Repo: Rename and upload artifacts to draft release, publish the release
Actions->>Discord: Announce release via a WebHook
PCSX2 Repo->>Web API: POST webhook to API informing it that a new release has occurred
Web API->>Web API: Update cache with new release
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -1,47 +0,0 @@
@startuml
participant User as user
participant Github as github
participant "Create Release WF" as create
participant "Build WFs" as build
participant "Finalize Release WF" as finalize
participant Discord as discord
==Nightly Release==
user -> github : New Commit on master (from PR, or directly)
...waiting for commit push event to fire...
github -> create : Push a new git tag, patch incrementing latest Version
alt from-pr? case
create -> create : Use links to the PR as a description
else was a commit
create -> create : Use Commit Message as Description
end
create -> create : Generate release notes
create -> github : Create new draft release, associated with tag and with the notes
note right
Draft releases are not public facing, only those with write access can see them!
end note
...waiting for push tag event to fire...
loop for all build workflows
github -> build : Build the tag commit
build -> build : .exe will use the git tag for it's title and such
build -> build : Upload the generated artifact to the associated release
alt all-artifacts-uploaded? case
build -> github : Publish the release
user -> github : Can now download the artifacts on the published release
end
note right
This is the only area where an eventual consistency issue is apparent
It is because GitHub does not fire events for when draft releases are edited
This is glossed over in the initial impl and can be improved and be made eventually consistent as well
end note
...waiting for release publish event to fire...
github -> finalize : Announce the Release
finalize -> github : Gather all asset links, and format message embed.
finalize -> discord : Announce new build via a WebHook
...waiting for announcement...
user -> discord : Can download artifacts from links via the discord
@enduml

View File

@@ -0,0 +1,29 @@
name: 🏭 Update Controller Database
on:
schedule:
- cron: "0 16 * * 1" # every monday @ 12pm EST - https://crontab.guru/#0_16_*_*_1
jobs:
update-controller-db:
if: github.repository == 'PCSX2/pcsx2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Latest DB and Prepare DB File
run: |
cd .github/workflows/scripts/controller-db/
wget -O game_controller_db.txt https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
python ./update-db.py
mv ./game_controller_db.txt ${{github.workspace}}/bin/resources/game_controller_db.txt
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
title: "PAD: Update to latest controller database"
commit-message: "PAD: Update to latest controller database."
committer: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
author: "PCSX2 Bot <PCSX2Bot@users.noreply.github.com>"
body: "Weekly automatic update of SDL Controller DB"
reviewers: lightningterror

View File

@@ -1,27 +0,0 @@
name: 📝 Validate GameDB
on:
push:
branches:
- master
paths:
- '**/GameIndex.yaml'
pull_request:
branches:
- master
paths:
- '**/GameIndex.yaml'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Validate GameDB
env:
SCRIPT_DIR: .github/workflows/scripts/validation/lint-gamedb
run: |
pip install -r "${SCRIPT_DIR}/requirements.txt"
python "${SCRIPT_DIR}/lint-gamedb.py"

34
.github/workflows/lint_gamedb.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: 📝 Validate GameDB
on:
push:
branches:
- master
paths:
- '**/GameIndex.yaml'
pull_request:
branches:
- master
paths:
- '**/GameIndex.yaml'
jobs:
lint:
name: Lint and Validate GameDB
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Validate Contents
env:
GAMEDB_PATH: ./bin/resources/GameIndex.yaml
SCRIPT_DIR: .github/workflows/scripts/lint/gamedb
run: |
pip install -r "${SCRIPT_DIR}/requirements.txt"
python "${SCRIPT_DIR}/lint.py"
- name: Check Formatting
run: |
npm install -g prettier
prettier --check ./bin/resources/GameIndex.yaml

View File

@@ -1,207 +0,0 @@
name: 🐧 Linux Builds
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
paths-ignore:
- "**/*.md"
- "**/*.bat"
- "**/*.cmd"
- "**/*.props"
- "**/*.sln"
- ".clang-format"
- ".codacy.yaml"
- ".github/*"
- ".github/workflows/lint-gamedb.yml"
- ".github/workflows/macos-workflow.yml"
- ".github/workflows/pr-triage.yml"
- ".github/workflows/scripts/windows/**"
- ".github/workflows/scripts/validation/**"
- ".github/workflows/windows-workflow.yml"
- ".gitignore"
- "bin/PCSX2_keys.ini.default"
- "build.sh"
- "buildbot.xml"
- "pcsx2/CDVD/Windows/**"
- "pcsx2/DEV9/Win32/**"
- "pcsx2/PAD/Windows/**"
- "pcsx2/SPU2/Windows/**"
- "pcsx2/USB/Win32/**"
- "pcsx2/windows/**"
jobs:
build:
strategy:
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
platform: x86
compiler: gcc
cmakeflags: -DLTO_PCSX2_CORE=ON
appimage: true
experimental: false
- os: ubuntu-18.04
platform: x64
compiler: gcc
cmakeflags: -DLTO_PCSX2_CORE=ON
appimage: true
experimental: false
- os: ubuntu-18.04
platform: x86
compiler: clang
# Need to disable PCH until cmake 3.17
# (PCH conflicts with ccache, fixed by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4400)
cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
detail: " nopch"
appimage: false
experimental: false
- os: ubuntu-18.04
platform: x86
compiler: gcc
cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
detail: " nopch"
appimage: false
experimental: false
- os: ubuntu-18.04
platform: x86
compiler: gcc
cmakeflags: -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DARCH_FLAG=-march=haswell
detail: " avx2 nopch"
appimage: false
experimental: false
name: ${{ matrix.platform }} | ${{ matrix.compiler }}${{ matrix.detail }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 30
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 9
CCACHE_MAXSIZE: 100M
steps:
# NOTE - useful for debugging
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo "$GITHUB_CONTEXT"
# echo ${{ github.event.pull_request.title }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Checkout Submodules
if: steps.cache-submodules.outputs.cache-hit != 'true'
run: git submodule update --init --recursive -j $(getconf _NPROCESSORS_ONLN)
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2.1.6
with:
path: .ccache
key: ${{ matrix.os }} ${{ matrix.platform }} ${{ matrix.compiler }}${{ matrix.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ matrix.os }} ${{ matrix.platform }} ${{ matrix.compiler }}${{ matrix.detail }} ccache
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
run: |
ARCH=$([ "${{ matrix.platform }}" == x86 ] && echo "32bit" || echo "64bit")
ARTIFACT_NAME=""
if [ ${{ github.event_name }} == "pull_request" ]; then
PR_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
ARTIFACT_NAME="PCSX2-${ARCH}"
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
PR_NUM=${{ github.event.pull_request.number }}
ARTIFACT_NAME="${ARTIFACT_NAME}-pr[${PR_NUM}]"
fi
ARTIFACT_NAME="${ARTIFACT_NAME}-sha[${PR_SHA}]"
if [ ! -z "${{ github.event.pull_request.title }}" ]; then
PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr -cd '[a-zA-Z0-9[:space:]]_-')
ARTIFACT_NAME="${ARTIFACT_NAME}-title["${PR_TITLE}""
fi
else
SHA=$(git rev-parse --short "$GITHUB_SHA")
ARTIFACT_NAME="PCSX2-${ARCH}-sha[${SHA}"
fi
TRIMMED_ARTIFACT_NAME=$(printf "%.199s]" "$ARTIFACT_NAME")
echo "name=$TRIMMED_ARTIFACT_NAME"
echo "##[set-output name=name;]${TRIMMED_ARTIFACT_NAME}"
echo "##[set-output name=arch;]${ARCH}"
- name: Install Packages
env:
PLATFORM: ${{ matrix.platform }}
COMPILER: ${{ matrix.compiler }}
run: .github/workflows/scripts/linux/install-packages.sh
- name: Generate CMake
env:
PLATFORM: ${{ matrix.platform }}
COMPILER: ${{ matrix.compiler }}
ADDITIONAL_CMAKE_ARGS: ${{ matrix.cmakeflags }}
run: .github/workflows/scripts/linux/generate-cmake.sh
- name: Build PCSX2
working-directory: build
run: ../.github/workflows/scripts/linux/compile.sh
- name: Run Tests
working-directory: ./build
run: ninja unittests
- name: Package AppImage
if: matrix.appimage == true
env:
PLATFORM: ${{ matrix.platform }}
COMPILER: ${{ matrix.compiler }}
name: ${{ steps.artifact-metadata.outputs.name }}
run: .github/workflows/scripts/linux/appimage.sh
- name: Upload artifact
if: matrix.appimage == true
uses: actions/upload-artifact@v2
with:
name: ${{ steps.artifact-metadata.outputs.name }}
path: ci-artifacts
# ---- Release / Tagging related steps ----
- name: Prepare Build Artifacts
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.appimage == true
run: |
mv ./ci-artifacts/*.AppImage ./ci-artifacts/linux-AppImage-${{ steps.artifact-metadata.outputs.arch }}.AppImage
ls ./ci-artifacts/
- name: Upload Assets and Potential Publish Release
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.appimage == true
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts
ASSET_EXTENSION: AppImage
TAG_TO_SEARCH_FOR: ${{ github.REF }}
run: |
cd ./.github/workflows/scripts/releases/upload-release-artifacts
npm ci
node index.js

View File

@@ -0,0 +1,74 @@
name: 🐧 Linux Builds
on:
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
build_gcc_lto:
name: "GCC"
uses: ./.github/workflows/linux_build_wx.yml
with:
jobName: "with LTO"
compiler: gcc
cmakeflags: "-DLTO_PCSX2_CORE=ON"
buildAppImage: true
secrets: inherit
# (PCH conflicts with ccache, fixed by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4400)
build_gcc_nopch:
name: "GCC"
uses: ./.github/workflows/linux_build_wx.yml
with:
jobName: "No PCH"
compiler: gcc
cmakeflags: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON"
detail: " nopch"
secrets: inherit
build_gcc_nopch_avx2:
name: "GCC"
uses: ./.github/workflows/linux_build_wx.yml
with:
jobName: "AVX2 and No PCH"
compiler: gcc
cmakeflags: "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON -DARCH_FLAG=-march=haswell"
detail: " avx2 nopch"
secrets: inherit
build_clang_nopch:
name: "Clang"
uses: ./.github/workflows/linux_build_wx.yml
with:
jobName: "No PCH"
compiler: clang
cmakeflags: ""
detail: " nopch"
secrets: inherit
build_linux_qt_sse4:
name: "AppImage"
uses: ./.github/workflows/linux_build_qt.yml
with:
jobName: "Qt SSE4"
compiler: clang
cmakeflags: ""
simd: "SSE4"
buildAppImage: true
secrets: inherit
build_linux_qt_avx2:
name: "AppImage"
uses: ./.github/workflows/linux_build_qt.yml
with:
jobName: "Qt AVX2"
detail: ""
compiler: clang
cmakeflags: "-DARCH_FLAG=-march=haswell"
simd: "AVX2"
buildAppImage: true
secrets: inherit

129
.github/workflows/linux_build_qt.yml vendored Normal file
View File

@@ -0,0 +1,129 @@
name: Linux Build Steps
on:
workflow_call:
inputs:
jobName:
required: true
type: string
os:
required: false
type: string
default: ubuntu-20.04
platform:
required: false
type: string
default: x64
compiler:
required: true
type: string
cmakeflags:
required: true
type: string
buildAppImage:
required: false
type: boolean
default: false
detail:
required: false
type: string
default: ""
simd:
required: false
type: string
default: ""
jobs:
build_linux:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 60
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 9
CCACHE_MAXSIZE: 100M
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
env:
OS: linux
GUI_FRAMEWORK: QT
ARCH: ${{ inputs.platform }}
SIMD: ${{ inputs.simd }}
EVENT_NAME: ${{ github.event_name }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v3
with:
path: .ccache
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.simd }} ${{ inputs.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }} ${{ inputs.simd }} ${{ inputs.detail }} ccache
- name: Install Packages
env:
COMPILER: ${{ inputs.compiler }}
run: .github/workflows/scripts/linux/install-packages-qt.sh
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ~/deps
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} deps ${{ hashFiles('.github/workflows/scripts/linux/build-dependencies-qt.sh') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: .github/workflows/scripts/linux/build-dependencies-qt.sh
- name: Generate CMake
env:
COMPILER: ${{ inputs.compiler }}
ADDITIONAL_CMAKE_ARGS: ${{ inputs.cmakeflags }}
run: .github/workflows/scripts/linux/generate-cmake-qt.sh
- name: Build PCSX2
working-directory: build
run: ../.github/workflows/scripts/linux/compile.sh
- name: Run Tests
working-directory: ./build
run: ninja unittests
- name: Package AppImage
if: inputs.buildAppImage == true
env:
NAME: ${{ steps.artifact-metadata.outputs.artifact-name }}
run: |
ninja -C build install
.github/workflows/scripts/linux/appimage-qt.sh "$(realpath .)" "$HOME/deps" "$NAME"
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
mv "${NAME}.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts/
- name: Upload artifact
if: inputs.buildAppImage == true
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
path: ci-artifacts

146
.github/workflows/linux_build_wx.yml vendored Normal file
View File

@@ -0,0 +1,146 @@
name: Linux Build Steps
on:
workflow_call:
inputs:
jobName:
required: true
type: string
os:
required: false
type: string
default: ubuntu-18.04
platform:
required: false
type: string
default: x64
compiler:
required: true
type: string
cmakeflags:
required: true
type: string
buildAppImage:
required: false
type: boolean
default: false
detail:
required: false
type: string
default: ""
jobs:
build_linux:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 60
env:
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 9
CCACHE_MAXSIZE: 100M
SDL: SDL2-2.0.22
PATCHELF_VERSION: 0.12
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
env:
OS: linux
GUI_FRAMEWORK: wxWidgets
ARCH: ${{ inputs.platform }}
SIMD: ''
EVENT_NAME: ${{ github.event_name }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh
# -- SETUP CCACHE - https://cristianadam.eu/20200113/speeding-up-c-plus-plus-github-actions-using-ccache/
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v3
with:
path: .ccache
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }}${{ inputs.detail }} ccache ${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.compiler }}${{ inputs.detail }} ccache
- name: Install Packages
env:
PLATFORM: ${{ inputs.platform }}
COMPILER: ${{ inputs.compiler }}
run: .github/workflows/scripts/linux/install-packages.sh
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: |
3rdparty/${{ env.SDL }}
3rdparty/patchelf-${{ env.PATCHELF_VERSION }}
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ env.SDL }} patchelf-${{ env.PATCHELF_VERSION }}
- name: Build Dependencies
run: |
if [[ ! -e 3rdparty/patchelf-${{ env.PATCHELF_VERSION }} ]]; then
curl -sSfL https://github.com/NixOS/patchelf/releases/download/${{ env.PATCHELF_VERSION }}/patchelf-${{ env.PATCHELF_VERSION }}.tar.bz2 | tar -xjC 3rdparty
mv 3rdparty/patchelf-${{ env.PATCHELF_VERSION }}* 3rdparty/patchelf-${{ env.PATCHELF_VERSION }}
cd 3rdparty/patchelf-${{ env.PATCHELF_VERSION }}
./configure
make && cd ../../
fi
sudo make -C 3rdparty/patchelf-${{ env.PATCHELF_VERSION }} install
if [[ ! -e 3rdparty/${{ env.SDL }} ]]; then
curl -sL https://libsdl.org/release/${{ env.SDL }}.tar.gz | tar -xzC 3rdparty
cd 3rdparty/${{ env.SDL }}
if [ "${{ inputs.platform }}" == "x86" ]; then
./configure --build=i686-pc-linux-gnu CC=${{ inputs.compiler }} CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 --prefix=/usr --libdir=/usr/lib/i386-linux-gnu
else
./configure --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu
fi
make -j $(getconf _NPROCESSORS_ONLN) && cd ../../
fi
sudo make -C 3rdparty/${{ env.SDL }} install
- name: Generate CMake
env:
PLATFORM: ${{ inputs.platform }}
COMPILER: ${{ inputs.compiler }}
ADDITIONAL_CMAKE_ARGS: ${{ inputs.cmakeflags }}
run: .github/workflows/scripts/linux/generate-cmake.sh
- name: Build PCSX2
working-directory: build
run: ../.github/workflows/scripts/linux/compile.sh
- name: Run Tests
working-directory: ./build
run: ninja unittests
- name: Package AppImage
if: inputs.buildAppImage == true
env:
PLATFORM: ${{ inputs.platform }}
COMPILER: ${{ inputs.compiler }}
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
run: .github/workflows/scripts/linux/appimage.sh
- name: Upload artifact
if: inputs.buildAppImage == true
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
path: ci-artifacts

View File

@@ -1,118 +0,0 @@
name: 🍎 MacOS Builds
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/*.bat'
- '**/*.cmd'
- '**/*.props'
- '**/*.sln'
- '.clang-format'
- '.codacy.yaml'
- '.github/*'
- '.github/workflows/lint-gamedb.yml'
- '.github/workflows/linux-workflow.yml'
- '.github/workflows/pr-triage.yml'
- '.github/workflows/scripts/windows/**'
- '.github/workflows/scripts/validation/**'
- '.github/workflows/windows-workflow.yml'
- '.gitignore'
- 'bin/PCSX2_keys.ini.default'
- 'build.sh'
- 'buildbot.xml'
- 'pcsx2/CDVD/Windows/**'
- 'pcsx2/DEV9/Win32/**'
- 'pcsx2/PAD/Windows/**'
- 'pcsx2/SPU2/Windows/**'
- 'pcsx2/USB/Win32/**'
- 'pcsx2/windows/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/*.bat'
- '**/*.cmd'
- '**/*.props'
- '**/*.sln'
- '.clang-format'
- '.codacy.yaml'
- '.github/*'
- '.github/workflows/lint-gamedb.yml'
- '.github/workflows/linux-workflow.yml'
- '.github/workflows/pr-triage.yml'
- '.github/workflows/scripts/windows/**'
- '.github/workflows/scripts/validation/**'
- '.github/workflows/windows-workflow.yml'
- '.gitignore'
- 'bin/PCSX2_keys.ini.default'
- 'build.sh'
- 'buildbot.xml'
- 'pcsx2/CDVD/Windows/**'
- 'pcsx2/DEV9/Win32/**'
- 'pcsx2/PAD/Windows/**'
- 'pcsx2/SPU2/Windows/**'
- 'pcsx2/USB/Win32/**'
- 'pcsx2/windows/**'
jobs:
build:
strategy:
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
fail-fast: false
matrix:
os: [macos-11.0]
platform: [x64]
experimental: [false]
name: ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 30
steps:
# NOTE - useful for debugging
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo "$GITHUB_CONTEXT"
# echo ${{ github.event.pull_request.title }}
- name: Checkout Repository
uses: actions/checkout@v2
- name: Checkout Submodules
run: git submodule update --init --recursive -j $(getconf _NPROCESSORS_ONLN)
- name: Install Packages
env:
PLATFORM: ${{ matrix.platform }}
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ANALYTICS: 1
run: |
# To save time, only brew update if running the install without it fails
function do-install() {
brew install sound-touch portaudio wxmac gtk+3 sdl2 libsamplerate
}
if ! do-install; then
brew update
do-install
fi
- name: Generate CMake Files
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_PO=FALSE -DLTO_PCSX2_CORE=ON -B build .
- name: Build PCSX2
working-directory: build
run: make -j$(getconf _NPROCESSORS_ONLN) # macOS doesn't use make install
- name: Run Tests
working-directory: build
run: make -j$(getconf _NPROCESSORS_ONLN) unittests

112
.github/workflows/macos_build.yml vendored Normal file
View File

@@ -0,0 +1,112 @@
name: MacOS Build Steps
on:
workflow_call:
inputs:
jobName:
required: true
type: string
os:
required: false
type: string
default: macos-11.0
platform:
required: false
type: string
default: x64
gui:
required: true
type: string
jobs:
build_macos:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 90
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_COMPRESS_LEVEL: 9
BUILDCACHE_MAX_CACHE_SIZE: 536870912 # 512MB
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_LOG_FILE: ${{ github.workspace }}\buildcache.log
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
env:
OS: macos
GUI_FRAMEWORK: ${{ inputs.gui }}
ARCH: ${{ inputs.platform }}
SIMD: ''
EVENT_NAME: ${{ github.event_name }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh
- name: Install Packages
env:
PLATFORM: ${{ inputs.platform }}
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_ANALYTICS: 1
run: |
brew unlink libjpeg libpng # Conflicts with our self-built dependencies
# Unlike other packages, brew's MoltenVK build uses MoltenVK's minimum macOS version of 10.13 so we can use it
if ! brew install molten-vk; then
brew update
brew install molten-vk
fi
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ~/deps
key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.gui }} deps ${{ hashFiles('.github/workflows/scripts/macos/build-dependencies.sh') }}
- name: Build Dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
env:
GUI: ${{ inputs.gui }}
run: .github/workflows/scripts/macos/build-dependencies.sh
- name: Generate CMake Files
run: |
QT_BUILD=$([ "${{ inputs.gui }}" == "Qt" ] && echo "ON" || echo "OFF")
cmake -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_BUILD_TYPE=Release -DQT_BUILD="$QT_BUILD" -DUSE_OPENGL=OFF -DDISABLE_ADVANCE_SIMD=ON -DLTO_PCSX2_CORE=ON -DUSE_SYSTEM_LIBS=OFF -DUSE_SYSTEM_SDL2=ON -B build .
- name: Build PCSX2
working-directory: build
run: make -j$(getconf _NPROCESSORS_ONLN) # macOS doesn't use make install
- name: Run Tests
working-directory: build
run: make -j$(getconf _NPROCESSORS_ONLN) unittests
- name: Prepare Build Artifacts
run: |
cp /usr/local/lib/libMoltenVK.dylib build/pcsx2*/PCSX2.app/Contents/Frameworks/
TAG="$(git tag --points-at HEAD)"
if [ -z "$TAG" ]; then
APPNAME="${{ steps.artifact-metadata.outputs.artifact-name }}"
else
APPNAME="PCSX2-$TAG"
fi
mv build/pcsx2*/PCSX2.app "$APPNAME.app"
tar cvzf "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.gz" "$APPNAME.app"
mkdir ci-artifacts
cp "${{ steps.artifact-metadata.outputs.artifact-name }}.tar.gz" ci-artifacts/macOS-${{ inputs.gui }}.tar.gz
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
path: "*.tar.gz"

View File

@@ -0,0 +1,25 @@
name: 🍎 MacOS Builds
on:
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
build_macos_wx:
name: "Defaults"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "wxWidgets"
gui: "wxWidgets"
secrets: inherit
build_macos_qt:
name: "Defaults"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "Qt"
gui: "Qt"
secrets: inherit

View File

@@ -9,9 +9,9 @@ jobs:
if: github.repository == 'PCSX2/pcsx2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: 16

View File

@@ -25,23 +25,34 @@ jobs:
cut-release:
if: github.repository == 'PCSX2/pcsx2'
runs-on: ubuntu-latest
name: "Create Tag and Release"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Docs - https://github.com/mathieudutour/github-tag-action
# Workflows cannot trigger other workflows implicitly
# - https://github.community/t/github-actions-workflow-not-triggering-with-tag-push/17053/7
- name: Bump Version and Push Tag
id: tag_version
uses: mathieudutour/github-tag-action@v5.6
uses: mathieudutour/github-tag-action@v6.0
with:
# Workflows cannot trigger other workflows implicitly
# - https://github.community/t/github-actions-workflow-not-triggering-with-tag-push/17053/7
github_token: ${{ secrets.BOT_PAT }}
tag_prefix: v
default_bump: patch
# Generate the Release Notes
# TODO - we could do this and remove the node.js script, but auto-generated notes only work
# with PRs -- not commits (determine how much we care).
# - name: Create Draft Release
# env:
# GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
# run: |
# echo "Creating release with tag - ${{ steps.tag_version.outputs.new_tag }}"
# gh release create ${{ steps.tag_version.outputs.new_tag }} --draft --generate-notes -title ${{ steps.tag_version.outputs.new_tag }}
- name: Generate Release Notes
env:
OWNER: PCSX2
REPO: pcsx2
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_SHA: ${{ github.SHA }}
run: |
@@ -49,9 +60,7 @@ jobs:
npm ci
node index.js
mv ./release-notes.md ${GITHUB_WORKSPACE}/release-notes.md
ls
# Docs - https://github.com/softprops/action-gh-release
- name: Create a GitHub Release
uses: softprops/action-gh-release@v1
if: steps.tag_version.outputs.new_tag

162
.github/workflows/release_pipeline.yml vendored Normal file
View File

@@ -0,0 +1,162 @@
name: 🏭 Release Pipeline
on:
push:
tags:
- v*
jobs:
# Build Everything
# Linux
build_gcc_lto:
if: github.repository == 'PCSX2/pcsx2'
name: "Linux - AppImage"
uses: ./.github/workflows/linux_build_wx.yml
with:
jobName: "wxWidgets"
compiler: gcc
cmakeflags: "-DLTO_PCSX2_CORE=ON"
buildAppImage: true
secrets: inherit
build_linux_qt_sse4:
if: github.repository == 'PCSX2/pcsx2'
name: "Linux - AppImage SSE4"
uses: ./.github/workflows/linux_build_qt.yml
with:
jobName: "Qt"
compiler: clang
cmakeflags: ""
simd: "SSE4"
buildAppImage: true
secrets: inherit
build_linux_qt_avx2:
if: github.repository == 'PCSX2/pcsx2'
name: "Linux - AppImage AVX2"
uses: ./.github/workflows/linux_build_qt.yml
with:
jobName: "Qt"
detail: ""
compiler: clang
cmakeflags: "-DARCH_FLAG=-march=haswell"
simd: "AVX2"
buildAppImage: true
secrets: inherit
# Windows
build_wx_sse4:
if: github.repository == 'PCSX2/pcsx2'
name: "Windows - SSE4"
uses: ./.github/workflows/windows_build_wx.yml
with:
jobName: wxWidgets
configuration: Release
simd: "SSE4"
secrets: inherit
build_wx_avx2:
if: github.repository == 'PCSX2/pcsx2'
name: "Windows - AVX2"
uses: ./.github/workflows/windows_build_wx.yml
with:
jobName: wxWidgets
configuration: Release AVX2
secrets: inherit
build_qt_sse4:
if: github.repository == 'PCSX2/pcsx2'
name: "Windows - SSE4"
uses: ./.github/workflows/windows_build_qt.yml
with:
jobName: Qt
configuration: Release
simd: "SSE4"
secrets: inherit
build_qt_avx2:
if: github.repository == 'PCSX2/pcsx2'
name: "Windows - AVX2"
uses: ./.github/workflows/windows_build_qt.yml
with:
jobName: Qt
configuration: Release AVX2
secrets: inherit
# MacOS
build_macos_wx:
if: github.repository == 'PCSX2/pcsx2'
name: "MacOS"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "wxWidgets"
gui: "wxWidgets"
secrets: inherit
build_macos_qt:
if: github.repository == 'PCSX2/pcsx2'
name: "MacOS"
uses: ./.github/workflows/macos_build.yml
with:
jobName: "Qt"
gui: "Qt"
secrets: inherit
# Upload the Artifacts
upload_artifacts:
if: github.repository == 'PCSX2/pcsx2'
needs:
- build_gcc_lto
- build_linux_qt_sse4
- build_linux_qt_avx2
- build_wx_sse4
- build_wx_avx2
- build_qt_sse4
- build_qt_avx2
- build_macos_wx
- build_macos_qt
name: "Upload Artifacts"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare Artifact Folder
run: mkdir ./ci-artifacts/
- uses: actions/download-artifact@v3
name: Download all Artifacts
with:
path: ./ci-artifacts/
- name: Display structure of downloaded files
run: ls ./ci-artifacts/
# Prepare artifacts, they are all zips from github!
- name: Prepare Artifacts
working-directory: ./ci-artifacts/
run: for d in *windows*/; do 7z a "${d}asset.7z" ./$d/*; done
# Artifact Naming:
# MacOS: PCSX2-<tag>-macOS-[additional hyphen seperated tags]
# Windows|Linux: PCSX2-<tag>-<windows|linux>-<32bit|64bit>--[additional hyphen seperated tags]
- name: Name and Upload the Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.REF }}
SCAN_DIR: ${{ github.WORKSPACE }}/ci-artifacts
OUT_DIR: ${{ github.WORKSPACE }}/ci-artifacts/out
run: |
gh release list --repo PCSX2/pcsx2
mkdir -p ${{ github.WORKSPACE }}/ci-artifacts/out
python ./.github/workflows/scripts/releases/rename-release-assets.py
ls ${{ github.WORKSPACE }}/ci-artifacts/out
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/out/* --repo PCSX2/pcsx2 --clobber
- name: Publish Release
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
run: |
TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}')
gh release edit ${TAG_VAL} --draft=false --repo PCSX2/pcsx2

View File

@@ -0,0 +1,57 @@
#!/bin/bash
# Artifact Naming Scheme:
# PCSX2-<OS>-<GUI>-[ARCH]-[SIMD]-[pr\[PR_NUM\]]-[title|sha\[SHA|PR_TITLE\]
# -- limited to 200 chars
# Outputs:
# - artifact-name
# Inputs as env-vars
# OS
# BUILD_SYSTEM
# GUI_FRAMEWORK
# ARCH
# SIMD
# EVENT_NAME
# PR_TITLE
# PR_NUM
# PR_SHA
NAME=""
if [ "${OS}" == "macos" ]; then
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}"
elif [[ "${OS}" == "windows" || ("$OS" == "linux" && "$GUI_FRAMEWORK" == "QT") ]]; then
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}-${ARCH}-${SIMD}"
else
NAME="PCSX2-${OS}-${GUI_FRAMEWORK}-${ARCH}"
fi
# Add cmake if used to differentate it from msbuild builds
# Else the two artifacts will have the same name and the files will be merged
if [[ ! -z "${BUILD_SYSTEM}" ]]; then
if [ "${BUILD_SYSTEM}" == "cmake" ]; then
NAME="${NAME}-${BUILD_SYSTEM}"
fi
fi
# Add PR / Commit Metadata
if [ "$EVENT_NAME" == "pull_request" ]; then
PR_SHA=$(git rev-parse --short "${PR_SHA}")
if [ ! -z "${PR_NUM}" ]; then
NAME="${NAME}-pr[${PR_NUM}]"
fi
NAME="${NAME}-sha[${PR_SHA}]"
if [ ! -z "${PR_TITLE}" ]; then
PR_TITLE=$(echo "${PR_TITLE}" | tr -cd '[a-zA-Z0-9[:space:]]_-')
NAME="${NAME}-title[${PR_TITLE}"
fi
else
SHA=$(git rev-parse --short "$GITHUB_SHA")
NAME="${NAME}-sha[${SHA}"
fi
# Trim the Name
NAME=$(printf "%.199s]" "$NAME")
echo "${NAME}"
echo "##[set-output name=artifact-name;]${NAME}"

View File

@@ -0,0 +1 @@
*.txt

View File

@@ -0,0 +1,39 @@
import os
relevant_categories = [
"# Windows",
"# Mac OS X",
"# Linux"
]
header_lines = []
new_db_contents = []
def is_relevant_category(line):
for category in relevant_categories:
if category in line:
return True
return False
with open("./game_controller_db.txt") as file:
lines = file.readlines()
finished_header = False
processing_section = False
for line in lines:
if finished_header is False:
header_lines.append(line)
if line == "\n":
finished_header = True
if processing_section and line == "\n":
processing_section = False
new_db_contents.append("\n")
if is_relevant_category(line) and processing_section is False:
processing_section = True
new_db_contents.append(line)
elif processing_section:
new_db_contents.append(line)
os.remove("./game_controller_db.txt")
with open("./game_controller_db.txt", "w") as f:
f.writelines(header_lines)
f.writelines(new_db_contents)

View File

@@ -1,7 +1,8 @@
import os
import yaml
# Assumes this is ran from the root of the repository
file_path = "./bin/GameIndex.yaml"
file_path = os.environ['GAMEDB_PATH']
# These settings have to be manually kept in sync with the emulator code unfortunately.
# up to date validation should ALWAYS be provided via the application!
@@ -12,6 +13,7 @@ allowed_game_options = [
"roundModes",
"clampModes",
"gameFixes",
"gsHWFixes",
"speedHacks",
"memcardFilters",
"patches",
@@ -19,24 +21,59 @@ allowed_game_options = [
allowed_round_modes = ["eeRoundMode", "vuRoundMode"]
allowed_clamp_modes = ["eeClampMode", "vuClampMode"]
allowed_game_fixes = [
"VuAddSubHack",
"FpuCompareHack",
"FpuMulHack",
"FpuNegDivHack",
"XGKickHack",
"EETimingHack",
"GoemonTlbHack",
"SoftwareRendererFMVHack",
"SkipMPEGHack",
"OPHFlagHack",
"EETimingHack",
"DMABusyHack",
"GIFFIFOHack",
"VIFFIFOHack",
"VIF1StallHack",
"GIFFIFOHack",
"GoemonTlbHack",
"VUKickstartHack",
"VuAddSubHack",
"IbitHack",
"VUSyncHack",
"VUOverflowHack",
"XGKickHack",
"BlitInternalFPSHack",
]
allowed_speed_hacks = ["mvuFlagSpeedHack", "InstantVU1SpeedHack"]
allowed_gs_hw_fixes = [
"autoFlush",
"conservativeFramebuffer",
"cpuFramebufferConversion",
"disableDepthSupport",
"wrapGSMem",
"preloadFrameData",
"disablePartialInvalidation",
"textureInsideRT",
"alignSprite",
"mergeSprite",
"wildArmsHack",
"pointListPalette",
"mipmap",
"trilinearFiltering",
"skipDrawStart",
"skipDrawEnd",
"halfBottomOverride",
"halfPixelOffset",
"roundSprite",
"texturePreloading",
"deinterlace",
"cpuSpriteRenderBW",
]
gs_hw_fix_ranges = {
"mipmap": (0, 2),
"trilinearFiltering": (0, 2),
"skipDrawStart": (0, 100000),
"skipDrawEnd": (0, 100000),
"halfPixelOffset": (0, 3),
"roundSprite": (0, 2),
"deinterlace": (0, 7),
"cpuSpriteRenderBW": (1, 10),
}
allowed_speed_hacks = ["mvuFlagSpeedHack", "InstantVU1SpeedHack", "MTVUSpeedHack"]
# Patches are allowed to have a 'default' key or a crc-32 key, followed by
allowed_patch_options = ["author", "content"]
@@ -94,6 +131,29 @@ def validate_game_fixes(serial, key, value):
validate_valid_options(serial, key, gamefix, allowed_game_fixes)
def validate_gs_hw_fix_value(serial, key, value):
low, high = 0, 1
if key in gs_hw_fix_ranges:
low, high = gs_hw_fix_ranges[key]
validate_int_option(serial, key, value, low, high)
def validate_gs_hw_fixes(serial, key, value):
if not isinstance(value, dict):
issue_list.append("[{}]: 'gsHWFixes' must be a valid object".format(serial))
return
for fix, fix_value in value.items():
validate_valid_options(serial, key, fix, allowed_gs_hw_fixes)
validate_gs_hw_fix_value(serial, fix, fix_value)
# skipdraw range must have end >= start
skip_draw_start = value["skipDrawStart"] if "skipDrawStart" in value else 0
skip_draw_end = value["skipDrawEnd"] if "skipDrawEnd" in value else 0
if isinstance(skip_draw_start, int) and isinstance(skip_draw_end, int) and skip_draw_end < skip_draw_start:
issue_list.append("[{}]: skipDrawStart({}) must be greater or equal to skipDrawEnd({})".format(
serial, skip_draw_start, skip_draw_end))
def validate_speed_hacks(serial, key, value):
if not isinstance(value, dict):
issue_list.append("[{}]: 'speedHacks' must be a valid object".format(serial))
@@ -145,6 +205,7 @@ option_validation_handlers = {
)
),
"gameFixes": (lambda serial, key, value: validate_game_fixes(serial, key, value)),
"gsHWFixes": (lambda serial, key, value: validate_gs_hw_fixes(serial, key, value)),
"speedHacks": (lambda serial, key, value: validate_speed_hacks(serial, key, value)),
"memcardFilters": (
lambda serial, key, value: validate_list_of_strings(serial, key, value)
@@ -152,11 +213,21 @@ option_validation_handlers = {
"patches": (lambda serial, key, value: validate_patches(serial, key, value)),
}
class UniqueKeyLoader(yaml.FullLoader):
def construct_mapping(self, node, deep=False):
mapping = set()
for key_node, _ in node.value:
key = self.construct_object(key_node, deep=deep)
if key in mapping:
raise ValueError(f"Duplicate {key!r} key found in YAML.")
mapping.add(key)
return super().construct_mapping(node, deep)
print("Opening {}...".format(file_path))
with open(file_path) as f:
with open(file_path, encoding="utf-8") as f:
try:
print("Attempting to parse GameDB file...")
gamedb = yaml.load(f, Loader=yaml.FullLoader)
gamedb = yaml.load(f, Loader=UniqueKeyLoader)
except Exception as err:
print(err)
print(

View File

@@ -1,15 +1,3 @@
#!/bin/bash
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
BINARY_NAME=$(basename "$ARGV0")
if [[ ! -e "$PWD/$BINARY_NAME.config" ]]; then
mkdir "$PWD/$BINARY_NAME.config"
fi
export XDG_CONFIG_HOME="$PWD/$BINARY_NAME.config"
ln -sf $APPDIR/usr/bin/app /tmp/PCSX2
mkdir -p $HOME/.local/share/icons/hicolor/scalable/apps && cp $APPDIR/PCSX2.png $HOME/.local/share/icons/hicolor/scalable/apps
$APPDIR/AppRun-patched
unlink /tmp/PCSX2
$APPDIR/AppRun-patched "$@"

4
.github/workflows/scripts/linux/AppRun-qt vendored Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
cd "$(dirname "$0")"
exec ./usr/bin/pcsx2-qt "$@"

View File

@@ -0,0 +1,16 @@
#!/bin/bash
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
# use system wayland if available otherwise use the appimage provided wayland
if [[ $(ldconfig -p | grep libwayland-client | wc -l) -lt 1 ]]; then
export LD_LIBRARY_PATH="$APPDIR/usr/lib/wayland:$LD_LIBRARY_PATH"
fi
export BINARY_NAME=$(basename "$ARGV0")
if [[ ! -e "$PWD/$BINARY_NAME.config" ]]; then
mkdir "$PWD/$BINARY_NAME.config"
fi
export XDG_CONFIG_HOME="$PWD/$BINARY_NAME.config"
mkdir -p "$HOME"/.local/share/icons/hicolor/scalable/apps && cp "$APPDIR"/PCSX2.png "$HOME"/.local/share/icons/hicolor/scalable/apps

253
.github/workflows/scripts/linux/appimage-qt.sh vendored Executable file
View File

@@ -0,0 +1,253 @@
#!/usr/bin/env bash
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# For more information, please refer to <http://unlicense.org/>
if [ "$#" -ne 3 ]; then
echo "Syntax: $0 <path to PCSX2 directory> <deps prefix> <output name>"
exit 1
fi
PCSX2DIR=$1
DEPSDIR=$2
NAME=$3
BINDIR="$PCSX2DIR/bin"
BINARY=pcsx2-qt
APPDIRNAME=PCSX2.AppDir
STRIP=llvm-strip-12
declare -a SYSLIBS=(
"libaio.so.1"
"libz.so.1"
"libuuid.so.1"
"libapparmor.so.1"
"libblkid.so.1"
"libbsd.so.0"
"libdbus-1.so.3"
"libgcrypt.so.20"
"liblzma.so.5"
"libmount.so.1"
"libnsl.so.1"
"libpcre.so.3"
"libselinux.so.1"
"libsystemd.so.0"
"libudev.so.1"
"libwrap.so.0"
"libharfbuzz.so.0"
"libFLAC.so.8"
"libSoundTouch.so.1"
"libXau.so.6"
"libXcomposite.so.1"
"libXcursor.so.1"
"libXdamage.so.1"
"libXdmcp.so.6"
"libXext.so.6"
"libXfixes.so.3"
"libXi.so.6"
"libXinerama.so.1"
"libXrandr.so.2"
"libXrender.so.1"
"libXxf86vm.so.1"
"libasyncns.so.0"
"libcrypto.so.1.1"
"libjpeg.so.8"
"liblz4.so.1"
"libogg.so.0"
"libpcap.so.0.8"
"libpng16.so.16"
"libpulse.so.0"
"libsamplerate.so.0"
"libsndfile.so.1"
"libvorbis.so.0"
"libvorbisenc.so.2"
"libxcb.so.1"
"libxcb-render.so.0"
"libxcb-shm.so.0"
"libxkbcommon.so.0"
"libxkbcommon-x11.so.0"
"pulseaudio/libpulsecommon-13.99.so"
"libfreetype.so.6"
"libpcre2-16.so.0"
"libexpat.so.1"
"libffi.so.7"
"libgraphite2.so.3"
"libresolv.so.2"
"libgpg-error.so.0"
"libpcre2-16.so.0"
"libpng16.so.16"
"libxcb-icccm.so.4"
"libxcb-image.so.0"
"libxcb-keysyms.so.1"
"libxcb-randr.so.0"
"libxcb-render.so.0"
"libxcb-render-util.so.0"
"libxcb-shape.so.0"
"libxcb-sync.so.1"
"libxcb-util.so.1"
"libxcb-xfixes.so.0"
"libxcb-xkb.so.1"
"libevdev.so.2"
"libgudev-1.0.so.0"
"libinput.so.10"
"libjpeg.so.8"
"libmtdev.so.1"
"libpng16.so.16"
"libudev.so.1"
"libuuid.so.1"
)
declare -a DEPLIBS=(
"libSDL2-2.0.so.0"
)
declare -a QTLIBS=(
"libQt6Core.so.6"
"libQt6Gui.so.6"
"libQt6Network.so.6"
"libQt6OpenGL.so.6"
"libQt6Svg.so.6"
"libQt6WaylandClient.so.6"
"libQt6WaylandCompositor.so.6"
"libQt6WaylandEglClientHwIntegration.so.6"
"libQt6WaylandEglCompositorHwIntegration.so.6"
"libQt6Widgets.so.6"
"libQt6XcbQpa.so.6"
)
declare -a QTPLUGINS=(
"plugins/iconengines"
"plugins/imageformats"
"plugins/platforms"
#"plugins/platformthemes" # Enable this if we want to ship GTK+ themes at any point.
"plugins/wayland-decoration-client"
"plugins/wayland-graphics-integration-client"
"plugins/wayland-graphics-integration-server"
"plugins/wayland-shell-integration"
"plugins/xcbglintegrations"
)
set -e
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
OUTDIR=$(realpath "./$APPDIRNAME")
SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}")
rm -fr "$OUTDIR"
mkdir "$OUTDIR"
mkdir -p "$OUTDIR/usr/bin" "$OUTDIR/usr/lib" "$OUTDIR/usr/lib/pulseaudio"
echo "Copying binary and resources..."
cp -a "$BINDIR/$BINARY" "$BINDIR/resources" "$BINDIR/shaders" "$OUTDIR/usr/bin"
# Don't need old wx locales.
rm -fr "$OUTDIR/usr/bin/resources/locale"
# Patch RPATH so the binary goes hunting for shared libraries in the AppDir instead of system.
echo "Patching RPATH in ${BINARY}..."
patchelf --set-rpath '$ORIGIN/../lib' "$OUTDIR/usr/bin/$BINARY"
# Currently we leave the main binary unstripped, uncomment if this is not desired.
#$STRIP "$OUTDIR/usr/bin/$BINARY"
# Libraries we pull in from the system.
echo "Copying system libraries..."
for lib in "${SYSLIBS[@]}"; do
blib=$(basename "$lib")
if [ -f "/lib/x86_64-linux-gnu/$lib" ]; then
cp "/lib/x86_64-linux-gnu/$lib" "$OUTDIR/usr/lib/$blib"
elif [ -f "$CHROOT/usr/lib/x86_64-linux-gnu/$lib" ]; then
cp "$CHROOT/usr/lib/x86_64-linux-gnu/$lib" "$OUTDIR/usr/lib/$blib"
elif [ -f "$CHROOT/lib/$lib" ]; then
cp "$CHROOT/lib/$lib" "$OUTDIR/usr/lib/$blib"
elif [ -f "$CHROOT/usr/lib/$lib" ]; then
cp "$CHROOT/usr/lib/$lib" "$OUTDIR/usr/lib/$blib"
else
echo "*** Failed to find '$blib'"
exit 1
fi
$STRIP "$OUTDIR/usr/lib/$blib"
done
# Dependencies we built, at this point it's just SDL.
echo "Copying dependency libraries..."
for lib in "${DEPLIBS[@]}"; do
blib=$(basename "$lib")
if [ -f "$DEPSDIR/lib/$lib" ]; then
cp "$DEPSDIR/lib/$lib" "$OUTDIR/usr/lib/$blib"
else
echo "*** Failed to find '$blib'"
exit 1
fi
$STRIP "$OUTDIR/usr/lib/$blib"
done
echo "Copying Qt libraries..."
for lib in "${QTLIBS[@]}"; do
cp -aL "$DEPSDIR/lib/$lib" "$OUTDIR/usr/lib"
$STRIP "$OUTDIR/usr/lib/$lib"
done
echo "Copying Qt plugins..."
mkdir -p "$OUTDIR/usr/lib/plugins"
for plugin in "${QTPLUGINS[@]}"; do
mkdir -p "$OUTDIR/usr/lib/$plugin"
cp -aL "$DEPSDIR/$plugin"/*.so "$OUTDIR/usr/lib/$plugin/"
done
for so in $(find "$OUTDIR/usr/lib/plugins" -iname '*.so'); do
# This is ../../ because it's usually plugins/group/name.so
echo "Patching RPATH in ${so}..."
patchelf --set-rpath '$ORIGIN/../..' "$so"
$STRIP "$so"
done
for so in $(find "$OUTDIR/usr/lib" -maxdepth 1); do
if [ -f "$so" ]; then
echo "Patching RPATH in ${so}"
patchelf --set-rpath '$ORIGIN' "$so"
fi
done
echo "Creating qt.conf..."
cat > "$OUTDIR/usr/bin/qt.conf" << EOF
[Paths]
Plugins = ../lib/plugins
EOF
echo "Copy desktop/icon..."
cp "$PCSX2DIR/pcsx2/gui/Resources/AppIcon64.png" "$OUTDIR/PCSX2.png"
cp "$SCRIPTDIR/pcsx2-qt.desktop" "$OUTDIR/PCSX2.desktop"
cp "$SCRIPTDIR/AppRun-qt" "$OUTDIR/AppRun"
echo "Generate AppImage"
./appimagetool-x86_64.AppImage -v "$OUTDIR" "$NAME.AppImage"

View File

@@ -12,8 +12,6 @@ else
ARCH="x86_64"
LIBARCH="x86_64-linux-gnu"
fi
BUILDPATH="$GITHUB_WORKSPACE"/build
BUILDBIN="$BUILDPATH"/pcsx2
cd /tmp
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage"
chmod a+x linuxdeploy*.AppImage
@@ -23,10 +21,7 @@ chmod a+x /tmp/squashfs-root/usr/bin/linuxdeploy-plugin-gtk.sh
mv /tmp/squashfs-root/usr/bin/patchelf /tmp/squashfs-root/usr/bin/patchelf.orig
sudo cp /usr/local/bin/patchelf /tmp/squashfs-root/usr/bin/patchelf
cd "$GITHUB_WORKSPACE"
mkdir -p squashfs-root/usr/bin
ls -al "$BUILDBIN"
cp -P "$BUILDBIN"/PCSX2 "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/
patchelf --set-rpath /tmp/PCSX2 "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/PCSX2
ninja -C build install
cp ./pcsx2/gui/Resources/AppIcon64.png ./squashfs-root/PCSX2.png
cp ./linux_various/PCSX2.desktop.in ./squashfs-root/PCSX2.desktop
sed -i -e 's|Categories=@PCSX2_MENU_CATEGORIES@|Categories=Game;Emulator;|g' ./squashfs-root/PCSX2.desktop
@@ -37,21 +32,32 @@ mkdir -p squashfs-root/usr/share/icons && cp ./squashfs-root/PCSX2.png ./squashf
mkdir -p squashfs-root/usr/share/icons/hicolor/scalable/apps && cp ./squashfs-root/PCSX2.png ./squashfs-root/usr/share/icons/hicolor/scalable/apps
mkdir -p squashfs-root/usr/share/pixmaps && cp ./squashfs-root/PCSX2.png ./squashfs-root/usr/share/pixmaps
mkdir -p squashfs-root/usr/lib/
mkdir -p squashfs-root/usr/optional/libstdc++
mkdir -p squashfs-root/usr/optional/libgcc_s
cp ./.github/workflows/scripts/linux/AppRun "$GITHUB_WORKSPACE"/squashfs-root/AppRun
curl -sSfL "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-$APPARCH" -o "$GITHUB_WORKSPACE"/squashfs-root/AppRun-patched
curl -sSfL "https://github.com/PCSX2/appimage-checkrt-branch/releases/download/AppImage-checkrt/AppRun_patched" -o "$GITHUB_WORKSPACE"/squashfs-root/AppRun-patched
curl -sSfL "https://github.com/PCSX2/appimage-checkrt-branch/releases/download/AppImage-checkrt/exec.so" -o "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/exec.so
chmod a+x ./squashfs-root/AppRun
chmod a+x ./squashfs-root/runtime
chmod a+x ./squashfs-root/AppRun-patched
chmod a+x ./squashfs-root/usr/optional/exec.so
echo "$name" > "$GITHUB_WORKSPACE"/squashfs-root/version.txt
mkdir -p "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/app
cp -r "$GITHUB_WORKSPACE"/bin/Langs "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/
cp "$GITHUB_WORKSPACE"/bin/docs/{Configuration_Guide.pdf,PCSX2_FAQ.pdf} "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/app
cp "$GITHUB_WORKSPACE"/bin/cheats_ws.zip "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/app
cp ./bin/GameIndex.yaml "$GITHUB_WORKSPACE"/squashfs-root/usr/bin/app/GameIndex.yaml
mkdir -p "$GITHUB_WORKSPACE"/squashfs-root/apprun-hooks
cp /usr/lib/$LIBARCH/libthai.so.0 "$GITHUB_WORKSPACE"/squashfs-root/usr/lib/
cp --dereference /usr/lib/"$LIBARCH"/libstdc++.so.6 "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/libstdc++/libstdc++.so.6
cp --dereference /lib/"$LIBARCH"/libgcc_s.so.1 "$GITHUB_WORKSPACE"/squashfs-root/usr/optional/libgcc_s/libgcc_s.so.1
chmod +x .github/workflows/scripts/linux/app-variables.sh
cp .github/workflows/scripts/linux/app-variables.sh "$GITHUB_WORKSPACE"/squashfs-root/apprun-hooks
export UPD_INFO="gh-releases-zsync|PCSX2|pcsx2|latest|$name.AppImage.zsync"
export OUTPUT="$name.AppImage"
/tmp/squashfs-root/AppRun --appdir="$GITHUB_WORKSPACE"/squashfs-root/ --plugin gtk -d "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.desktop -i "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.png --output appimage
/tmp/squashfs-root/AppRun --appdir="$GITHUB_WORKSPACE"/squashfs-root/ --plugin gtk -d "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.desktop -i "$GITHUB_WORKSPACE"/squashfs-root/PCSX2.png
# see LD_LIBRARY_PATH in app-variables.sh - the intent is to use system wayland if available but fall back to app-image provided
# a little bit hacky but should ensure maximum compatibility
mkdir -p squashfs-root/usr/lib/wayland
mv squashfs-root/usr/lib/libwayland-* squashfs-root/usr/lib/wayland
rm squashfs-root/usr/lib/libgmodule-2.0.so.0
curl -sSfL "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$ARCH.AppImage" -o ./appimagetool-"$ARCH".AppImage
chmod a+x appimagetool*.AppImage
./appimagetool-"$ARCH".AppImage "$GITHUB_WORKSPACE"/squashfs-root "$name.AppImage"
mkdir -p "$GITHUB_WORKSPACE"/ci-artifacts/
ls -al .
mv "$name.AppImage" "$GITHUB_WORKSPACE"/ci-artifacts # && mv "$name.AppImage.zsync" "$GITHUB_WORKSPACE"/ci-artifacts

View File

@@ -0,0 +1,125 @@
#!/usr/bin/env bash
set -e
INSTALLDIR="$HOME/deps"
NPROCS="$(getconf _NPROCESSORS_ONLN)"
SDL=SDL2-2.0.22
QT=6.3.1
mkdir -p deps-build
cd deps-build
cat > SHASUMS <<EOF
fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e $SDL.tar.gz
0a64421d9c2469c2c48490a032ab91d547017c9cc171f3f8070bc31888f24e03 qtbase-everywhere-src-$QT.tar.xz
7b19f418e6f7b8e23344082dd04440aacf5da23c5a73980ba22ae4eba4f87df7 qtsvg-everywhere-src-$QT.tar.xz
c412750f2aa3beb93fce5f30517c607f55daaeb7d0407af206a8adf917e126c1 qttools-everywhere-src-$QT.tar.xz
d7bdd55e2908ded901dcc262157100af2a490bf04d31e32995f6d91d78dfdb97 qttranslations-everywhere-src-$QT.tar.xz
6f14fea2d172a5b4170be3efcb0e58535f6605b61bcd823f6d5c9d165bb8c0f0 qtwayland-everywhere-src-$QT.tar.xz
EOF
curl -L \
-O "https://libsdl.org/release/$SDL.tar.gz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtwayland-everywhere-src-$QT.tar.xz"
shasum -a 256 --check SHASUMS
echo "Building SDL..."
tar xf "$SDL.tar.gz"
cd "$SDL"
./configure --prefix "$INSTALLDIR" --disable-dbus --without-x --disable-video-opengl --disable-video-opengles --disable-video-vulkan --disable-wayland-shared --disable-ime --disable-oss --disable-alsa --disable-jack --disable-esd --disable-pipewire --disable-pulseaudio --disable-arts --disable-nas --disable-sndio --disable-fusionsound --disable-diskaudio
make "-j$NPROCS"
make install
cd ..
# Couple notes:
# -fontconfig is needed otherwise Qt Widgets render only boxes.
# -qt-doubleconversion avoids a dependency on libdouble-conversion.
# ICU avoids pulling in a bunch of large libraries, and hopefully we can get away without it.
# OpenGL is needed to render window decorations in Wayland, apparently.
echo "Building Qt Base..."
tar xf "qtbase-everywhere-src-$QT.tar.xz"
cd "qtbase-everywhere-src-$QT"
mkdir build
cd build
../configure -prefix "$INSTALLDIR" -release -no-dbus -gui -widgets -fontconfig -qt-doubleconversion -openssl-runtime -opengl desktop -qpa xcb,wayland -xkbcommon -- -DFEATURE_dbus=OFF -DFEATURE_icu=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF
cmake --build . --parallel
cmake --install .
cd ../../
echo "Building Qt SVG..."
tar xf "qtsvg-everywhere-src-$QT.tar.xz"
cd "qtsvg-everywhere-src-$QT"
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
cmake --install .
cd ../../
echo "Building Qt Wayland..."
tar xf "qtwayland-everywhere-src-$QT.tar.xz"
cd "qtwayland-everywhere-src-$QT"
# qtwayland does not build without qml/qtdeclarative in 6.3.1. Work around it.
patch -u src/compositor/CMakeLists.txt <<EOF
--- src/compositor/CMakeLists.txt 2022-06-08 13:44:30.000000000 +1000
+++ src/compositor/CMakeLists.txt 2022-07-17 20:05:25.461881785 +1000
@@ -46,7 +46,6 @@
global/qtwaylandcompositorglobal.h
global/qtwaylandqmlinclude.h
global/qwaylandcompositorextension.cpp global/qwaylandcompositorextension.h global/qwaylandcompositorextension_p.h
- global/qwaylandquickextension.cpp global/qwaylandquickextension.h
global/qwaylandutils_p.h
hardware_integration/qwlclientbufferintegration.cpp hardware_integration/qwlclientbufferintegration_p.h
wayland_wrapper/qwlbuffermanager.cpp wayland_wrapper/qwlbuffermanager_p.h
EOF
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
cmake --install .
cd ../../
echo "Installing Qt Tools..."
tar xf "qttools-everywhere-src-$QT.tar.xz"
cd "qttools-everywhere-src-$QT"
# From Mac build-dependencies.sh:
# Linguist relies on a library in the Designer target, which takes 5-7 minutes to build on the CI
# Avoid it by not building Linguist, since we only need the tools that come with it
patch -u src/linguist/CMakeLists.txt <<EOF
--- src/linguist/CMakeLists.txt
+++ src/linguist/CMakeLists.txt
@@ -14,7 +14,7 @@
add_subdirectory(lrelease-pro)
add_subdirectory(lupdate)
add_subdirectory(lupdate-pro)
-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND NOT no-png)
+if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND TARGET Qt::PrintSupport AND NOT no-png)
add_subdirectory(linguist)
endif()
EOF
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF ..
cmake --build . --parallel
cmake --install .
cd ../../
echo "Installing Qt Translations..."
tar xf "qttranslations-everywhere-src-$QT.tar.xz"
cd "qttranslations-everywhere-src-$QT"
mkdir build
cd build
cmake -G Ninja -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
cmake --install .
cd ../../
echo "Cleaning up..."
cd ..
rm -r deps-build

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
if [ "${COMPILER}" = "clang" ]; then
echo "Using clang toolchain"
cat > "$HOME/clang-toolchain.cmake" << EOF
set(CMAKE_C_COMPILER /usr/bin/clang-12)
set(CMAKE_CXX_COMPILER /usr/bin/clang++-12)
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
EOF
ADDITIONAL_CMAKE_ARGS="$ADDITIONAL_CMAKE_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_TOOLCHAIN_FILE=$HOME/clang-toolchain.cmake"
fi
echo "Additional CMake Args - ${ADDITIONAL_CMAKE_ARGS}"
# Generate CMake into ./build
# DISABLE_ADVANCE_SIMD is needed otherwise we end up doing -march=native.
# shellcheck disable=SC2086
cmake \
-B build \
-G Ninja \
$ADDITIONAL_CMAKE_ARGS \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DQT_BUILD=ON \
-DWAYLAND_API=ON \
-DXDG_STD=TRUE \
-DDISABLE_PCSX2_WRAPPER=ON \
-DDISABLE_SETCAP=ON \
-DCMAKE_PREFIX_PATH="$HOME/deps" \
-DUSE_SYSTEM_SDL2=ON \
-DUSE_SYSTEM_ZSTD=OFF \
-DDISABLE_ADVANCE_SIMD=TRUE

View File

@@ -3,8 +3,8 @@
set -e
if [ "${COMPILER}" = "gcc" ]; then
export CC=gcc
export CXX=g++
export CC=gcc-10
export CXX=g++-10
else
export CC=clang
export CXX=clang++
@@ -20,13 +20,14 @@ cmake \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release \
-DPACKAGE_MODE=TRUE \
-DWAYLAND_API=TRUE \
-DDISABLE_ADVANCE_SIMD=TRUE \
-DCMAKE_INSTALL_LIBDIR="/tmp/" \
-DCMAKE_INSTALL_DATADIR="/tmp/" \
-DCMAKE_INSTALL_DOCDIR="/tmp/PCSX2" \
-DDISABLE_PCSX2_WRAPPER=TRUE \
-DCMAKE_INSTALL_PREFIX="squashfs-root/usr/" \
-DOpenGL_GL_PREFERENCE="LEGACY" \
-DOPENGL_opengl_LIBRARY="" \
-DXDG_STD=TRUE \
-DUSE_SYSTEM_ZSTD=FALSE \
$ADDITIONAL_CMAKE_ARGS \
-GNinja \
-B build

View File

@@ -0,0 +1,72 @@
#!/bin/bash
set -e
# Packages - Build and Qt
declare -a BUILD_PACKAGES=(
"build-essential"
"git"
"cmake"
"ccache"
"ninja-build"
"libclang-dev" # Qt goes hunting for libclang-11 specifically.
"libclang-11-dev"
"libclang-12-dev"
"patchelf"
"libglib2.0-dev"
"libfontconfig1-dev"
"libharfbuzz-dev"
"libjpeg-dev"
"libpng-dev"
"libfreetype-dev"
"libinput-dev"
"libxcb-*-dev"
"libxkbcommon-dev"
"libxkbcommon-x11-dev"
"libxrender-dev"
"libwayland-dev"
"libgl1-mesa-dev"
"libegl-dev"
"libegl1-mesa-dev"
"libgl1-mesa-dev"
"libssl-dev"
)
# Packages - PCSX2
declare -a PCSX2_PACKAGES=(
"libaio-dev"
"libbz2-dev"
"libegl1-mesa-dev"
"libgl1-mesa-dev"
"libgtk-3-dev"
"libharfbuzz-dev"
"libjpeg-dev"
"liblzma-dev"
"libpcap0.8-dev"
"libpng-dev"
"libpulse-dev"
"librsvg2-dev"
"libsamplerate0-dev"
"libsoundtouch-dev"
"libudev-dev"
"libx11-xcb-dev"
"pkg-config"
"zlib1g-dev"
)
if [ "${COMPILER}" = "gcc" ]; then
BUILD_PACKAGES+=("g++-10")
else
BUILD_PACKAGES+=("llvm-12" "lld-12" "clang-12")
fi
sudo apt-get -qq update
# Install packages needed for building
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
sudo apt-get -y install "${BUILD_PACKAGES[@]}"
# Install packages needed by pcsx2
PCSX2_PACKAGES=("${PCSX2_PACKAGES[@]}")
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES[*]}"
sudo apt-get -y install "${PCSX2_PACKAGES[@]}"

View File

@@ -6,100 +6,41 @@ set -e
declare -a BUILD_PACKAGES=(
"ccache"
"cmake"
"g++-8-multilib"
"ninja-build"
)
declare -a GCC_PACKAGES=(
# Nothing Unique Needed
)
declare -a CLANG_PACKAGES=(
"clang-format"
"clang-tidy"
"clang-tools"
"clang"
"clangd-10"
"libc++-dev"
"libc++1"
"libc++abi-dev"
"libc++abi1"
"libclang-dev"
"libclang1"
"liblldb-10-dev"
"libllvm-10-ocaml-dev"
"libomp-dev"
"libomp5"
"lld"
"lldb"
"llvm-dev"
"llvm-runtime"
"llvm"
"python3-clang-10"
)
# Packages - PCSX2
declare -a PCSX2_PACKAGES=(
"curl"
"fuse"
"gettext"
"libaio-dev"
"libasound2-dev"
"libatk1.0-dev"
"libatk-bridge2.0-dev"
"libbz2-dev"
"libcairo2-dev"
"libcggl"
"libdbus-1-dev"
"libegl1-mesa-dev"
"libfontconfig1-dev"
"libgdk-pixbuf2.0-dev"
"libgirepository-1.0-1"
"libgl-dev"
"libgl1-mesa-dev"
"libgl1-mesa-dri"
"libgl1"
"libgles2-mesa-dev"
"libglew-dev"
"libglib2.0-dev"
"libglu1-mesa-dev"
"libglu1-mesa"
"libglvnd-dev"
"libglx-mesa0"
"libglx0"
"libgtk-3-dev"
"libgtk2.0-dev"
"libharfbuzz-dev"
"libibus-1.0-dev"
"libjack-jackd2-dev"
"libjpeg-dev"
"libllvm10"
"liblzma-dev"
"liblzma5"
"libpango1.0-dev"
"libpcap0.8-dev"
"libpng-dev"
"libportaudiocpp0"
"libpulse-dev"
"librsvg2-dev"
"libsdl1.2-dev"
"libsdl2-dev"
"libsamplerate0-dev"
"libsoundtouch-dev"
"libwxgtk3.0-dev"
"libwxgtk3.0-gtk3-0v5"
"libudev-dev"
"libwxgtk3.0-gtk3-dev"
"libx11-xcb-dev"
"libxext-dev"
"libxft-dev"
"libxml2-dev"
"nvidia-cg-toolkit"
"pkg-config"
"portaudio19-dev"
"python"
"zlib1g-dev"
)
if [ "${COMPILER}" = "gcc" ]; then
BUILD_PACKAGES+=("g++-10-multilib")
else
BUILD_PACKAGES+=("clang-9")
PCSX2_PACKAGES+=("libstdc++-10-dev")
fi
# - https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
ARCH=""
echo "${PLATFORM}"
@@ -111,45 +52,11 @@ fi
sudo apt-get -qq update
# Install packages needed for building
BUILD_PACKAGE_STR=""
for i in "${BUILD_PACKAGES[@]}"; do
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
done
if [ "${COMPILER}" = "gcc" ]; then
for i in "${GCC_PACKAGES[@]}"; do
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
done
else
for i in "${CLANG_PACKAGES[@]}"; do
BUILD_PACKAGE_STR="${BUILD_PACKAGE_STR} ${i}"
done
fi
echo "Will install the following packages for building - ${BUILD_PACKAGE_STR}"
echo "Will install the following packages for building - ${BUILD_PACKAGES[*]}"
#sudo apt remove gcc-9 g++-9
sudo apt-get -y install ${BUILD_PACKAGE_STR}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo apt-get -y install "${BUILD_PACKAGES[@]}"
# Install packages needed by pcsx2
PCSX2_PACKAGES_STR=""
for i in "${PCSX2_PACKAGES[@]}"; do
PCSX2_PACKAGES_STR="${PCSX2_PACKAGES_STR} ${i}${ARCH}"
done
if [ "${PLATFORM}" == "x86" ]; then
echo "Installing workaround attempt"
sudo apt-get -y install libgcc-s1:i386
fi
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES_STR}"
sudo apt-get -y install ${PCSX2_PACKAGES_STR}
cd /tmp
curl -sSfLO https://github.com/NixOS/patchelf/releases/download/0.12/patchelf-0.12.tar.bz2
tar xvf patchelf-0.12.tar.bz2
cd patchelf-0.12*/
./configure
make && sudo make install
PCSX2_PACKAGES=("${PCSX2_PACKAGES[@]/%/"${ARCH}"}")
echo "Will install the following packages for pcsx2 - ${PCSX2_PACKAGES[*]}"
sudo apt-get -y install "${PCSX2_PACKAGES[@]}"

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=PCSX2
StartupWMClass=PCSX2
GenericName=PlayStation 2 Emulator
Comment=Sony PlayStation 2 emulator
Exec=pcsx2-qt
Icon=PCSX2
Keywords=game;emulator;
Categories=Game;Emulator;

View File

@@ -0,0 +1,164 @@
#!/bin/bash
set -e
if [ "$GUI" == "Qt" ]; then
export MACOSX_DEPLOYMENT_TARGET=10.14
else
export MACOSX_DEPLOYMENT_TARGET=10.13
fi
INSTALLDIR="$HOME/deps"
NPROCS="$(getconf _NPROCESSORS_ONLN)"
SDL=SDL2-2.0.22
PNG=1.6.37
JPG=9e
SAMPLERATE=libsamplerate-0.1.9
PORTAUDIO=pa_stable_v190700_20210406
SOUNDTOUCH=soundtouch-2.3.1
WXWIDGETS=3.1.6
QT=6.3.1
mkdir deps-build
cd deps-build
export PKG_CONFIG_PATH="$INSTALLDIR/lib/pkgconfig:$PKG_CONFIG_PATH"
export LDFLAGS="-L$INSTALLDIR/lib -dead_strip $LDFLAGS"
export CFLAGS="-I$INSTALLDIR/include -Os $CFLAGS"
export CXXFLAGS="-I$INSTALLDIR/include -Os $CXXFLAGS"
cat > SHASUMS <<EOF
fe7cbf3127882e3fc7259a75a0cb585620272c51745d3852ab9dd87960697f2e $SDL.tar.gz
505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca libpng-$PNG.tar.xz
4077d6a6a75aeb01884f708919d25934c93305e49f7e3f36db9129320e6f4f3d jpegsrc.v$JPG.tar.gz
0a7eb168e2f21353fb6d84da152e4512126f7dc48ccb0be80578c565413444c1 $SAMPLERATE.tar.gz
47efbf42c77c19a05d22e627d42873e991ec0c1357219c0d74ce6a2948cb2def $PORTAUDIO.tgz
6900996607258496ce126924a19fe9d598af9d892cf3f33d1e4daaa9b42ae0b1 $SOUNDTOUCH.tar.gz
4980e86c6494adcd527a41fc0a4e436777ba41d1893717d7b7176c59c2061c25 wxWidgets-$WXWIDGETS.tar.bz2
0a64421d9c2469c2c48490a032ab91d547017c9cc171f3f8070bc31888f24e03 qtbase-everywhere-src-$QT.tar.xz
7b19f418e6f7b8e23344082dd04440aacf5da23c5a73980ba22ae4eba4f87df7 qtsvg-everywhere-src-$QT.tar.xz
c412750f2aa3beb93fce5f30517c607f55daaeb7d0407af206a8adf917e126c1 qttools-everywhere-src-$QT.tar.xz
d7bdd55e2908ded901dcc262157100af2a490bf04d31e32995f6d91d78dfdb97 qttranslations-everywhere-src-$QT.tar.xz
EOF
curl -L \
-O "https://libsdl.org/release/$SDL.tar.gz" \
-O "https://downloads.sourceforge.net/project/libpng/libpng16/$PNG/libpng-$PNG.tar.xz" \
-O "https://www.ijg.org/files/jpegsrc.v$JPG.tar.gz" \
-O "http://www.mega-nerd.com/SRC/$SAMPLERATE.tar.gz" \
-O "http://files.portaudio.com/archives/$PORTAUDIO.tgz" \
-O "https://www.surina.net/soundtouch/$SOUNDTOUCH.tar.gz" \
-O "https://github.com/wxWidgets/wxWidgets/releases/download/v$WXWIDGETS/wxWidgets-$WXWIDGETS.tar.bz2" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtbase-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qtsvg-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttools-everywhere-src-$QT.tar.xz" \
-O "https://download.qt.io/official_releases/qt/${QT%.*}/$QT/submodules/qttranslations-everywhere-src-$QT.tar.xz" \
shasum -a 256 --check SHASUMS
echo "Installing SDL..."
tar xf "$SDL.tar.gz"
cd "$SDL"
./configure --prefix "$INSTALLDIR" --without-x
make "-j$NPROCS"
make install
cd ..
echo "Installing libpng..."
tar xf "libpng-$PNG.tar.xz"
cd "libpng-$PNG"
./configure --prefix "$INSTALLDIR" --disable-dependency-tracking
make "-j$NPROCS"
make install
cd ..
echo "Installing libjpeg..."
tar xf "jpegsrc.v$JPG.tar.gz"
cd "jpeg-$JPG"
./configure --prefix "$INSTALLDIR" --disable-dependency-tracking
make "-j$NPROCS"
make install
cd ..
echo "Installing libsamplerate..."
tar xf "$SAMPLERATE.tar.gz"
cd "$SAMPLERATE"
sed -i "" "s/Carbon.h/Carbon\\/Carbon.h/" examples/audio_out.c
./configure --prefix "$INSTALLDIR" --disable-dependency-tracking --disable-sndfile
make "-j$NPROCS"
make install
cd ..
echo "Installing portaudio..."
tar xf "$PORTAUDIO.tgz"
cd portaudio
./configure --prefix "$INSTALLDIR" --enable-mac-universal=no
make "-j$NPROCS"
make install
cd ..
echo "Installing soundtouch..."
tar xf "$SOUNDTOUCH.tar.gz"
cd "$SOUNDTOUCH"
cmake -B build -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
make -C build "-j$NPROCS"
make -C build install
cd ..
if [ "$GUI" == "wxWidgets" ]; then
echo "Installing wx..."
tar xf "wxWidgets-$WXWIDGETS.tar.bz2"
cd "wxWidgets-$WXWIDGETS"
./configure --prefix "$INSTALLDIR" --with-macosx-version-min="$MACOSX_DEPLOYMENT_TARGET" --enable-clipboard --enable-dnd --enable-std_string --with-cocoa --with-libiconv --with-libjpeg --with-libpng --with-zlib --without-libtiff --without-regex
make "-j$NPROCS"
make install
cd ..
fi
if [ "$GUI" == "Qt" ]; then
echo "Installing Qt Base..."
tar xf "qtbase-everywhere-src-$QT.tar.xz"
cd "qtbase-everywhere-src-$QT"
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_optimize_size=ON -DFEATURE_dbus=OFF -DFEATURE_framework=OFF -DFEATURE_icu=OFF -DFEATURE_opengl=OFF -DFEATURE_printsupport=OFF -DFEATURE_sql=OFF
make -C build "-j$NPROCS"
make -C build install
cd ..
echo "Installing Qt SVG..."
tar xf "qtsvg-everywhere-src-$QT.tar.xz"
cd "qtsvg-everywhere-src-$QT"
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=MinSizeRel
make -C build "-j$NPROCS"
make -C build install
cd ..
echo "Installing Qt Tools..."
tar xf "qttools-everywhere-src-$QT.tar.xz"
cd "qttools-everywhere-src-$QT"
# Linguist relies on a library in the Designer target, which takes 5-7 minutes to build on the CI
# Avoid it by not building Linguist, since we only need the tools that come with it
patch -u src/linguist/CMakeLists.txt <<EOF
--- src/linguist/CMakeLists.txt
+++ src/linguist/CMakeLists.txt
@@ -14,7 +14,7 @@
add_subdirectory(lrelease-pro)
add_subdirectory(lupdate)
add_subdirectory(lupdate-pro)
-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND NOT no-png)
+if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton AND TARGET Qt::Widgets AND TARGET Qt::PrintSupport AND NOT no-png)
add_subdirectory(linguist)
endif()
EOF
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release -DFEATURE_assistant=OFF -DFEATURE_clang=OFF -DFEATURE_designer=OFF -DFEATURE_kmap2qmap=OFF -DFEATURE_pixeltool=OFF -DFEATURE_pkg_config=OFF -DFEATURE_qev=OFF -DFEATURE_qtattributionsscanner=OFF -DFEATURE_qtdiag=OFF -DFEATURE_qtplugininfo=OFF
make -C build "-j$NPROCS"
make -C build install
cd ..
echo "Installing Qt Translations..."
tar xf "qttranslations-everywhere-src-$QT.tar.xz"
cd "qttranslations-everywhere-src-$QT"
cmake -B build -DCMAKE_PREFIX_PATH="$INSTALLDIR" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DCMAKE_BUILD_TYPE=Release
make -C build "-j$NPROCS"
make -C build install
cd ..
fi
echo "Cleaning up..."
cd ..
rm -r deps-build

View File

@@ -1,39 +1,24 @@
import { MessageEmbed, WebhookClient } from "discord.js";
import * as github from '@actions/github';
const assets = github.context.payload.release.assets;
let windowsAssetLinks = "";
let linuxAssetLinks = "";
const releaseInfo = github.context.payload.release;
for (var i = 0; i < assets.length; i++) {
let asset = assets[i];
if (asset.name.includes("symbols")) {
continue;
}
if (asset.name.includes("windows")) {
windowsAssetLinks += `- [${asset.name}](${asset.browser_download_url})\n`
} else if (asset.name.includes("linux")) {
linuxAssetLinks += `- [${asset.name}](${asset.browser_download_url})\n`
}
if (!releaseInfo.prerelease) {
console.log("Not announcing - release was not a pre-release (aka a Nightly)");
process.exit(0);
}
// Publish Webhook
const embed = new MessageEmbed()
.setColor('#FF8000')
.setTitle('New PCSX2 Nightly Build Available!')
.setDescription("To download the latest or previous builds, [visit the official downloads page](https://pcsx2.net/downloads/).")
.addFields(
{ name: 'Version', value: github.context.payload.release.tag_name, inline: true },
{ name: 'Release Link', value: `[Github Release](${github.context.payload.release.html_url})`, inline: true },
{ name: 'Installation Steps', value: '[See Here](https://github.com/PCSX2/pcsx2/wiki/Nightly-Build-Usage-Guide)', inline: true }
{ name: 'Version', value: releaseInfo.tag_name, inline: true },
{ name: 'Installation Steps', value: '[See Here](https://github.com/PCSX2/pcsx2/wiki/Nightly-Build-Usage-Guide)', inline: true },
{ name: 'Included Changes', value: releaseInfo.body, inline: false }
);
if (windowsAssetLinks != "") {
embed.addField('Windows Downloads', windowsAssetLinks, false);
}
if (linuxAssetLinks != "") {
embed.addField('Linux Downloads', linuxAssetLinks, false);
}
const webhookClient = new WebhookClient({ url: process.env.DISCORD_BUILD_WEBHOOK });
await webhookClient.send({
embeds: [embed],

View File

@@ -328,14 +328,22 @@
}
},
"node_modules/node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
},
"peerDependencies": {
"encoding": "^0.1.0"
},
"peerDependenciesMeta": {
"encoding": {
"optional": true
}
}
},
"node_modules/once": {
@@ -714,9 +722,9 @@
}
},
"node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": {
"whatwg-url": "^5.0.0"
}

View File

@@ -1,11 +1,15 @@
import { Octokit } from "@octokit/rest";
import { throttling } from "@octokit/plugin-throttling";
import { retry } from "@octokit/plugin-retry";
let owner = process.env.OWNER;
let repo = process.env.REPO;
Octokit.plugin(throttling);
Octokit.plugin(retry);
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
userAgent: 'PCSX2/pcsx2',
userAgent: `${owner}/${repo}`,
log: {
debug: () => { },
info: () => { },
@@ -39,14 +43,14 @@ let commitSha = process.env.COMMIT_SHA;
console.log(`Searching for Commit - ${commitSha}`);
const { data: commit } = await octokit.rest.repos.getCommit({
owner: "PCSX2",
repo: "pcsx2",
owner: owner,
repo: repo,
ref: commitSha,
});
const { data: associatedPulls } = await octokit.rest.repos.listPullRequestsAssociatedWithCommit({
owner: "PCSX2",
repo: "pcsx2",
owner: owner,
repo: repo,
commit_sha: commit.sha,
});

View File

@@ -154,9 +154,9 @@
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
},
"node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"requires": {
"whatwg-url": "^5.0.0"
}

View File

@@ -0,0 +1,49 @@
import os
import shutil
tag = os.environ['TAG'].split("refs/tags/")[1]
scan_dir = os.environ['SCAN_DIR']
output_dir = os.environ['OUT_DIR']
accepted_exts = ["AppImage", "tar.gz", "7z"]
for dir_name in os.listdir(scan_dir):
asset_name = "pcsx2-{}".format(tag)
if "macos" in dir_name.lower():
asset_name += "-macos"
elif "linux" in dir_name.lower():
asset_name += "-linux-AppImage-64bit"
elif "windows" in dir_name.lower():
asset_name += "-windows-64bit"
else:
continue;
if "avx2" in dir_name.lower():
asset_name += "-AVX2"
elif "sse4" in dir_name.lower():
asset_name += "-SSE4"
if "wxwidgets" in dir_name.lower():
asset_name += "-wxWidgets"
else:
asset_name += "-Qt"
if "symbols" in dir_name.lower():
asset_name += "-symbols"
print(asset_name)
dir_handled = False
for file in os.listdir(os.path.join(scan_dir, dir_name)):
for ext in accepted_exts:
if file.endswith(ext):
dir_handled = True
print("Moving {} to out dir".format(file))
shutil.move(os.path.join(scan_dir, dir_name, file), os.path.join(output_dir, asset_name + "." + ext))
break
if dir_handled:
break
if not dir_handled:
print("Could not find asset in directory when one was expected")
exit(1)

View File

@@ -1,2 +0,0 @@
node_modules/
*.md

View File

@@ -1,145 +0,0 @@
import { Octokit } from "@octokit/rest";
import { throttling } from "@octokit/plugin-throttling";
import { retry } from "@octokit/plugin-retry";
Octokit.plugin(throttling);
Octokit.plugin(retry);
const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN,
userAgent: 'PCSX2/pcsx2',
log: {
debug: () => { },
info: () => { },
warn: console.warn,
error: console.error
},
throttle: {
onRateLimit: (retryAfter, options) => {
octokit.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`
);
// Retry twice after hitting a rate limit error, then give up
if (options.request.retryCount <= 2) {
console.log(`Retrying after ${retryAfter} seconds!`);
return true;
}
},
onAbuseLimit: (retryAfter, options) => {
// does not retry, only logs a warning
octokit.log.warn(
`Abuse detected for request ${options.method} ${options.url}`
);
},
}
});
let assetDir = process.env.ASSET_DIR;
let tagToSearchFor = process.env.TAG_TO_SEARCH_FOR.split("refs/tags/")[1];
console.log(`Searching in - ${assetDir}`);
console.log(`Searching for tag - ${tagToSearchFor}`);
const { data: recentReleases } = await octokit.rest.repos.listReleases({
owner: "PCSX2",
repo: "pcsx2",
per_page: 100
});
let release = undefined;
for (var i = 0; i < recentReleases.length; i++) {
if (recentReleases[i].tag_name == tagToSearchFor) {
release = recentReleases[i];
break;
}
}
if (release == undefined) {
console.log(`Unable to find release with tag - ${tagToSearchFor}`);
process.exit(1);
}
// Upload any assets we need to, don't upload assets that are already there!
const { data: releaseAssetsPre } = await octokit.rest.repos.listReleaseAssets({
owner: "PCSX2",
repo: "pcsx2",
release_id: release.id,
per_page: 100
});
import glob from 'glob';
import * as fs from 'fs';
import * as path from 'path';
glob(assetDir + `/**/*${process.env.ASSET_EXTENSION}`, {}, async (err, files) => {
for (var i = 0; i < files.length; i++) {
let foundDuplicate = false;
for (var j = 0; j < releaseAssetsPre.length; j++) {
let existingAsset = releaseAssetsPre[j];
if (existingAsset.name == `pcsx2-${release.tag_name}-${path.basename(files[i])}`) {
foundDuplicate = true;
break;
}
}
if (foundDuplicate) {
continue;
}
var assetBytes = fs.readFileSync(files[i], null);
const { data: uploadAsset } = await octokit.rest.repos.uploadReleaseAsset({
owner: "PCSX2",
repo: "pcsx2",
release_id: release.id,
name: `pcsx2-${release.tag_name}-${path.basename(files[i])}`,
data: assetBytes,
});
}
});
// Ideally there would be a webhook event for when an artifact is added to a draft release
// unfortunately, such a thing does not exist yet. Therefore, we have to wait a bit
// for the API to become consistent
// TODO - future work - we could check previous draft releases to become eventually consistent as well
// - draft releases should only be a temporary state, so anything that remains a draft had a problem
await new Promise(resolve => setTimeout(resolve, 10 * 1000));
// Poll the release, and check to see if it's ready to be published
const { data: releaseAssetsPost } = await octokit.rest.repos.listReleaseAssets({
owner: "PCSX2",
repo: "pcsx2",
release_id: release.id,
per_page: 100
});
// Expected Assets, if we have all of them, we will publish it
let expectedAssets = {
"windows-32bit-sse4": false,
"windows-32bit-avx2": false,
"windows-64bit-sse4": false,
"windows-64bit-avx2": false,
"linux-appimage-32bit": false,
"linux-appimage-64bit": false
}
for (var i = 0; i < releaseAssetsPost.length; i++) {
let asset = releaseAssetsPost[i];
if (asset.name.includes("symbols")) {
continue;
}
for (var j = 0; j < Object.keys(expectedAssets).length; j++) {
let expectedNamePrefix = Object.keys(expectedAssets)[j];
if (asset.name.toLowerCase().includes(expectedNamePrefix)) {
expectedAssets[expectedNamePrefix] = true;
break;
}
}
}
console.log(expectedAssets);
if (Object.values(expectedAssets).every(Boolean)) {
await octokit.rest.repos.updateRelease({
owner: "PCSX2",
repo: "pcsx2",
release_id: release.id,
draft: false
});
}

View File

@@ -1,973 +0,0 @@
{
"name": "upload-release-artifacts",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^3.5.2",
"@octokit/rest": "^18.12.0",
"discord.js": "^13.2.0",
"glob": "^7.2.0"
}
},
"node_modules/@discordjs/builders": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
}
},
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
"engines": {
"node": ">=12"
}
},
"node_modules/@discordjs/collection": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@discordjs/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/@octokit/auth-token": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
"dependencies": {
"@octokit/types": "^6.0.3"
}
},
"node_modules/@octokit/core": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
"dependencies": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/endpoint": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
"dependencies": {
"@octokit/types": "^6.0.3",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/graphql": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
"dependencies": {
"@octokit/request": "^5.6.0",
"@octokit/types": "^6.0.3",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/openapi-types": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.1.0.tgz",
"integrity": "sha512-dWZfYvCCdjZzDYA3lIAMF72Q0jld8xidqCq5Ryw09eBJXZdcM6he0vWBTvw/b5UnGYqexxOyHWgfrsTlUJL3Gw=="
},
"node_modules/@octokit/plugin-paginate-rest": {
"version": "2.16.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.9.tgz",
"integrity": "sha512-gfSCMgz5scFKsR0dW4jaYsDJVt/UwCHp4dF7sHlmSekZvwzvLiOAGZ4MQkEsL5DW9hIk2W+UQkYZMTA1b6Wsqw==",
"dependencies": {
"@octokit/types": "^6.33.0"
}
},
"node_modules/@octokit/plugin-request-log": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA=="
},
"node_modules/@octokit/plugin-rest-endpoint-methods": {
"version": "5.12.1",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.12.1.tgz",
"integrity": "sha512-0nY3htfl6x9UkPcqv8pm9vOC/bTA7f4IMDWln13neHRdNWQvOQgZ9fRxK7BAc74rye4yVINEFi9Yb9rnGUvosA==",
"dependencies": {
"@octokit/types": "^6.33.0",
"deprecation": "^2.3.1"
}
},
"node_modules/@octokit/plugin-retry": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
"dependencies": {
"@octokit/types": "^6.0.3",
"bottleneck": "^2.15.3"
}
},
"node_modules/@octokit/plugin-throttling": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.5.2.tgz",
"integrity": "sha512-Eu7kfJxU8vmHqWGNszWpg+GVp2tnAfax3XQV5CkYPEE69C+KvInJXW9WajgSeW+cxYe0UVdouzCtcreGNuJo7A==",
"dependencies": {
"@octokit/types": "^6.0.1",
"bottleneck": "^2.15.3"
}
},
"node_modules/@octokit/request": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz",
"integrity": "sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA==",
"dependencies": {
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1",
"universal-user-agent": "^6.0.0"
}
},
"node_modules/@octokit/request-error": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
"dependencies": {
"@octokit/types": "^6.0.3",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"node_modules/@octokit/rest": {
"version": "18.12.0",
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz",
"integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==",
"dependencies": {
"@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.16.8",
"@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^5.12.0"
}
},
"node_modules/@octokit/types": {
"version": "6.33.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.33.0.tgz",
"integrity": "sha512-0zffZ048M0UhthyPXQHLz4038Ak46nMWZXkzlXvXB/M/L1jYPBceq4iZj4qjKVrvveaJrrgKdJ9+3yUuITfcCw==",
"dependencies": {
"@octokit/openapi-types": "^11.1.0"
}
},
"node_modules/@sapphire/async-queue": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.6.tgz",
"integrity": "sha512-M5CbgMgesemMUCQo5G/InGHvp+GZx6uuJNV1iwvSWD8EFNVrfxaTcqhcAXM3MPYkjlxvNnoDNk0R1lfzvca6LA==",
"engines": {
"node": ">=v14.18.0",
"npm": ">=7.24.2"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/node": {
"version": "16.10.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz",
"integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ=="
},
"node_modules/@types/ws": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"node_modules/before-after-hook": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
},
"node_modules/bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/deprecation": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
},
"node_modules/discord-api-types": {
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
"engines": {
"node": ">=12"
}
},
"node_modules/discord.js": {
"version": "13.2.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
"dependencies": {
"@discordjs/builders": "^0.6.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"@sapphire/async-queue": "^1.1.5",
"@types/ws": "^8.2.0",
"discord-api-types": "^0.23.1",
"node-fetch": "^2.6.1",
"ws": "^8.2.3"
},
"engines": {
"node": ">=16.6.0",
"npm": ">=7.0.0"
}
},
"node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"dependencies": {
"is-obj": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"node_modules/glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"dependencies": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
},
"engines": {
"node": "*"
}
},
"node_modules/inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"node_modules/inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
"engines": {
"node": ">=8"
}
},
"node_modules/is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"node_modules/mime-db": {
"version": "1.50.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.33",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
"dependencies": {
"mime-db": "1.50.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"dependencies": {
"whatwg-url": "^5.0.0"
},
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dependencies": {
"wrappy": "1"
}
},
"node_modules/ow": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
"dependencies": {
"@sindresorhus/is": "^4.0.1",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"type-fest": "^1.2.1",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"node_modules/ts-mixer": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
},
"node_modules/tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"node_modules/type-fest": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"node_modules/whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"dependencies": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"node_modules/wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"node_modules/ws": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
},
"peerDependenciesMeta": {
"bufferutil": {
"optional": true
},
"utf-8-validate": {
"optional": true
}
}
}
},
"dependencies": {
"@discordjs/builders": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
"requires": {
"@sindresorhus/is": "^4.0.1",
"discord-api-types": "^0.22.0",
"ow": "^0.27.0",
"ts-mixer": "^6.0.0",
"tslib": "^2.3.1"
},
"dependencies": {
"discord-api-types": {
"version": "0.22.0",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
}
}
},
"@discordjs/collection": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog=="
},
"@discordjs/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"@octokit/auth-token": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz",
"integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==",
"requires": {
"@octokit/types": "^6.0.3"
}
},
"@octokit/core": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz",
"integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==",
"requires": {
"@octokit/auth-token": "^2.4.4",
"@octokit/graphql": "^4.5.8",
"@octokit/request": "^5.6.0",
"@octokit/request-error": "^2.0.5",
"@octokit/types": "^6.0.3",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/endpoint": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz",
"integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==",
"requires": {
"@octokit/types": "^6.0.3",
"is-plain-object": "^5.0.0",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/graphql": {
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz",
"integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==",
"requires": {
"@octokit/request": "^5.6.0",
"@octokit/types": "^6.0.3",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/openapi-types": {
"version": "11.1.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.1.0.tgz",
"integrity": "sha512-dWZfYvCCdjZzDYA3lIAMF72Q0jld8xidqCq5Ryw09eBJXZdcM6he0vWBTvw/b5UnGYqexxOyHWgfrsTlUJL3Gw=="
},
"@octokit/plugin-paginate-rest": {
"version": "2.16.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.9.tgz",
"integrity": "sha512-gfSCMgz5scFKsR0dW4jaYsDJVt/UwCHp4dF7sHlmSekZvwzvLiOAGZ4MQkEsL5DW9hIk2W+UQkYZMTA1b6Wsqw==",
"requires": {
"@octokit/types": "^6.33.0"
}
},
"@octokit/plugin-request-log": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz",
"integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA=="
},
"@octokit/plugin-rest-endpoint-methods": {
"version": "5.12.1",
"resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.12.1.tgz",
"integrity": "sha512-0nY3htfl6x9UkPcqv8pm9vOC/bTA7f4IMDWln13neHRdNWQvOQgZ9fRxK7BAc74rye4yVINEFi9Yb9rnGUvosA==",
"requires": {
"@octokit/types": "^6.33.0",
"deprecation": "^2.3.1"
}
},
"@octokit/plugin-retry": {
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-3.0.9.tgz",
"integrity": "sha512-r+fArdP5+TG6l1Rv/C9hVoty6tldw6cE2pRHNGmFPdyfrc696R6JjrQ3d7HdVqGwuzfyrcaLAKD7K8TX8aehUQ==",
"requires": {
"@octokit/types": "^6.0.3",
"bottleneck": "^2.15.3"
}
},
"@octokit/plugin-throttling": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-3.5.2.tgz",
"integrity": "sha512-Eu7kfJxU8vmHqWGNszWpg+GVp2tnAfax3XQV5CkYPEE69C+KvInJXW9WajgSeW+cxYe0UVdouzCtcreGNuJo7A==",
"requires": {
"@octokit/types": "^6.0.1",
"bottleneck": "^2.15.3"
}
},
"@octokit/request": {
"version": "5.6.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz",
"integrity": "sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA==",
"requires": {
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.1.0",
"@octokit/types": "^6.16.1",
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.1",
"universal-user-agent": "^6.0.0"
}
},
"@octokit/request-error": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz",
"integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==",
"requires": {
"@octokit/types": "^6.0.3",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"@octokit/rest": {
"version": "18.12.0",
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz",
"integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==",
"requires": {
"@octokit/core": "^3.5.1",
"@octokit/plugin-paginate-rest": "^2.16.8",
"@octokit/plugin-request-log": "^1.0.4",
"@octokit/plugin-rest-endpoint-methods": "^5.12.0"
}
},
"@octokit/types": {
"version": "6.33.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.33.0.tgz",
"integrity": "sha512-0zffZ048M0UhthyPXQHLz4038Ak46nMWZXkzlXvXB/M/L1jYPBceq4iZj4qjKVrvveaJrrgKdJ9+3yUuITfcCw==",
"requires": {
"@octokit/openapi-types": "^11.1.0"
}
},
"@sapphire/async-queue": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.6.tgz",
"integrity": "sha512-M5CbgMgesemMUCQo5G/InGHvp+GZx6uuJNV1iwvSWD8EFNVrfxaTcqhcAXM3MPYkjlxvNnoDNk0R1lfzvca6LA=="
},
"@sindresorhus/is": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
},
"@types/node": {
"version": "16.10.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.3.tgz",
"integrity": "sha512-ho3Ruq+fFnBrZhUYI46n/bV2GjwzSkwuT4dTf0GkuNFmnb8nq4ny2z9JEVemFi6bdEJanHLlYfy9c6FN9B9McQ=="
},
"@types/ws": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
"requires": {
"@types/node": "*"
}
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
},
"before-after-hook": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz",
"integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ=="
},
"bottleneck": {
"version": "2.19.5",
"resolved": "https://registry.npmjs.org/bottleneck/-/bottleneck-2.19.5.tgz",
"integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
},
"deprecation": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz",
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
},
"discord-api-types": {
"version": "0.23.1",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
},
"discord.js": {
"version": "13.2.0",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
"requires": {
"@discordjs/builders": "^0.6.0",
"@discordjs/collection": "^0.2.1",
"@discordjs/form-data": "^3.0.1",
"@sapphire/async-queue": "^1.1.5",
"@types/ws": "^8.2.0",
"discord-api-types": "^0.23.1",
"node-fetch": "^2.6.1",
"ws": "^8.2.3"
}
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"requires": {
"once": "^1.3.0",
"wrappy": "1"
}
},
"inherits": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
},
"is-plain-object": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q=="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
},
"mime-db": {
"version": "1.50.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A=="
},
"mime-types": {
"version": "2.1.33",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
"requires": {
"mime-db": "1.50.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": {
"brace-expansion": "^1.1.7"
}
},
"node-fetch": {
"version": "2.6.5",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
"requires": {
"whatwg-url": "^5.0.0"
}
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"requires": {
"wrappy": "1"
}
},
"ow": {
"version": "0.27.0",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
"requires": {
"@sindresorhus/is": "^4.0.1",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"type-fest": "^1.2.1",
"vali-date": "^1.0.0"
}
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
},
"tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
},
"ts-mixer": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
},
"tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"type-fest": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
},
"universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
"integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w=="
},
"vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
},
"webidl-conversions": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
},
"whatwg-url": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
"requires": {
"tr46": "~0.0.3",
"webidl-conversions": "^3.0.0"
}
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
},
"ws": {
"version": "8.2.3",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
"requires": {}
}
}
}

View File

@@ -1,18 +0,0 @@
{
"name": "upload-release-artifacts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^3.5.2",
"@octokit/rest": "^18.12.0",
"glob": "^7.2.0"
}
}

View File

@@ -1,191 +0,0 @@
name: 🖥️ Windows Builds
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.clang-format'
- '.codacy.yaml'
- '.github/*'
- '.github/workflows/lint-gamedb.yml'
- '.github/workflows/linux-workflow.yml'
- '.github/workflows/macos-workflow.yml'
- '.github/workflows/scripts/linux/**'
- '.github/workflows/scripts/validation/**'
- '.gitignore'
- 'bin/PCSX2_keys.ini.default'
- 'build.sh'
- 'buildbot.xml'
- 'linux_various/**'
- 'mscompile.cmd'
- 'pcsx2/CDVD/Linux/**'
- 'pcsx2/DEV9/Linux/**'
- 'pcsx2/Linux/**'
- 'pcsx2/PAD/Linux/**'
- 'pcsx2/SPU2/Linux/**'
- 'pcsx2/USB/linux/**'
jobs:
build:
strategy:
# Prevent one build from failing everything (although maybe those should be included as experimental builds instead)
fail-fast: false
matrix:
os: [windows-2019]
platform: [Win32, x64]
configuration: [Release, Release AVX2, CMake]
experimental: [false]
name: ${{ matrix.platform }} | ${{ matrix.configuration }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 60
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_COMPRESS_LEVEL: 9
BUILDCACHE_MAX_CACHE_SIZE: 536870912 # 512MB
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_LOG_FILE: ${{ github.workspace }}\buildcache.log
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Checkout Submodules
run: git submodule update --init --recursive -j $env:NUMBER_OF_PROCESSORS
- name: Setup Buildcache
uses: mikehardy/buildcache-action@v1.2.2
with:
cache_key: ${{ matrix.os }} ${{ matrix.platform }} ${{ matrix.configuration }}
if: matrix.configuration == 'CMake' # TODO: buildcache on VS
- name: Verify VS Project Files
run: .github\workflows\scripts\windows\validate-vs-filters.ps1
if: matrix.configuration != 'CMake'
- name: Setup msbuild
uses: microsoft/setup-msbuild@v1
if: matrix.configuration != 'CMake'
- name: Generate CMake
id: cmake
shell: cmd
run: |
if "${{ github.event.inputs.retainDebugArtifacts }}"=="true" (SET type=RelWithDebInfo) else (SET type=Release)
if "${{ matrix.platform }}"=="Win32" (SET vcvars=vcvarsamd64_x86.bat) else (SET vcvars=vcvars64.bat)
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%"
echo ::set-output name=buildtype::%type%
echo ::set-output name=vcvars::%vcvars%
cmake . -B build -DCMAKE_BUILD_TYPE=%type% -DLTO_PCSX2_CORE=ON -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
if: matrix.configuration == 'CMake'
- name: Build PCSX2
shell: cmd
env:
# Set to 'true' to retain the .pdb / .exp / .lib, etc files which can be useful for repro'ing issues that only occur in the compiled .exe
RetainDebuggingArtifacts: ${{ github.event.inputs.retainDebugArtifacts == 'true' }}
run: |
if "${{ matrix.configuration }}"=="CMake" (
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
cmake --build build --config ${{ steps.cmake.outputs.buildtype }}
) else (
msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ matrix.configuration }}" /p:Platform="${{ matrix.platform }}"
)
- name: Run Tests
shell: cmd
run: |
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
cmake --build build --config ${{ steps.cmake.outputs.buildtype }} --target unittests
if: matrix.configuration == 'CMake'
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
run: |
ARCH=$([ "${{ matrix.platform }}" == Win32 ] && echo "32bit" || echo "64bit")
case "${{ matrix.configuration }}" in
Release) SIMD="SSE4";;
*AVX2) SIMD="AVX2";;
CMake) SIMD="CMake"
cp build/pcsx2/PCSX2* bin/ ;;
*) SIMD="UNKNOWN";;
esac
if [ ${{ github.event_name }} == "pull_request" ]; then
PR_SHA=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
ARTIFACT_NAME="PCSX2-${ARCH}-${SIMD}"
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
PR_NUM=${{ github.event.pull_request.number }}
ARTIFACT_NAME="${ARTIFACT_NAME}-pr[${PR_NUM}]"
fi
ARTIFACT_NAME="${ARTIFACT_NAME}-sha[${PR_SHA}]"
if [ ! -z "${{ github.event.pull_request.title }}" ]; then
PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr -cd '[a-zA-Z0-9[:space:]]_-')
ARTIFACT_NAME="${ARTIFACT_NAME}-title["${PR_TITLE}""
fi
else
SHA=$(git rev-parse --short "$GITHUB_SHA")
ARTIFACT_NAME="PCSX2-${ARCH}-${SIMD}-sha[${SHA}"
fi
TRIMMED_ARTIFACT_NAME=$(printf "%.199s]" "$ARTIFACT_NAME")
echo "name=$TRIMMED_ARTIFACT_NAME"
echo "##[set-output name=name;]${TRIMMED_ARTIFACT_NAME}"
echo "##[set-output name=arch;]${ARCH}"
echo "##[set-output name=simd;]${SIMD}"
- name: Upload artifact
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: ${{ steps.artifact-metadata.outputs.name }}
path: |
./bin
!./bin/**/*.bsc
!./bin/**/*.exp
!./bin/**/*.ilk
!./bin/**/*.iobj
!./bin/**/*.ipdb
!./bin/**/*.pdb
!./bin/**/*.lib
- name: Upload artifact - with symbols
if: matrix.configuration != 'CMake'
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: ${{ steps.artifact-metadata.outputs.name }}-symbols
path: ./bin/**/*.pdb
# ---- Release / Tagging related steps ----
- name: Prepare Build Artifacts
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.configuration != 'CMake'
run: |
mkdir -p ./ci-artifacts/
7z a ./ci-artifacts/windows-${{ steps.artifact-metadata.outputs.arch }}-${{ steps.artifact-metadata.outputs.simd }}.7z ./bin/* '-xr!*bsc' '-xr!*.exp' '-xr!*.ilk' '-xr!*.iobj' '-xr!*.ipdb' '-xr!*.pdb' '-xr!*.lib'
7z a ./ci-artifacts/windows-${{ steps.artifact-metadata.outputs.arch }}-${{ steps.artifact-metadata.outputs.simd }}-symbols.7z ./bin/*.pdb
ls ./ci-artifacts/
- name: Upload Assets and Potential Publish Release
if: github.repository == 'PCSX2/pcsx2' && startsWith(github.ref, 'refs/tags/') && matrix.configuration != 'CMake'
env:
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
ASSET_DIR: ${{ github.WORKSPACE }}/ci-artifacts
ASSET_EXTENSION: 7z
TAG_TO_SEARCH_FOR: ${{ github.REF }}
run: |
cd ./.github/workflows/scripts/releases/upload-release-artifacts
npm ci
node index.js

View File

@@ -0,0 +1,68 @@
name: 🖥️ Windows Builds
on:
push:
branches:
- '*'
pull_request:
branches:
- master
jobs:
# MSBUILD
lint_vs_proj_files:
name: Lint VS Project Files
runs-on: windows-2019
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Verify VS Project Files
run: .github\workflows\scripts\windows\validate-vs-filters.ps1
build_wx_sse4:
needs: lint_vs_proj_files
name: "SSE4"
uses: ./.github/workflows/windows_build_wx.yml
with:
jobName: wxWidgets
configuration: Release
simd: "SSE4"
secrets: inherit
build_wx_avx2:
needs: lint_vs_proj_files
name: "AVX2"
uses: ./.github/workflows/windows_build_wx.yml
with:
jobName: wxWidgets
configuration: Release AVX2
secrets: inherit
build_qt_sse4:
needs: lint_vs_proj_files
name: "SSE4"
uses: ./.github/workflows/windows_build_qt.yml
with:
jobName: Qt
configuration: Release
simd: "SSE4"
secrets: inherit
build_qt_avx2:
needs: lint_vs_proj_files
name: "AVX2"
uses: ./.github/workflows/windows_build_qt.yml
with:
jobName: Qt
configuration: Release AVX2
secrets: inherit
# CMAKE
build_wx_avx2_cmake:
name: "CMake AVX2"
uses: ./.github/workflows/windows_build_wx.yml
with:
jobName: wxWidgets
configuration: CMake
buildSystem: cmake
secrets: inherit

109
.github/workflows/windows_build_qt.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
name: Windows Build Steps - Qt
on:
workflow_call:
inputs:
jobName:
required: true
type: string
os:
required: false
type: string
default: windows-2019
platform:
required: false
type: string
default: x64
configuration:
required: true
type: string
simd:
required: false
type: string
default: AVX2
buildSystem:
required: false
type: string
default: msbuild
qt_binary_url:
required: false
type: string
default: https://github.com/PCSX2/pcsx2-windows-dependencies/releases/download/2022-07-24/qt-6.3.1-x64.7z
jobs:
build_windows_qt:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 60
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_COMPRESS_LEVEL: 9
BUILDCACHE_MAX_CACHE_SIZE: 536870912 # 512MB
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_LOG_FILE: ${{ github.workspace }}\buildcache.log
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
env:
OS: windows
BUILD_SYSTEM: ${{ inputs.buildSystem }}
GUI_FRAMEWORK: Qt
ARCH: ${{ inputs.platform }}
SIMD: ${{ inputs.simd }}
EVENT_NAME: ${{ github.event_name }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh
- name: Setup msbuild
if: inputs.configuration != 'CMake'
uses: microsoft/setup-msbuild@v1
- name: Download Qt build files
shell: cmd
run: |
cd 3rdparty\qt
aria2c ${{ inputs.qt_binary_url }}
7z x qt-*-x64.7z
del qt-*-x64.7z
- name: Build PCSX2
shell: cmd
run: |
if "${{ inputs.configuration }}"=="CMake" (
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
cmake --build build --config ${{ steps.cmake.outputs.buildtype }}
) else (
msbuild "PCSX2_qt.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}"
)
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
path: |
./bin
!./bin/**/*.bsc
!./bin/**/*.exp
!./bin/**/*.ilk
!./bin/**/*.iobj
!./bin/**/*.ipdb
!./bin/**/*.pdb
!./bin/**/*.lib
- name: Upload artifact - with symbols
if: inputs.configuration != 'CMake'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
path: ./bin/**/*.pdb

123
.github/workflows/windows_build_wx.yml vendored Normal file
View File

@@ -0,0 +1,123 @@
name: Windows Build Steps - wxWidgets
on:
workflow_call:
inputs:
jobName:
required: true
type: string
os:
required: false
type: string
default: windows-2019
platform:
required: false
type: string
default: x64
simd:
required: false
type: string
default: AVX2
buildSystem:
required: false
type: string
default: msbuild
configuration:
required: true
type: string
jobs:
build_windows_wx:
name: ${{ inputs.jobName }}
runs-on: ${{ inputs.os }}
# Set some sort of timeout in the event of run-away builds. We are limited on concurrent jobs so, get rid of them.
timeout-minutes: 60
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
BUILDCACHE_COMPRESS_FORMAT: ZSTD
BUILDCACHE_COMPRESS_LEVEL: 9
BUILDCACHE_MAX_CACHE_SIZE: 536870912 # 512MB
BUILDCACHE_DIRECT_MODE: true
BUILDCACHE_LOG_FILE: ${{ github.workspace }}\buildcache.log
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Prepare Artifact Metadata
id: artifact-metadata
shell: bash
env:
OS: windows
BUILD_SYSTEM: ${{ inputs.buildSystem }}
GUI_FRAMEWORK: wxWidgets
ARCH: ${{ inputs.platform }}
SIMD: ${{ inputs.simd }}
EVENT_NAME: ${{ github.event_name }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUM: ${{ github.event.pull_request.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
run: ./.github/workflows/scripts/common/name-artifacts.sh
- name: Setup Buildcache
if: inputs.configuration == 'CMake' # TODO: buildcache on VS
uses: mikehardy/buildcache-action@v1.3.0
with:
cache_key: ${{ inputs.os }} ${{ inputs.platform }} ${{ inputs.configuration }}
- name: Setup msbuild
if: inputs.configuration != 'CMake'
uses: microsoft/setup-msbuild@v1
- name: Generate CMake
if: inputs.configuration == 'CMake'
id: cmake
shell: cmd
run: |
if "${{ github.event.inputs.retainDebugArtifacts }}"=="true" (SET type=RelWithDebInfo) else (SET type=Release)
if "${{ inputs.platform }}"=="Win32" (SET vcvars=vcvarsamd64_x86.bat) else (SET vcvars=vcvars64.bat)
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\%vcvars%"
echo ::set-output name=buildtype::%type%
echo ::set-output name=vcvars::%vcvars%
cmake . -B build -DCMAKE_BUILD_TYPE=%type% -DLTO_PCSX2_CORE=ON -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_CXX_COMPILER_LAUNCHER=..\buildcache\bin\buildcache.exe -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
- name: Build PCSX2
shell: cmd
run: |
if "${{ inputs.configuration }}"=="CMake" (
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
cmake --build build --config ${{ steps.cmake.outputs.buildtype }}
cp build/pcsx2/pcsx2* bin/
) else (
msbuild "PCSX2_suite.sln" /m /v:m /p:Configuration="${{ inputs.configuration }}" /p:Platform="${{ inputs.platform }}"
)
- name: Run Tests
if: inputs.configuration == 'CMake'
shell: cmd
run: |
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\${{ steps.cmake.outputs.vcvars }}"
cmake --build build --config ${{ steps.cmake.outputs.buildtype }} --target unittests
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}
path: |
./bin
!./bin/**/*.bsc
!./bin/**/*.exp
!./bin/**/*.ilk
!./bin/**/*.iobj
!./bin/**/*.ipdb
!./bin/**/*.pdb
!./bin/**/*.lib
- name: Upload artifact - with symbols
if: inputs.configuration != 'CMake'
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
path: ./bin/**/*.pdb

29
.gitignore vendored
View File

@@ -48,8 +48,7 @@ Thumbs.db
Debug.txt
install_log.txt
padLog.txt
GS_opengl_debug_hw.txt
GS_opengl_debug_sw.txt
GS_opengl_debug.txt
Debug
Release
@@ -69,17 +68,22 @@ oprofile_data/
/.vscode*
/bin/**/*.dll
/bin/**/*.dmp
/bin/**/*.exp
/bin/**/*.ilk
/bin/**/*.lib
/bin/**/*.pdb
/bin/PCSX2
/bin/pcsx2
/bin/PCSX2-linux.sh
/bin/*ReplayLoader
/bin/PCSX2-linux.sh
/bin/GS*.txt
/bin/qt.conf
/bin/bios
/bin/cache
/bin/cheats
/bin/covers
/bin/dumps
/bin/gamesettings
/bin/help
/bin/inis
/bin/logs
@@ -87,24 +91,13 @@ oprofile_data/
/bin/plugins
/bin/snaps
/bin/sstates
/bin/textures
/bin/translations
/bin/inputprofiles
/deps
/ipch
!/3rdparty/libjpeg/change.log
/3rdparty/portaudio/portaudio-2.0.pc
/3rdparty/portaudio/bin
/3rdparty/portaudio/bin-*
/3rdparty/portaudio/autom4te.cache
/3rdparty/portaudio/libtool
/3rdparty/portaudio/config.*
/3rdparty/portaudio/lib-stamp
/3rdparty/portaudio/Makefile
/3rdparty/portaudio/bindings
/3rdparty/portaudio/test
/3rdparty/portaudio/testcvs
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/common
/3rdparty/portaudio/src/hostapi/asio/ASIOSDK/host
/3rdparty/portaudio/src/hostapi/wasapi/mingw-include
/3rdparty/**/include/wx/setup.h
/3rdparty/**/wx/msw/rcdefs.h
/pcsx2/gui/Resources/*.h

33
.gitmodules vendored
View File

@@ -1,24 +1,41 @@
[submodule "3rdparty/xz/xz"]
path = 3rdparty/xz/xz
url = https://github.com/PCSX2/xz.git
shallow = true
[submodule "3rdparty/gtest"]
path = 3rdparty/gtest
url = https://github.com/google/googletest.git
shallow = true
[submodule "3rdparty/fmt/fmt"]
path = 3rdparty/fmt/fmt
url = https://github.com/fmtlib/fmt.git
shallow = true
[submodule "3rdparty/yaml-cpp/yaml-cpp"]
path = 3rdparty/yaml-cpp/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
shallow = true
[submodule "3rdparty/libchdr/libchdr"]
path = 3rdparty/libchdr/libchdr
url = https://github.com/rtissera/libchdr.git
shallow = true
[submodule "3rdparty/wil"]
path = 3rdparty/wil
url = https://github.com/microsoft/wil.git
branch = master
[submodule "3rdparty/cubeb/cubeb"]
path = 3rdparty/cubeb/cubeb
url = https://github.com/mozilla/cubeb.git
[submodule "3rdparty/rapidyaml/rapidyaml"]
path = 3rdparty/rapidyaml/rapidyaml
url = https://github.com/biojppm/rapidyaml.git
branch = master
[submodule "3rdparty/imgui/imgui"]
path = 3rdparty/imgui/imgui
url = https://github.com/ocornut/imgui.git
[submodule "3rdparty/glslang/glslang"]
path = 3rdparty/glslang/glslang
url = https://github.com/KhronosGroup/glslang.git
[submodule "3rdparty/vulkan-headers"]
path = 3rdparty/vulkan-headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "3rdparty/sdl2/SDL"]
path = 3rdparty/sdl2/SDL
url = https://github.com/libsdl-org/SDL.git
[submodule "3rdparty/libzip/libzip"]
path = 3rdparty/libzip/libzip
url = https://github.com/nih-at/libzip.git
[submodule "3rdparty/zstd/zstd"]
path = 3rdparty/zstd/zstd
url = https://github.com/facebook/zstd.git

8
.prettierrc.yaml Normal file
View File

@@ -0,0 +1,8 @@
overrides:
- files: "**/GameIndex.yaml"
options:
tabWidth: 2
useTabs: false
quoteProps: consistent
endOfLine: auto
proseWrap: preserve

21
3rdparty/cpuinfo/.gitignore vendored Normal file
View File

@@ -0,0 +1,21 @@
# Ninja files
build.ninja
# Build objects and artifacts
deps/
build/
bin/
lib/
libs/
obj/
*.pyc
*.pyo
# System files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

223
3rdparty/cpuinfo/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,223 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
# ---[ Setup project
PROJECT(
cpuinfo
LANGUAGES C CXX
)
# ---[ Options.
SET(CPUINFO_LIBRARY_TYPE "default" CACHE STRING "Type of cpuinfo library (shared, static, or default) to build")
SET_PROPERTY(CACHE CPUINFO_LIBRARY_TYPE PROPERTY STRINGS default static shared)
SET(CPUINFO_RUNTIME_TYPE "default" CACHE STRING "Type of runtime library (shared, static, or default) to use")
SET_PROPERTY(CACHE CPUINFO_RUNTIME_TYPE PROPERTY STRINGS default static shared)
SET(CPUINFO_LOG_LEVEL "default" CACHE STRING "Minimum logging level (info with lower severity will be ignored)")
SET_PROPERTY(CACHE CPUINFO_LOG_LEVEL PROPERTY STRINGS default debug info warning error fatal none)
MACRO(CPUINFO_TARGET_ENABLE_C99 target)
SET_TARGET_PROPERTIES(${target} PROPERTIES
C_STANDARD 99
C_EXTENSIONS NO)
ENDMACRO()
MACRO(CPUINFO_TARGET_ENABLE_CXX11 target)
SET_TARGET_PROPERTIES(${target} PROPERTIES
CXX_STANDARD 11
CXX_EXTENSIONS NO)
ENDMACRO()
MACRO(CPUINFO_TARGET_RUNTIME_LIBRARY target)
IF(MSVC AND NOT CPUINFO_RUNTIME_TYPE STREQUAL "default")
IF(CPUINFO_RUNTIME_TYPE STREQUAL "shared")
TARGET_COMPILE_OPTIONS(${target} PRIVATE
"/MD$<$<CONFIG:Debug>:d>")
ELSEIF(CPUINFO_RUNTIME_TYPE STREQUAL "static")
TARGET_COMPILE_OPTIONS(${target} PRIVATE
"/MT$<$<CONFIG:Debug>:d>")
ENDIF()
ENDIF()
ENDMACRO()
# -- [ Determine target processor
SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_OSX_ARCHITECTURES MATCHES "^(x86_64|arm64)$")
SET(CPUINFO_TARGET_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
ENDIF()
# ---[ Build flags
SET(CPUINFO_SUPPORTED_PLATFORM TRUE)
IF(NOT CMAKE_SYSTEM_PROCESSOR)
IF(NOT IOS)
MESSAGE(WARNING
"Target processor architecture is not specified. "
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
ENDIF()
ELSEIF(NOT CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?|armv[5-8].*|aarch64|arm64)$")
MESSAGE(WARNING
"Target processor architecture \"${CPUINFO_TARGET_PROCESSOR}\" is not supported in cpuinfo. "
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
ENDIF()
IF(NOT CMAKE_SYSTEM_NAME)
MESSAGE(WARNING
"Target operating system is not specified. "
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
ELSEIF(NOT CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS|Darwin|Linux|Android)$")
IF(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14" AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
MESSAGE(WARNING
"Target operating system \"${CMAKE_SYSTEM_NAME}\" is not supported in cpuinfo. "
"cpuinfo will compile, but cpuinfo_initialize() will always fail.")
SET(CPUINFO_SUPPORTED_PLATFORM FALSE)
ENDIF()
ENDIF()
# ---[ cpuinfo library
SET(CPUINFO_SRCS
src/init.c
src/api.c
src/cache.c)
IF(CPUINFO_SUPPORTED_PLATFORM)
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten" AND (CPUINFO_TARGET_PROCESSOR MATCHES "^(i[3-6]86|AMD64|x86(_64)?)$" OR IOS_ARCH MATCHES "^(i386|x86_64)$"))
LIST(APPEND CPUINFO_SRCS
src/x86/init.c
src/x86/info.c
src/x86/vendor.c
src/x86/uarch.c
src/x86/name.c
src/x86/topology.c
src/x86/isa.c
src/x86/cache/init.c
src/x86/cache/descriptor.c
src/x86/cache/deterministic.c)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
LIST(APPEND CPUINFO_SRCS
src/x86/linux/init.c
src/x86/linux/cpuinfo.c)
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
LIST(APPEND CPUINFO_SRCS src/x86/mach/init.c)
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$")
LIST(APPEND CPUINFO_SRCS src/x86/windows/init.c)
ENDIF()
ELSEIF(CPUINFO_TARGET_PROCESSOR MATCHES "^(armv[5-8].*|aarch64|arm64)$" OR IOS_ARCH MATCHES "^(armv7.*|arm64.*)$")
LIST(APPEND CPUINFO_SRCS
src/arm/uarch.c
src/arm/cache.c)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
LIST(APPEND CPUINFO_SRCS
src/arm/linux/init.c
src/arm/linux/cpuinfo.c
src/arm/linux/clusters.c
src/arm/linux/chipset.c
src/arm/linux/midr.c
src/arm/linux/hwcap.c)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv[5-8]")
LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch32-isa.c)
IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND ANDROID_ABI STREQUAL "armeabi")
SET_SOURCE_FILES_PROPERTIES(src/arm/linux/aarch32-isa.c PROPERTIES COMPILE_FLAGS -marm)
ENDIF()
ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
LIST(APPEND CPUINFO_SRCS src/arm/linux/aarch64-isa.c)
ENDIF()
ELSEIF(IOS OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CPUINFO_TARGET_PROCESSOR STREQUAL "arm64"))
LIST(APPEND CPUINFO_SRCS src/arm/mach/init.c)
ENDIF()
IF(CMAKE_SYSTEM_NAME STREQUAL "Android")
LIST(APPEND CPUINFO_SRCS
src/arm/android/properties.c)
ENDIF()
ENDIF()
IF(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
LIST(APPEND CPUINFO_SRCS
src/emscripten/init.c)
ENDIF()
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
LIST(APPEND CPUINFO_SRCS
src/linux/smallfile.c
src/linux/multiline.c
src/linux/cpulist.c
src/linux/processors.c)
ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
LIST(APPEND CPUINFO_SRCS src/mach/topology.c)
ENDIF()
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
SET(CMAKE_THREAD_PREFER_PTHREAD TRUE)
SET(THREADS_PREFER_PTHREAD_FLAG TRUE)
FIND_PACKAGE(Threads REQUIRED)
ENDIF()
ENDIF()
IF(CPUINFO_LIBRARY_TYPE STREQUAL "default")
ADD_LIBRARY(cpuinfo ${CPUINFO_SRCS})
ELSEIF(CPUINFO_LIBRARY_TYPE STREQUAL "shared")
ADD_LIBRARY(cpuinfo SHARED ${CPUINFO_SRCS})
ELSEIF(CPUINFO_LIBRARY_TYPE STREQUAL "static")
ADD_LIBRARY(cpuinfo STATIC ${CPUINFO_SRCS})
ELSE()
MESSAGE(FATAL_ERROR "Unsupported library type ${CPUINFO_LIBRARY_TYPE}")
ENDIF()
ADD_LIBRARY(cpuinfo_internals STATIC ${CPUINFO_SRCS})
CPUINFO_TARGET_ENABLE_C99(cpuinfo)
CPUINFO_TARGET_ENABLE_C99(cpuinfo_internals)
CPUINFO_TARGET_RUNTIME_LIBRARY(cpuinfo)
IF(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN|MSYS)$")
# Target Windows 7+ API
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE _WIN32_WINNT=0x0601)
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE _WIN32_WINNT=0x0601)
ENDIF()
SET_TARGET_PROPERTIES(cpuinfo PROPERTIES PUBLIC_HEADER include/cpuinfo.h)
TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PUBLIC include)
TARGET_INCLUDE_DIRECTORIES(cpuinfo BEFORE PRIVATE src)
TARGET_INCLUDE_DIRECTORIES(cpuinfo_internals BEFORE PUBLIC include src)
IF(CPUINFO_LOG_LEVEL STREQUAL "default")
# default logging level: error (subject to change)
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=2)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "debug")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=5)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "info")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=4)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "warning")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=3)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "error")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=2)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "fatal")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=1)
ELSEIF(CPUINFO_LOG_LEVEL STREQUAL "none")
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE CPUINFO_LOG_LEVEL=0)
ELSE()
MESSAGE(FATAL_ERROR "Unsupported logging level ${CPUINFO_LOG_LEVEL}")
ENDIF()
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE CPUINFO_LOG_LEVEL=0)
IF(CPUINFO_SUPPORTED_PLATFORM)
TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=1)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android")
TARGET_LINK_LIBRARIES(cpuinfo PUBLIC ${CMAKE_THREAD_LIBS_INIT})
TARGET_LINK_LIBRARIES(cpuinfo_internals PUBLIC ${CMAKE_THREAD_LIBS_INIT})
TARGET_COMPILE_DEFINITIONS(cpuinfo PRIVATE _GNU_SOURCE=1)
TARGET_COMPILE_DEFINITIONS(cpuinfo_internals PRIVATE _GNU_SOURCE=1)
ENDIF()
ELSE()
TARGET_COMPILE_DEFINITIONS(cpuinfo INTERFACE CPUINFO_SUPPORTED_PLATFORM=0)
ENDIF()
# ---[ cpuinfo dependencies: clog
IF(NOT DEFINED CLOG_SOURCE_DIR)
SET(CLOG_SOURCE_DIR "${PROJECT_SOURCE_DIR}/deps/clog")
ENDIF()
IF(NOT TARGET clog)
SET(CLOG_BUILD_TESTS OFF CACHE BOOL "")
SET(CLOG_RUNTIME_TYPE "${CPUINFO_RUNTIME_TYPE}" CACHE STRING "")
ADD_SUBDIRECTORY(
"${CLOG_SOURCE_DIR}")
# We build static version of clog but a dynamic library may indirectly depend on it
SET_PROPERTY(TARGET clog PROPERTY POSITION_INDEPENDENT_CODE ON)
ENDIF()
TARGET_LINK_LIBRARIES(cpuinfo PRIVATE clog)
TARGET_LINK_LIBRARIES(cpuinfo_internals PRIVATE clog)

27
3rdparty/cpuinfo/LICENSE vendored Normal file
View File

@@ -0,0 +1,27 @@
Copyright (c) 2019 Google LLC
Copyright (c) 2017-2018 Facebook Inc.
Copyright (C) 2012-2017 Georgia Institute of Technology
Copyright (C) 2010-2012 Marat Dukhan
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

283
3rdparty/cpuinfo/README.md vendored Normal file
View File

@@ -0,0 +1,283 @@
# CPU INFOrmation library
[![BSD (2 clause) License](https://img.shields.io/badge/License-BSD%202--Clause%20%22Simplified%22%20License-blue.svg)](https://github.com/pytorch/cpuinfo/blob/master/LICENSE)
[![Linux/Mac build status](https://img.shields.io/travis/pytorch/cpuinfo.svg)](https://travis-ci.org/pytorch/cpuinfo)
[![Windows build status](https://ci.appveyor.com/api/projects/status/g5khy9nr0xm458t7/branch/master?svg=true)](https://ci.appveyor.com/project/MaratDukhan/cpuinfo/branch/master)
cpuinfo is a library to detect essential for performance optimization information about host CPU.
## Features
- **Cross-platform** availability:
- Linux, Windows, macOS, Android, and iOS operating systems
- x86, x86-64, ARM, and ARM64 architectures
- Modern **C/C++ interface**
- Thread-safe
- No memory allocation after initialization
- No exceptions thrown
- Detection of **supported instruction sets**, up to AVX512 (x86) and ARMv8.3 extensions
- Detection of SoC and core information:
- **Processor (SoC) name**
- Vendor and **microarchitecture** for each CPU core
- ID (**MIDR** on ARM, **CPUID** leaf 1 EAX value on x86) for each CPU core
- Detection of **cache information**:
- Cache type (instruction/data/unified), size and line size
- Cache associativity
- Cores and logical processors (hyper-threads) sharing the cache
- Detection of **topology information** (relative between logical processors, cores, and processor packages)
- Well-tested **production-quality** code:
- 60+ mock tests based on data from real devices
- Includes work-arounds for common bugs in hardware and OS kernels
- Supports systems with heterogenous cores, such as **big.LITTLE** and Max.Med.Min
- Permissive **open-source** license (Simplified BSD)
## Examples
Log processor name:
```c
cpuinfo_initialize();
printf("Running on %s CPU\n", cpuinfo_get_package(0)->name);
```
Detect if target is a 32-bit or 64-bit ARM system:
```c
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
/* 32-bit ARM-specific code here */
#endif
```
Check if the host CPU support ARM NEON
```c
cpuinfo_initialize();
if (cpuinfo_has_arm_neon()) {
neon_implementation(arguments);
}
```
Check if the host CPU supports x86 AVX
```c
cpuinfo_initialize();
if (cpuinfo_has_x86_avx()) {
avx_implementation(arguments);
}
```
Check if the thread runs on a Cortex-A53 core
```c
cpuinfo_initialize();
switch (cpuinfo_get_current_core()->uarch) {
case cpuinfo_uarch_cortex_a53:
cortex_a53_implementation(arguments);
break;
default:
generic_implementation(arguments);
break;
}
```
Get the size of level 1 data cache on the fastest core in the processor (e.g. big core in big.LITTLE ARM systems):
```c
cpuinfo_initialize();
const size_t l1_size = cpuinfo_get_processor(0)->cache.l1d->size;
```
Pin thread to cores sharing L2 cache with the current core (Linux or Android)
```c
cpuinfo_initialize();
cpu_set_t cpu_set;
CPU_ZERO(&cpu_set);
const struct cpuinfo_cache* current_l2 = cpuinfo_get_current_processor()->cache.l2;
for (uint32_t i = 0; i < current_l2->processor_count; i++) {
CPU_SET(cpuinfo_get_processor(current_l2->processor_start + i)->linux_id, &cpu_set);
}
pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpu_set);
```
## Use via pkg-config
If you would like to provide your project's build environment with the necessary compiler and linker flags in a portable manner, the library by default when built enables `CPUINFO_BUILD_PKG_CONFIG` and will generate a [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) manifest (_libcpuinfo.pc_). Here are several examples of how to use it:
### Command Line
If you used your distro's package manager to install the library, you can verify that it is available to your build environment like so:
```console
$ pkg-config --cflags --libs libcpuinfo
-I/usr/include/x86_64-linux-gnu/ -L/lib/x86_64-linux-gnu/ -lcpuinfo
```
If you have installed the library from source into a non-standard prefix, pkg-config may need help finding it:
```console
$ PKG_CONFIG_PATH="/home/me/projects/cpuinfo/prefix/lib/pkgconfig/:$PKG_CONFIG_PATH" pkg-config --cflags --libs libcpuinfo
-I/home/me/projects/cpuinfo/prefix/include -L/home/me/projects/cpuinfo/prefix/lib -lcpuinfo
```
### GNU Autotools
To [use](https://autotools.io/pkgconfig/pkg_check_modules.html) with the GNU Autotools include the following snippet in your project's `configure.ac`:
```makefile
# CPU INFOrmation library...
PKG_CHECK_MODULES(
[libcpuinfo], [libcpuinfo], [],
[AC_MSG_ERROR([libcpuinfo missing...])])
YOURPROJECT_CXXFLAGS="$YOURPROJECT_CXXFLAGS $libcpuinfo_CFLAGS"
YOURPROJECT_LIBS="$YOURPROJECT_LIBS $libcpuinfo_LIBS"
```
### Meson
To use with Meson you just need to add `dependency('libcpuinfo')` as a dependency for your executable.
```meson
project(
'MyCpuInfoProject',
'cpp',
meson_version: '>=0.55.0'
)
executable(
'MyCpuInfoExecutable',
sources: 'main.cpp',
dependencies: dependency('libcpuinfo')
)
```
### CMake
To use with CMake use the [FindPkgConfig](https://cmake.org/cmake/help/latest/module/FindPkgConfig.html) module. Here is an example:
```cmake
cmake_minimum_required(VERSION 3.6)
project("MyCpuInfoProject")
find_package(PkgConfig)
pkg_check_modules(CpuInfo REQUIRED IMPORTED_TARGET libcpuinfo)
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PkgConfig::CpuInfo)
```
### Makefile
To use within a vanilla makefile, you can call pkg-config directly to supply compiler and linker flags using shell substitution.
```makefile
CFLAGS=-g3 -Wall -Wextra -Werror ...
LDFLAGS=-lfoo ...
...
CFLAGS+= $(pkg-config --cflags libcpuinfo)
LDFLAGS+= $(pkg-config --libs libcpuinfo)
```
## Exposed information
- [x] Processor (SoC) name
- [x] Microarchitecture
- [x] Usable instruction sets
- [ ] CPU frequency
- [x] Cache
- [x] Size
- [x] Associativity
- [x] Line size
- [x] Number of partitions
- [x] Flags (unified, inclusive, complex hash function)
- [x] Topology (logical processors that share this cache level)
- [ ] TLB
- [ ] Number of entries
- [ ] Associativity
- [ ] Covered page types (instruction, data)
- [ ] Covered page sizes
- [x] Topology information
- [x] Logical processors
- [x] Cores
- [x] Packages (sockets)
## Supported environments:
- [x] Android
- [x] x86 ABI
- [x] x86_64 ABI
- [x] armeabi ABI
- [x] armeabiv7-a ABI
- [x] arm64-v8a ABI
- [ ] ~~mips ABI~~
- [ ] ~~mips64 ABI~~
- [x] Linux
- [x] x86
- [x] x86-64
- [x] 32-bit ARM (ARMv5T and later)
- [x] ARM64
- [ ] PowerPC64
- [x] iOS
- [x] x86 (iPhone simulator)
- [x] x86-64 (iPhone simulator)
- [x] ARMv7
- [x] ARM64
- [x] OS X
- [x] x86
- [x] x86-64
- [x] Windows
- [x] x86
- [x] x86-64
## Methods
- Processor (SoC) name detection
- [x] Using CPUID leaves 0x800000020x80000004 on x86/x86-64
- [x] Using `/proc/cpuinfo` on ARM
- [x] Using `ro.chipname`, `ro.board.platform`, `ro.product.board`, `ro.mediatek.platform`, `ro.arch` properties (Android)
- [ ] Using kernel log (`dmesg`) on ARM Linux
- Vendor and microarchitecture detection
- [x] Intel-designed x86/x86-64 cores (up to Sunny Cove, Goldmont Plus, and Knights Mill)
- [x] AMD-designed x86/x86-64 cores (up to Puma/Jaguar and Zen 2)
- [ ] VIA-designed x86/x86-64 cores
- [ ] Other x86 cores (DM&P, RDC, Transmeta, Cyrix, Rise)
- [x] ARM-designed ARM cores (up to Cortex-A55, Cortex-A77, and Neoverse E1/N1)
- [x] Qualcomm-designed ARM cores (Scorpion, Krait, and Kryo)
- [x] Nvidia-designed ARM cores (Denver and Carmel)
- [x] Samsung-designed ARM cores (Exynos)
- [x] Intel-designed ARM cores (XScale up to 3rd-gen)
- [x] Apple-designed ARM cores (up to Lightning and Thunder)
- [x] Cavium-designed ARM cores (ThunderX)
- [x] AppliedMicro-designed ARM cores (X-Gene)
- Instruction set detection
- [x] Using CPUID (x86/x86-64)
- [x] Using `/proc/cpuinfo` on 32-bit ARM EABI (Linux)
- [x] Using microarchitecture heuristics on (32-bit ARM)
- [x] Using `FPSID` and `WCID` registers (32-bit ARM)
- [x] Using `getauxval` (Linux/ARM)
- [x] Using `/proc/self/auxv` (Android/ARM)
- [ ] Using instruction probing on ARM (Linux)
- [ ] Using CPUID registers on ARM64 (Linux)
- Cache detection
- [x] Using CPUID leaf 0x00000002 (x86/x86-64)
- [x] Using CPUID leaf 0x00000004 (non-AMD x86/x86-64)
- [ ] Using CPUID leaves 0x80000005-0x80000006 (AMD x86/x86-64)
- [x] Using CPUID leaf 0x8000001D (AMD x86/x86-64)
- [x] Using `/proc/cpuinfo` (Linux/pre-ARMv7)
- [x] Using microarchitecture heuristics (ARM)
- [x] Using chipset name (ARM)
- [x] Using `sysctlbyname` (Mach)
- [x] Using sysfs `typology` directories (ARM/Linux)
- [ ] Using sysfs `cache` directories (Linux)
- TLB detection
- [x] Using CPUID leaf 0x00000002 (x86/x86-64)
- [ ] Using CPUID leaves 0x80000005-0x80000006 and 0x80000019 (AMD x86/x86-64)
- [x] Using microarchitecture heuristics (ARM)
- Topology detection
- [x] Using CPUID leaf 0x00000001 on x86/x86-64 (legacy APIC ID)
- [x] Using CPUID leaf 0x0000000B on x86/x86-64 (Intel APIC ID)
- [ ] Using CPUID leaf 0x8000001E on x86/x86-64 (AMD APIC ID)
- [x] Using `/proc/cpuinfo` (Linux)
- [x] Using `host_info` (Mach)
- [x] Using `GetLogicalProcessorInformationEx` (Windows)
- [x] Using sysfs (Linux)
- [x] Using chipset name (ARM/Linux)

View File

@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(SolutionDir)common\vsprops\BaseProjectConfig.props" />
<Import Project="$(SolutionDir)common\vsprops\WinSDK.props" />
<PropertyGroup Label="Globals">
<ProjectGuid>{48329442-E41B-4A1F-8364-36EEE1B71343}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{7E183337-A7E9-460C-9D3D-568BC9F9BCC1}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
@@ -29,47 +28,42 @@
<PropertyGroup>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="deps\clog\src\clog.c" />
<ClCompile Include="src\api.c" />
<ClCompile Include="src\cache.c" />
<ClCompile Include="src\init.c" />
<ClCompile Include="src\x86\cache\descriptor.c" />
<ClCompile Include="src\x86\cache\deterministic.c" />
<ClCompile Include="src\x86\cache\init.c" />
<ClCompile Include="src\x86\info.c" />
<ClCompile Include="src\x86\init.c" />
<ClCompile Include="src\x86\isa.c" />
<ClCompile Include="src\x86\name.c" />
<ClCompile Include="src\x86\topology.c" />
<ClCompile Include="src\x86\uarch.c" />
<ClCompile Include="src\x86\vendor.c" />
<ClCompile Include="src\x86\windows\init.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="deps\clog\include\clog.h" />
<ClInclude Include="include\cpuinfo.h" />
<ClInclude Include="src\cpuinfo\common.h" />
<ClInclude Include="src\cpuinfo\internal-api.h" />
<ClInclude Include="src\cpuinfo\log.h" />
<ClInclude Include="src\cpuinfo\utils.h" />
<ClInclude Include="src\x86\api.h" />
<ClInclude Include="src\x86\cpuid.h" />
<ClInclude Include="src\x86\windows\api.h" />
</ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>TurnOffAllWarnings</WarningLevel>
<AdditionalIncludeDirectories>$(ProjectDir)/yaml-cpp/include/;$(ProjectDir)/yaml-cpp/src/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir)include;$(ProjectDir)src;$(ProjectDir)deps\clog\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ObjectFileName>$(IntDir)%(RelativeDir)</ObjectFileName>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="yaml-cpp\src\contrib\graphbuilder.cpp" />
<ClCompile Include="yaml-cpp\src\contrib\graphbuilderadapter.cpp" />
<ClCompile Include="yaml-cpp\src\binary.cpp" />
<ClCompile Include="yaml-cpp\src\convert.cpp" />
<ClCompile Include="yaml-cpp\src\depthguard.cpp" />
<ClCompile Include="yaml-cpp\src\directives.cpp" />
<ClCompile Include="yaml-cpp\src\emit.cpp" />
<ClCompile Include="yaml-cpp\src\emitfromevents.cpp" />
<ClCompile Include="yaml-cpp\src\emitter.cpp" />
<ClCompile Include="yaml-cpp\src\emitterstate.cpp" />
<ClCompile Include="yaml-cpp\src\emitterutils.cpp" />
<ClCompile Include="yaml-cpp\src\exceptions.cpp" />
<ClCompile Include="yaml-cpp\src\exp.cpp" />
<ClCompile Include="yaml-cpp\src\memory.cpp" />
<ClCompile Include="yaml-cpp\src\node.cpp" />
<ClCompile Include="yaml-cpp\src\node_data.cpp" />
<ClCompile Include="yaml-cpp\src\nodebuilder.cpp" />
<ClCompile Include="yaml-cpp\src\nodeevents.cpp" />
<ClCompile Include="yaml-cpp\src\null.cpp" />
<ClCompile Include="yaml-cpp\src\ostream_wrapper.cpp" />
<ClCompile Include="yaml-cpp\src\parse.cpp" />
<ClCompile Include="yaml-cpp\src\parser.cpp" />
<ClCompile Include="yaml-cpp\src\regex_yaml.cpp" />
<ClCompile Include="yaml-cpp\src\scanner.cpp" />
<ClCompile Include="yaml-cpp\src\scanscalar.cpp" />
<ClCompile Include="yaml-cpp\src\scantag.cpp" />
<ClCompile Include="yaml-cpp\src\scantoken.cpp" />
<ClCompile Include="yaml-cpp\src\simplekey.cpp" />
<ClCompile Include="yaml-cpp\src\singledocparser.cpp" />
<ClCompile Include="yaml-cpp\src\stream.cpp" />
<ClCompile Include="yaml-cpp\src\tag.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="x86">
<UniqueIdentifier>{8fc9f543-ff04-48fb-ae1a-7c575a8aed13}</UniqueIdentifier>
</Filter>
<Filter Include="x86\windows">
<UniqueIdentifier>{0b540baa-aafb-4e51-8cbf-b7e7c00d9a4d}</UniqueIdentifier>
</Filter>
<Filter Include="x86\descriptor">
<UniqueIdentifier>{53ef3c40-8e03-46d1-aeb3-6446c40469da}</UniqueIdentifier>
</Filter>
<Filter Include="cpuinfo">
<UniqueIdentifier>{26002d26-399a-41bb-93cb-42fb9be21c1f}</UniqueIdentifier>
</Filter>
<Filter Include="clog">
<UniqueIdentifier>{7f0aba4c-ca06-4a7b-aed1-4f1e6976e839}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\x86\isa.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\name.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\topology.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\uarch.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\vendor.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\info.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\init.c">
<Filter>x86</Filter>
</ClCompile>
<ClCompile Include="src\x86\windows\init.c">
<Filter>x86\windows</Filter>
</ClCompile>
<ClCompile Include="src\x86\cache\deterministic.c">
<Filter>x86\descriptor</Filter>
</ClCompile>
<ClCompile Include="src\x86\cache\init.c">
<Filter>x86\descriptor</Filter>
</ClCompile>
<ClCompile Include="src\x86\cache\descriptor.c">
<Filter>x86\descriptor</Filter>
</ClCompile>
<ClCompile Include="src\api.c" />
<ClCompile Include="src\cache.c" />
<ClCompile Include="src\init.c" />
<ClCompile Include="deps\clog\src\clog.c">
<Filter>clog</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\x86\api.h">
<Filter>x86</Filter>
</ClInclude>
<ClInclude Include="src\x86\cpuid.h">
<Filter>x86</Filter>
</ClInclude>
<ClInclude Include="src\x86\windows\api.h">
<Filter>x86\windows</Filter>
</ClInclude>
<ClInclude Include="src\cpuinfo\internal-api.h">
<Filter>cpuinfo</Filter>
</ClInclude>
<ClInclude Include="src\cpuinfo\log.h">
<Filter>cpuinfo</Filter>
</ClInclude>
<ClInclude Include="src\cpuinfo\utils.h">
<Filter>cpuinfo</Filter>
</ClInclude>
<ClInclude Include="src\cpuinfo\common.h">
<Filter>cpuinfo</Filter>
</ClInclude>
<ClInclude Include="include\cpuinfo.h" />
<ClInclude Include="deps\clog\include\clog.h">
<Filter>clog</Filter>
</ClInclude>
</ItemGroup>
</Project>

19
3rdparty/cpuinfo/deps/clog/.gitignore vendored Normal file
View File

@@ -0,0 +1,19 @@
# Ninja files
build.ninja
# Build objects and artifacts
deps/
build/
bin/
lib/
*.pyc
*.pyo
# System files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

View File

@@ -0,0 +1,42 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
# ---[ Project and semantic versioning.
PROJECT(clog C CXX)
# ---[ Options.
SET(CLOG_RUNTIME_TYPE "default" CACHE STRING "Type of runtime library (shared, static, or default) to use")
SET_PROPERTY(CACHE CLOG_RUNTIME_TYPE PROPERTY STRINGS default static shared)
IF(ANDROID)
OPTION(CLOG_LOG_TO_STDIO "Log errors, warnings, and information to stdout/stderr" OFF)
ELSE()
OPTION(CLOG_LOG_TO_STDIO "Log errors, warnings, and information to stdout/stderr" ON)
ENDIF()
MACRO(CLOG_TARGET_RUNTIME_LIBRARY target)
IF(MSVC AND NOT CLOG_RUNTIME_TYPE STREQUAL "default")
IF(CLOG_RUNTIME_TYPE STREQUAL "shared")
TARGET_COMPILE_OPTIONS(${target} PRIVATE
"/MD$<$<CONFIG:Debug>:d>")
ELSEIF(CLOG_RUNTIME_TYPE STREQUAL "static")
TARGET_COMPILE_OPTIONS(${target} PRIVATE
"/MT$<$<CONFIG:Debug>:d>")
ENDIF()
ENDIF()
ENDMACRO()
# ---[ clog library
ADD_LIBRARY(clog STATIC src/clog.c)
SET_TARGET_PROPERTIES(clog PROPERTIES
C_STANDARD 99
C_EXTENSIONS NO)
CLOG_TARGET_RUNTIME_LIBRARY(clog)
SET_TARGET_PROPERTIES(clog PROPERTIES PUBLIC_HEADER include/clog.h)
TARGET_INCLUDE_DIRECTORIES(clog BEFORE PUBLIC include)
IF(CLOG_LOG_TO_STDIO)
TARGET_COMPILE_DEFINITIONS(clog PRIVATE CLOG_LOG_TO_STDIO=1)
ELSE()
TARGET_COMPILE_DEFINITIONS(clog PRIVATE CLOG_LOG_TO_STDIO=0)
ENDIF()
IF(ANDROID AND NOT CLOG_LOG_TO_STDIO)
TARGET_LINK_LIBRARIES(clog PRIVATE log)
ENDIF()

26
3rdparty/cpuinfo/deps/clog/LICENSE vendored Normal file
View File

@@ -0,0 +1,26 @@
Copyright (C) 2018 Marat Dukhan
Copyright (c) 2017-2018 Facebook Inc.
Copyright (c) 2017 Georgia Institute of Technology
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

57
3rdparty/cpuinfo/deps/clog/README.md vendored Normal file
View File

@@ -0,0 +1,57 @@
# clog: C-style (a-la printf) logging library
[![BSD (2 clause) License](https://img.shields.io/badge/License-BSD%202--Clause%20%22Simplified%22%20License-blue.svg)](https://github.com/pytorch/cpuinfo/blob/master/deps/clog/LICENSE)
C-style library for logging errors, warnings, information notes, and debug information.
## Features
- printf-style interface for formatting variadic parameters.
- Separate functions for logging errors, warnings, information notes, and debug information.
- Independent logging settings for different modules.
- Logging to logcat on Android and stderr/stdout on other platforms.
- Compatible with C99 and C++.
- Covered with unit tests.
## Example
```c
#include <clog.h>
#ifndef MYMODULE_LOG_LEVEL
#define MYMODULE_LOG_LEVEL CLOG_DEBUG
#endif
CLOG_DEFINE_LOG_DEBUG(mymodule_, "My Module", MYMODULE_LOG_LEVEL);
CLOG_DEFINE_LOG_INFO(mymodule_, "My Module", MYMODULE_LOG_LEVEL);
CLOG_DEFINE_LOG_WARNING(mymodule_, "My Module", MYMODULE_LOG_LEVEL);
CLOG_DEFINE_LOG_ERROR(mymodule_, "My Module", MYMODULE_LOG_LEVEL);
...
void some_function(...) {
int status = ...
if (status != 0) {
mymodule_log_error(
"something really bad happened: "
"operation failed with status %d", status);
}
uint32_t expected_zero = ...
if (expected_zero != 0) {
mymodule_log_warning(
"something suspicious happened (var = %"PRIu32"), "
"fall back to generic implementation", expected_zero);
}
void* usually_non_null = ...
if (usually_non_null == NULL) {
mymodule_log_info(
"something unusual, but common, happened: "
"enabling work-around");
}
float a = ...
mymodule_log_debug("computed a = %.7f", a);
}
```

View File

@@ -0,0 +1,100 @@
#pragma once
#include <stdarg.h>
#include <stdlib.h>
#include <inttypes.h>
#define CLOG_NONE 0
#define CLOG_FATAL 1
#define CLOG_ERROR 2
#define CLOG_WARNING 3
#define CLOG_INFO 4
#define CLOG_DEBUG 5
#ifndef CLOG_VISIBILITY
#if defined(__ELF__)
#define CLOG_VISIBILITY __attribute__((__visibility__("internal")))
#elif defined(__MACH__)
#define CLOG_VISIBILITY __attribute__((__visibility__("hidden")))
#else
#define CLOG_VISIBILITY
#endif
#endif
#ifndef CLOG_ARGUMENTS_FORMAT
#if defined(__GNUC__)
#define CLOG_ARGUMENTS_FORMAT __attribute__((__format__(__printf__, 1, 2)))
#else
#define CLOG_ARGUMENTS_FORMAT
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
CLOG_VISIBILITY void clog_vlog_debug(const char* module, const char* format, va_list args);
CLOG_VISIBILITY void clog_vlog_info(const char* module, const char* format, va_list args);
CLOG_VISIBILITY void clog_vlog_warning(const char* module, const char* format, va_list args);
CLOG_VISIBILITY void clog_vlog_error(const char* module, const char* format, va_list args);
CLOG_VISIBILITY void clog_vlog_fatal(const char* module, const char* format, va_list args);
#define CLOG_DEFINE_LOG_DEBUG(log_debug_function_name, module, level) \
CLOG_ARGUMENTS_FORMAT \
inline static void log_debug_function_name(const char* format, ...) { \
if (level >= CLOG_DEBUG) { \
va_list args; \
va_start(args, format); \
clog_vlog_debug(module, format, args); \
va_end(args); \
} \
}
#define CLOG_DEFINE_LOG_INFO(log_info_function_name, module, level) \
CLOG_ARGUMENTS_FORMAT \
inline static void log_info_function_name(const char* format, ...) { \
if (level >= CLOG_INFO) { \
va_list args; \
va_start(args, format); \
clog_vlog_info(module, format, args); \
va_end(args); \
} \
}
#define CLOG_DEFINE_LOG_WARNING(log_warning_function_name, module, level) \
CLOG_ARGUMENTS_FORMAT \
inline static void log_warning_function_name(const char* format, ...) { \
if (level >= CLOG_WARNING) { \
va_list args; \
va_start(args, format); \
clog_vlog_warning(module, format, args); \
va_end(args); \
} \
}
#define CLOG_DEFINE_LOG_ERROR(log_error_function_name, module, level) \
CLOG_ARGUMENTS_FORMAT \
inline static void log_error_function_name(const char* format, ...) { \
if (level >= CLOG_ERROR) { \
va_list args; \
va_start(args, format); \
clog_vlog_error(module, format, args); \
va_end(args); \
} \
}
#define CLOG_DEFINE_LOG_FATAL(log_fatal_function_name, module, level) \
CLOG_ARGUMENTS_FORMAT \
inline static void log_fatal_function_name(const char* format, ...) { \
if (level >= CLOG_FATAL) { \
va_list args; \
va_start(args, format); \
clog_vlog_fatal(module, format, args); \
va_end(args); \
} \
abort(); \
}
#ifdef __cplusplus
} /* extern "C" */
#endif

423
3rdparty/cpuinfo/deps/clog/src/clog.c vendored Normal file
View File

@@ -0,0 +1,423 @@
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#ifdef __ANDROID__
#include <android/log.h>
#endif
#ifndef CLOG_LOG_TO_STDIO
#ifdef __ANDROID__
#define CLOG_LOG_TO_STDIO 0
#else
#define CLOG_LOG_TO_STDIO 1
#endif
#endif
#include <clog.h>
/* Messages up to this size are formatted entirely on-stack, and don't allocate heap memory */
#define CLOG_STACK_BUFFER_SIZE 1024
#define CLOG_FATAL_PREFIX "Fatal error: "
#define CLOG_FATAL_PREFIX_LENGTH 13
#define CLOG_FATAL_PREFIX_FORMAT "Fatal error in %s: "
#define CLOG_ERROR_PREFIX "Error: "
#define CLOG_ERROR_PREFIX_LENGTH 7
#define CLOG_ERROR_PREFIX_FORMAT "Error in %s: "
#define CLOG_WARNING_PREFIX "Warning: "
#define CLOG_WARNING_PREFIX_LENGTH 9
#define CLOG_WARNING_PREFIX_FORMAT "Warning in %s: "
#define CLOG_INFO_PREFIX "Note: "
#define CLOG_INFO_PREFIX_LENGTH 6
#define CLOG_INFO_PREFIX_FORMAT "Note (%s): "
#define CLOG_DEBUG_PREFIX "Debug: "
#define CLOG_DEBUG_PREFIX_LENGTH 7
#define CLOG_DEBUG_PREFIX_FORMAT "Debug (%s): "
#define CLOG_SUFFIX_LENGTH 1
void clog_vlog_fatal(const char* module, const char* format, va_list args) {
#if defined(__ANDROID__) && !CLOG_LOG_TO_STDIO
__android_log_vprint(ANDROID_LOG_FATAL, module, format, args);
#else
char stack_buffer[CLOG_STACK_BUFFER_SIZE];
char* heap_buffer = NULL;
char* out_buffer = &stack_buffer[0];
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
va_list args_copy;
va_copy(args_copy, args);
int prefix_chars = CLOG_FATAL_PREFIX_LENGTH;
if (module == NULL) {
memcpy(stack_buffer, CLOG_FATAL_PREFIX, CLOG_FATAL_PREFIX_LENGTH);
} else {
prefix_chars = snprintf(stack_buffer, CLOG_STACK_BUFFER_SIZE, CLOG_FATAL_PREFIX_FORMAT, module);
if (prefix_chars < 0) {
/* Format error in prefix (possible if prefix is modified): skip prefix and continue as if nothing happened. */
prefix_chars = 0;
}
}
int format_chars;
if (prefix_chars + CLOG_SUFFIX_LENGTH >= CLOG_STACK_BUFFER_SIZE) {
/*
* Prefix + suffix alone would overflow the on-stack buffer, thus need to use on-heap buffer.
* Do not even try to format the string into on-stack buffer.
*/
format_chars = vsnprintf(NULL, 0, format, args);
} else {
format_chars =
vsnprintf(
&stack_buffer[prefix_chars],
CLOG_STACK_BUFFER_SIZE - prefix_chars - CLOG_SUFFIX_LENGTH,
format,
args);
}
if (format_chars < 0) {
/* Format error in the message: silently ignore this particular message. */
goto cleanup;
}
if (prefix_chars + format_chars + CLOG_SUFFIX_LENGTH > CLOG_STACK_BUFFER_SIZE) {
/* Allocate a buffer on heap, and vsnprintf to this buffer */
heap_buffer = malloc(prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
if (heap_buffer == NULL) {
goto cleanup;
}
if (prefix_chars > CLOG_STACK_BUFFER_SIZE) {
/* Prefix didn't fit into on-stack buffer, re-format it again to on-heap buffer */
snprintf(heap_buffer, prefix_chars + 1 /* for '\0'-terminator */, CLOG_FATAL_PREFIX_FORMAT, module);
} else {
/* Copy pre-formatted prefix from on-stack buffer to on-heap buffer */
memcpy(heap_buffer, stack_buffer, prefix_chars);
}
vsnprintf(heap_buffer + prefix_chars, format_chars + CLOG_SUFFIX_LENGTH, format, args_copy);
out_buffer = heap_buffer;
}
out_buffer[prefix_chars + format_chars] = '\n';
#ifdef _WIN32
DWORD bytes_written;
WriteFile(
GetStdHandle(STD_ERROR_HANDLE),
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
&bytes_written, NULL);
#else
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
#endif
cleanup:
free(heap_buffer);
va_end(args_copy);
#endif
}
void clog_vlog_error(const char* module, const char* format, va_list args) {
#if defined(__ANDROID__) && !CLOG_LOG_TO_STDIO
__android_log_vprint(ANDROID_LOG_ERROR, module, format, args);
#else
char stack_buffer[CLOG_STACK_BUFFER_SIZE];
char* heap_buffer = NULL;
char* out_buffer = &stack_buffer[0];
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
va_list args_copy;
va_copy(args_copy, args);
int prefix_chars = CLOG_ERROR_PREFIX_LENGTH;
if (module == NULL) {
memcpy(stack_buffer, CLOG_ERROR_PREFIX, CLOG_ERROR_PREFIX_LENGTH);
} else {
prefix_chars = snprintf(stack_buffer, CLOG_STACK_BUFFER_SIZE, CLOG_ERROR_PREFIX_FORMAT, module);
if (prefix_chars < 0) {
/* Format error in prefix (possible if prefix is modified): skip prefix and continue as if nothing happened. */
prefix_chars = 0;
}
}
int format_chars;
if (prefix_chars + CLOG_SUFFIX_LENGTH >= CLOG_STACK_BUFFER_SIZE) {
/*
* Prefix + suffix alone would overflow the on-stack buffer, thus need to use on-heap buffer.
* Do not even try to format the string into on-stack buffer.
*/
format_chars = vsnprintf(NULL, 0, format, args);
} else {
format_chars =
vsnprintf(
&stack_buffer[prefix_chars],
CLOG_STACK_BUFFER_SIZE - prefix_chars - CLOG_SUFFIX_LENGTH,
format,
args);
}
if (format_chars < 0) {
/* Format error in the message: silently ignore this particular message. */
goto cleanup;
}
if (prefix_chars + format_chars + CLOG_SUFFIX_LENGTH > CLOG_STACK_BUFFER_SIZE) {
/* Allocate a buffer on heap, and vsnprintf to this buffer */
heap_buffer = malloc(prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
if (heap_buffer == NULL) {
goto cleanup;
}
if (prefix_chars > CLOG_STACK_BUFFER_SIZE) {
/* Prefix didn't fit into on-stack buffer, re-format it again to on-heap buffer */
snprintf(heap_buffer, prefix_chars + 1 /* for '\0'-terminator */, CLOG_ERROR_PREFIX_FORMAT, module);
} else {
/* Copy pre-formatted prefix from on-stack buffer to on-heap buffer */
memcpy(heap_buffer, stack_buffer, prefix_chars);
}
vsnprintf(heap_buffer + prefix_chars, format_chars + CLOG_SUFFIX_LENGTH, format, args_copy);
out_buffer = heap_buffer;
}
out_buffer[prefix_chars + format_chars] = '\n';
#ifdef _WIN32
DWORD bytes_written;
WriteFile(
GetStdHandle(STD_ERROR_HANDLE),
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
&bytes_written, NULL);
#else
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
#endif
cleanup:
free(heap_buffer);
va_end(args_copy);
#endif
}
void clog_vlog_warning(const char* module, const char* format, va_list args) {
#if defined(__ANDROID__) && !CLOG_LOG_TO_STDIO
__android_log_vprint(ANDROID_LOG_WARN, module, format, args);
#else
char stack_buffer[CLOG_STACK_BUFFER_SIZE];
char* heap_buffer = NULL;
char* out_buffer = &stack_buffer[0];
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
va_list args_copy;
va_copy(args_copy, args);
int prefix_chars = CLOG_WARNING_PREFIX_LENGTH;
if (module == NULL) {
memcpy(stack_buffer, CLOG_WARNING_PREFIX, CLOG_WARNING_PREFIX_LENGTH);
} else {
prefix_chars = snprintf(stack_buffer, CLOG_STACK_BUFFER_SIZE, CLOG_WARNING_PREFIX_FORMAT, module);
if (prefix_chars < 0) {
/* Format error in prefix (possible if prefix is modified): skip prefix and continue as if nothing happened. */
prefix_chars = 0;
}
}
int format_chars;
if (prefix_chars + CLOG_SUFFIX_LENGTH >= CLOG_STACK_BUFFER_SIZE) {
/*
* Prefix + suffix alone would overflow the on-stack buffer, thus need to use on-heap buffer.
* Do not even try to format the string into on-stack buffer.
*/
format_chars = vsnprintf(NULL, 0, format, args);
} else {
format_chars =
vsnprintf(
&stack_buffer[prefix_chars],
CLOG_STACK_BUFFER_SIZE - prefix_chars - CLOG_SUFFIX_LENGTH,
format,
args);
}
if (format_chars < 0) {
/* Format error in the message: silently ignore this particular message. */
goto cleanup;
}
if (prefix_chars + format_chars + CLOG_SUFFIX_LENGTH > CLOG_STACK_BUFFER_SIZE) {
/* Allocate a buffer on heap, and vsnprintf to this buffer */
heap_buffer = malloc(prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
if (heap_buffer == NULL) {
goto cleanup;
}
if (prefix_chars > CLOG_STACK_BUFFER_SIZE) {
/* Prefix didn't fit into on-stack buffer, re-format it again to on-heap buffer */
snprintf(heap_buffer, prefix_chars + 1 /* for '\0'-terminator */, CLOG_WARNING_PREFIX_FORMAT, module);
} else {
/* Copy pre-formatted prefix from on-stack buffer to on-heap buffer */
memcpy(heap_buffer, stack_buffer, prefix_chars);
}
vsnprintf(heap_buffer + prefix_chars, format_chars + CLOG_SUFFIX_LENGTH, format, args_copy);
out_buffer = heap_buffer;
}
out_buffer[prefix_chars + format_chars] = '\n';
#ifdef _WIN32
DWORD bytes_written;
WriteFile(
GetStdHandle(STD_ERROR_HANDLE),
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
&bytes_written, NULL);
#else
write(STDERR_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
#endif
cleanup:
free(heap_buffer);
va_end(args_copy);
#endif
}
void clog_vlog_info(const char* module, const char* format, va_list args) {
#if defined(__ANDROID__) && !CLOG_LOG_TO_STDIO
__android_log_vprint(ANDROID_LOG_INFO, module, format, args);
#else
char stack_buffer[CLOG_STACK_BUFFER_SIZE];
char* heap_buffer = NULL;
char* out_buffer = &stack_buffer[0];
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
va_list args_copy;
va_copy(args_copy, args);
int prefix_chars = CLOG_INFO_PREFIX_LENGTH;
if (module == NULL) {
memcpy(stack_buffer, CLOG_INFO_PREFIX, CLOG_INFO_PREFIX_LENGTH);
} else {
prefix_chars = snprintf(stack_buffer, CLOG_STACK_BUFFER_SIZE, CLOG_INFO_PREFIX_FORMAT, module);
if (prefix_chars < 0) {
/* Format error in prefix (possible if prefix is modified): skip prefix and continue as if nothing happened. */
prefix_chars = 0;
}
}
int format_chars;
if (prefix_chars + CLOG_SUFFIX_LENGTH >= CLOG_STACK_BUFFER_SIZE) {
/*
* Prefix + suffix alone would overflow the on-stack buffer, thus need to use on-heap buffer.
* Do not even try to format the string into on-stack buffer.
*/
format_chars = vsnprintf(NULL, 0, format, args);
} else {
format_chars =
vsnprintf(
&stack_buffer[prefix_chars],
CLOG_STACK_BUFFER_SIZE - prefix_chars - CLOG_SUFFIX_LENGTH,
format,
args);
}
if (format_chars < 0) {
/* Format error in the message: silently ignore this particular message. */
goto cleanup;
}
if (prefix_chars + format_chars + CLOG_SUFFIX_LENGTH > CLOG_STACK_BUFFER_SIZE) {
/* Allocate a buffer on heap, and vsnprintf to this buffer */
heap_buffer = malloc(prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
if (heap_buffer == NULL) {
goto cleanup;
}
if (prefix_chars > CLOG_STACK_BUFFER_SIZE) {
/* Prefix didn't fit into on-stack buffer, re-format it again to on-heap buffer */
snprintf(heap_buffer, prefix_chars + 1 /* for '\0'-terminator */, CLOG_INFO_PREFIX_FORMAT, module);
} else {
/* Copy pre-formatted prefix from on-stack buffer to on-heap buffer */
memcpy(heap_buffer, stack_buffer, prefix_chars);
}
vsnprintf(heap_buffer + prefix_chars, format_chars + CLOG_SUFFIX_LENGTH, format, args_copy);
out_buffer = heap_buffer;
}
out_buffer[prefix_chars + format_chars] = '\n';
#ifdef _WIN32
DWORD bytes_written;
WriteFile(
GetStdHandle(STD_OUTPUT_HANDLE),
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
&bytes_written, NULL);
#else
write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
#endif
cleanup:
free(heap_buffer);
va_end(args_copy);
#endif
}
void clog_vlog_debug(const char* module, const char* format, va_list args) {
#if defined(__ANDROID__) && !CLOG_LOG_TO_STDIO
__android_log_vprint(ANDROID_LOG_DEBUG, module, format, args);
#else
char stack_buffer[CLOG_STACK_BUFFER_SIZE];
char* heap_buffer = NULL;
char* out_buffer = &stack_buffer[0];
/* The first call to vsnprintf will clobber args, thus need a copy in case a second vsnprintf call is needed */
va_list args_copy;
va_copy(args_copy, args);
int prefix_chars = CLOG_DEBUG_PREFIX_LENGTH;
if (module == NULL) {
memcpy(stack_buffer, CLOG_DEBUG_PREFIX, CLOG_DEBUG_PREFIX_LENGTH);
} else {
prefix_chars = snprintf(stack_buffer, CLOG_STACK_BUFFER_SIZE, CLOG_DEBUG_PREFIX_FORMAT, module);
if (prefix_chars < 0) {
/* Format error in prefix (possible if prefix is modified): skip prefix and continue as if nothing happened. */
prefix_chars = 0;
}
}
int format_chars;
if (prefix_chars + CLOG_SUFFIX_LENGTH >= CLOG_STACK_BUFFER_SIZE) {
/*
* Prefix + suffix alone would overflow the on-stack buffer, thus need to use on-heap buffer.
* Do not even try to format the string into on-stack buffer.
*/
format_chars = vsnprintf(NULL, 0, format, args);
} else {
format_chars =
vsnprintf(
&stack_buffer[prefix_chars],
CLOG_STACK_BUFFER_SIZE - prefix_chars - CLOG_SUFFIX_LENGTH,
format,
args);
}
if (format_chars < 0) {
/* Format error in the message: silently ignore this particular message. */
goto cleanup;
}
if (prefix_chars + format_chars + CLOG_SUFFIX_LENGTH > CLOG_STACK_BUFFER_SIZE) {
/* Allocate a buffer on heap, and vsnprintf to this buffer */
heap_buffer = malloc(prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
if (heap_buffer == NULL) {
goto cleanup;
}
if (prefix_chars > CLOG_STACK_BUFFER_SIZE) {
/* Prefix didn't fit into on-stack buffer, re-format it again to on-heap buffer */
snprintf(heap_buffer, prefix_chars + 1 /* for '\0'-terminator */, CLOG_DEBUG_PREFIX_FORMAT, module);
} else {
/* Copy pre-formatted prefix from on-stack buffer to on-heap buffer */
memcpy(heap_buffer, stack_buffer, prefix_chars);
}
vsnprintf(heap_buffer + prefix_chars, format_chars + CLOG_SUFFIX_LENGTH, format, args_copy);
out_buffer = heap_buffer;
}
out_buffer[prefix_chars + format_chars] = '\n';
#ifdef _WIN32
DWORD bytes_written;
WriteFile(
GetStdHandle(STD_OUTPUT_HANDLE),
out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH,
&bytes_written, NULL);
#else
write(STDOUT_FILENO, out_buffer, prefix_chars + format_chars + CLOG_SUFFIX_LENGTH);
#endif
cleanup:
free(heap_buffer);
va_end(args_copy);
#endif
}

78
3rdparty/cpuinfo/include/cpuinfo-mock.h vendored Normal file
View File

@@ -0,0 +1,78 @@
#pragma once
#ifndef CPUINFO_MOCK_H
#define CPUINFO_MOCK_H
#include <stddef.h>
#include <stdint.h>
#include <cpuinfo.h>
#if defined(__linux__)
#include <sys/types.h>
#endif
#if !defined(CPUINFO_MOCK) || !(CPUINFO_MOCK)
#error This header is intended only for test use
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if CPUINFO_ARCH_ARM
void CPUINFO_ABI cpuinfo_set_fpsid(uint32_t fpsid);
void CPUINFO_ABI cpuinfo_set_wcid(uint32_t wcid);
#endif /* CPUINFO_ARCH_ARM */
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
struct cpuinfo_mock_cpuid {
uint32_t input_eax;
uint32_t input_ecx;
uint32_t eax;
uint32_t ebx;
uint32_t ecx;
uint32_t edx;
};
void CPUINFO_ABI cpuinfo_mock_set_cpuid(struct cpuinfo_mock_cpuid* dump, size_t entries);
void CPUINFO_ABI cpuinfo_mock_get_cpuid(uint32_t eax, uint32_t regs[4]);
void CPUINFO_ABI cpuinfo_mock_get_cpuidex(uint32_t eax, uint32_t ecx, uint32_t regs[4]);
#endif /* CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64 */
struct cpuinfo_mock_file {
const char* path;
size_t size;
const char* content;
size_t offset;
};
struct cpuinfo_mock_property {
const char* key;
const char* value;
};
#if defined(__linux__)
void CPUINFO_ABI cpuinfo_mock_filesystem(struct cpuinfo_mock_file* files);
int CPUINFO_ABI cpuinfo_mock_open(const char* path, int oflag);
int CPUINFO_ABI cpuinfo_mock_close(int fd);
ssize_t CPUINFO_ABI cpuinfo_mock_read(int fd, void* buffer, size_t capacity);
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
void CPUINFO_ABI cpuinfo_set_hwcap(uint32_t hwcap);
#endif
#if CPUINFO_ARCH_ARM
void CPUINFO_ABI cpuinfo_set_hwcap2(uint32_t hwcap2);
#endif
#endif
#if defined(__ANDROID__)
void CPUINFO_ABI cpuinfo_mock_android_properties(struct cpuinfo_mock_property* properties);
void CPUINFO_ABI cpuinfo_mock_gl_renderer(const char* renderer);
#endif
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CPUINFO_MOCK_H */

1872
3rdparty/cpuinfo/include/cpuinfo.h vendored Normal file

File diff suppressed because it is too large Load Diff

410
3rdparty/cpuinfo/src/api.c vendored Normal file
View File

@@ -0,0 +1,410 @@
#include <stdbool.h>
#include <stddef.h>
#include <cpuinfo.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
#ifdef __linux__
#include <linux/api.h>
#include <unistd.h>
#include <sys/syscall.h>
#if !defined(__NR_getcpu)
#include <asm-generic/unistd.h>
#endif
#endif
bool cpuinfo_is_initialized = false;
struct cpuinfo_processor* cpuinfo_processors = NULL;
struct cpuinfo_core* cpuinfo_cores = NULL;
struct cpuinfo_cluster* cpuinfo_clusters = NULL;
struct cpuinfo_package* cpuinfo_packages = NULL;
struct cpuinfo_cache* cpuinfo_cache[cpuinfo_cache_level_max] = { NULL };
uint32_t cpuinfo_processors_count = 0;
uint32_t cpuinfo_cores_count = 0;
uint32_t cpuinfo_clusters_count = 0;
uint32_t cpuinfo_packages_count = 0;
uint32_t cpuinfo_cache_count[cpuinfo_cache_level_max] = { 0 };
uint32_t cpuinfo_max_cache_size = 0;
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
struct cpuinfo_uarch_info* cpuinfo_uarchs = NULL;
uint32_t cpuinfo_uarchs_count = 0;
#else
struct cpuinfo_uarch_info cpuinfo_global_uarch = { cpuinfo_uarch_unknown };
#endif
#ifdef __linux__
uint32_t cpuinfo_linux_cpu_max = 0;
const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map = NULL;
const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map = NULL;
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map = NULL;
#endif
#endif
const struct cpuinfo_processor* cpuinfo_get_processors(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "processors");
}
return cpuinfo_processors;
}
const struct cpuinfo_core* cpuinfo_get_cores(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "core");
}
return cpuinfo_cores;
}
const struct cpuinfo_cluster* cpuinfo_get_clusters(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "clusters");
}
return cpuinfo_clusters;
}
const struct cpuinfo_package* cpuinfo_get_packages(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "packages");
}
return cpuinfo_packages;
}
const struct cpuinfo_uarch_info* cpuinfo_get_uarchs() {
if (!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarchs");
}
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
return cpuinfo_uarchs;
#else
return &cpuinfo_global_uarch;
#endif
}
const struct cpuinfo_processor* cpuinfo_get_processor(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "processor");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_processors_count) {
return NULL;
}
return &cpuinfo_processors[index];
}
const struct cpuinfo_core* cpuinfo_get_core(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "core");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cores_count) {
return NULL;
}
return &cpuinfo_cores[index];
}
const struct cpuinfo_cluster* cpuinfo_get_cluster(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "cluster");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_clusters_count) {
return NULL;
}
return &cpuinfo_clusters[index];
}
const struct cpuinfo_package* cpuinfo_get_package(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "package");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_packages_count) {
return NULL;
}
return &cpuinfo_packages[index];
}
const struct cpuinfo_uarch_info* cpuinfo_get_uarch(uint32_t index) {
if (!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarch");
}
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
if CPUINFO_UNLIKELY(index >= cpuinfo_uarchs_count) {
return NULL;
}
return &cpuinfo_uarchs[index];
#else
if CPUINFO_UNLIKELY(index != 0) {
return NULL;
}
return &cpuinfo_global_uarch;
#endif
}
uint32_t cpuinfo_get_processors_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "processors_count");
}
return cpuinfo_processors_count;
}
uint32_t cpuinfo_get_cores_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "cores_count");
}
return cpuinfo_cores_count;
}
uint32_t cpuinfo_get_clusters_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "clusters_count");
}
return cpuinfo_clusters_count;
}
uint32_t cpuinfo_get_packages_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "packages_count");
}
return cpuinfo_packages_count;
}
uint32_t cpuinfo_get_uarchs_count(void) {
if (!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "uarchs_count");
}
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
return cpuinfo_uarchs_count;
#else
return 1;
#endif
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_caches(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1i_caches");
}
return cpuinfo_cache[cpuinfo_cache_level_1i];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_caches(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1d_caches");
}
return cpuinfo_cache[cpuinfo_cache_level_1d];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_caches(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l2_caches");
}
return cpuinfo_cache[cpuinfo_cache_level_2];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_caches(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l3_caches");
}
return cpuinfo_cache[cpuinfo_cache_level_3];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_caches(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l4_caches");
}
return cpuinfo_cache[cpuinfo_cache_level_4];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1i_cache(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1i_cache");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cache_count[cpuinfo_cache_level_1i]) {
return NULL;
}
return &cpuinfo_cache[cpuinfo_cache_level_1i][index];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l1d_cache(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1d_cache");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cache_count[cpuinfo_cache_level_1d]) {
return NULL;
}
return &cpuinfo_cache[cpuinfo_cache_level_1d][index];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l2_cache(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l2_cache");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cache_count[cpuinfo_cache_level_2]) {
return NULL;
}
return &cpuinfo_cache[cpuinfo_cache_level_2][index];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l3_cache(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l3_cache");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cache_count[cpuinfo_cache_level_3]) {
return NULL;
}
return &cpuinfo_cache[cpuinfo_cache_level_3][index];
}
const struct cpuinfo_cache* CPUINFO_ABI cpuinfo_get_l4_cache(uint32_t index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l4_cache");
}
if CPUINFO_UNLIKELY(index >= cpuinfo_cache_count[cpuinfo_cache_level_4]) {
return NULL;
}
return &cpuinfo_cache[cpuinfo_cache_level_4][index];
}
uint32_t CPUINFO_ABI cpuinfo_get_l1i_caches_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1i_caches_count");
}
return cpuinfo_cache_count[cpuinfo_cache_level_1i];
}
uint32_t CPUINFO_ABI cpuinfo_get_l1d_caches_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l1d_caches_count");
}
return cpuinfo_cache_count[cpuinfo_cache_level_1d];
}
uint32_t CPUINFO_ABI cpuinfo_get_l2_caches_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l2_caches_count");
}
return cpuinfo_cache_count[cpuinfo_cache_level_2];
}
uint32_t CPUINFO_ABI cpuinfo_get_l3_caches_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l3_caches_count");
}
return cpuinfo_cache_count[cpuinfo_cache_level_3];
}
uint32_t CPUINFO_ABI cpuinfo_get_l4_caches_count(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "l4_caches_count");
}
return cpuinfo_cache_count[cpuinfo_cache_level_4];
}
uint32_t CPUINFO_ABI cpuinfo_get_max_cache_size(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "max_cache_size");
}
return cpuinfo_max_cache_size;
}
const struct cpuinfo_processor* CPUINFO_ABI cpuinfo_get_current_processor(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_processor");
}
#ifdef __linux__
/* Initializing this variable silences a MemorySanitizer error. */
unsigned cpu = 0;
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
return 0;
}
if CPUINFO_UNLIKELY((uint32_t) cpu >= cpuinfo_linux_cpu_max) {
return 0;
}
return cpuinfo_linux_cpu_to_processor_map[cpu];
#else
return NULL;
#endif
}
const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_current_core(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_core");
}
#ifdef __linux__
/* Initializing this variable silences a MemorySanitizer error. */
unsigned cpu = 0;
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
return 0;
}
if CPUINFO_UNLIKELY((uint32_t) cpu >= cpuinfo_linux_cpu_max) {
return 0;
}
return cpuinfo_linux_cpu_to_core_map[cpu];
#else
return NULL;
#endif
}
uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_uarch_index");
}
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
#ifdef __linux__
if (cpuinfo_linux_cpu_to_uarch_index_map == NULL) {
/* Special case: avoid syscall on systems with only a single type of cores */
return 0;
}
/* General case */
/* Initializing this variable silences a MemorySanitizer error. */
unsigned cpu = 0;
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
return 0;
}
if CPUINFO_UNLIKELY((uint32_t) cpu >= cpuinfo_linux_cpu_max) {
return 0;
}
return cpuinfo_linux_cpu_to_uarch_index_map[cpu];
#else
/* Fallback: pretend to be on the big core. */
return 0;
#endif
#else
/* Only ARM/ARM64 processors may include cores of different types in the same package. */
return 0;
#endif
}
uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index) {
if CPUINFO_UNLIKELY(!cpuinfo_is_initialized) {
cpuinfo_log_fatal("cpuinfo_get_%s called before cpuinfo is initialized", "current_uarch_index_with_default");
}
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
#ifdef __linux__
if (cpuinfo_linux_cpu_to_uarch_index_map == NULL) {
/* Special case: avoid syscall on systems with only a single type of cores */
return 0;
}
/* General case */
/* Initializing this variable silences a MemorySanitizer error. */
unsigned cpu = 0;
if CPUINFO_UNLIKELY(syscall(__NR_getcpu, &cpu, NULL, NULL) != 0) {
return default_uarch_index;
}
if CPUINFO_UNLIKELY((uint32_t) cpu >= cpuinfo_linux_cpu_max) {
return default_uarch_index;
}
return cpuinfo_linux_cpu_to_uarch_index_map[cpu];
#else
/* Fallback: no API to query current core, use default uarch index. */
return default_uarch_index;
#endif
#else
/* Only ARM/ARM64 processors may include cores of different types in the same package. */
return 0;
#endif
}

20
3rdparty/cpuinfo/src/arm/android/api.h vendored Normal file
View File

@@ -0,0 +1,20 @@
#pragma once
#include <cpuinfo.h>
#include <cpuinfo/common.h>
#include <arm/api.h>
#include <arm/linux/api.h>
enum cpuinfo_android_chipset_property {
cpuinfo_android_chipset_property_proc_cpuinfo_hardware = 0,
cpuinfo_android_chipset_property_ro_product_board,
cpuinfo_android_chipset_property_ro_board_platform,
cpuinfo_android_chipset_property_ro_mediatek_platform,
cpuinfo_android_chipset_property_ro_arch,
cpuinfo_android_chipset_property_ro_chipname,
cpuinfo_android_chipset_property_ro_hardware_chipname,
cpuinfo_android_chipset_property_max,
};
CPUINFO_INTERNAL void cpuinfo_arm_android_parse_properties(
struct cpuinfo_android_properties properties[restrict static 1]);

View File

@@ -0,0 +1,67 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <sys/system_properties.h>
#include <linux/api.h>
#include <arm/android/api.h>
#include <arm/linux/api.h>
#include <cpuinfo/log.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
static struct cpuinfo_mock_property* cpuinfo_mock_properties = NULL;
void CPUINFO_ABI cpuinfo_mock_android_properties(struct cpuinfo_mock_property* properties) {
cpuinfo_log_info("Android properties mocking enabled");
cpuinfo_mock_properties = properties;
}
static int cpuinfo_android_property_get(const char* key, char* value) {
if (cpuinfo_mock_properties != NULL) {
for (const struct cpuinfo_mock_property* prop = cpuinfo_mock_properties; prop->key != NULL; prop++) {
if (strncmp(key, prop->key, CPUINFO_BUILD_PROP_NAME_MAX) == 0) {
strncpy(value, prop->value, CPUINFO_BUILD_PROP_VALUE_MAX);
return (int) strnlen(prop->value, CPUINFO_BUILD_PROP_VALUE_MAX);
}
}
}
*value = '\0';
return 0;
}
#else
static inline int cpuinfo_android_property_get(const char* key, char* value) {
return __system_property_get(key, value);
}
#endif
void cpuinfo_arm_android_parse_properties(struct cpuinfo_android_properties properties[restrict static 1]) {
const int ro_product_board_length =
cpuinfo_android_property_get("ro.product.board", properties->ro_product_board);
cpuinfo_log_debug("read ro.product.board = \"%.*s\"", ro_product_board_length, properties->ro_product_board);
const int ro_board_platform_length =
cpuinfo_android_property_get("ro.board.platform", properties->ro_board_platform);
cpuinfo_log_debug("read ro.board.platform = \"%.*s\"", ro_board_platform_length, properties->ro_board_platform);
const int ro_mediatek_platform_length =
cpuinfo_android_property_get("ro.mediatek.platform", properties->ro_mediatek_platform);
cpuinfo_log_debug("read ro.mediatek.platform = \"%.*s\"",
ro_mediatek_platform_length, properties->ro_mediatek_platform);
const int ro_arch_length =
cpuinfo_android_property_get("ro.arch", properties->ro_arch);
cpuinfo_log_debug("read ro.arch = \"%.*s\"", ro_arch_length, properties->ro_arch);
const int ro_chipname_length =
cpuinfo_android_property_get("ro.chipname", properties->ro_chipname);
cpuinfo_log_debug("read ro.chipname = \"%.*s\"", ro_chipname_length, properties->ro_chipname);
const int ro_hardware_chipname_length =
cpuinfo_android_property_get("ro.hardware.chipname", properties->ro_hardware_chipname);
cpuinfo_log_debug("read ro.hardware.chipname = \"%.*s\"", ro_hardware_chipname_length, properties->ro_hardware_chipname);
}

122
3rdparty/cpuinfo/src/arm/api.h vendored Normal file
View File

@@ -0,0 +1,122 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <cpuinfo.h>
#include <cpuinfo/common.h>
enum cpuinfo_arm_chipset_vendor {
cpuinfo_arm_chipset_vendor_unknown = 0,
cpuinfo_arm_chipset_vendor_qualcomm,
cpuinfo_arm_chipset_vendor_mediatek,
cpuinfo_arm_chipset_vendor_samsung,
cpuinfo_arm_chipset_vendor_hisilicon,
cpuinfo_arm_chipset_vendor_actions,
cpuinfo_arm_chipset_vendor_allwinner,
cpuinfo_arm_chipset_vendor_amlogic,
cpuinfo_arm_chipset_vendor_broadcom,
cpuinfo_arm_chipset_vendor_lg,
cpuinfo_arm_chipset_vendor_leadcore,
cpuinfo_arm_chipset_vendor_marvell,
cpuinfo_arm_chipset_vendor_mstar,
cpuinfo_arm_chipset_vendor_novathor,
cpuinfo_arm_chipset_vendor_nvidia,
cpuinfo_arm_chipset_vendor_pinecone,
cpuinfo_arm_chipset_vendor_renesas,
cpuinfo_arm_chipset_vendor_rockchip,
cpuinfo_arm_chipset_vendor_spreadtrum,
cpuinfo_arm_chipset_vendor_telechips,
cpuinfo_arm_chipset_vendor_texas_instruments,
cpuinfo_arm_chipset_vendor_wondermedia,
cpuinfo_arm_chipset_vendor_max,
};
enum cpuinfo_arm_chipset_series {
cpuinfo_arm_chipset_series_unknown = 0,
cpuinfo_arm_chipset_series_qualcomm_qsd,
cpuinfo_arm_chipset_series_qualcomm_msm,
cpuinfo_arm_chipset_series_qualcomm_apq,
cpuinfo_arm_chipset_series_qualcomm_snapdragon,
cpuinfo_arm_chipset_series_mediatek_mt,
cpuinfo_arm_chipset_series_samsung_exynos,
cpuinfo_arm_chipset_series_hisilicon_k3v,
cpuinfo_arm_chipset_series_hisilicon_hi,
cpuinfo_arm_chipset_series_hisilicon_kirin,
cpuinfo_arm_chipset_series_actions_atm,
cpuinfo_arm_chipset_series_allwinner_a,
cpuinfo_arm_chipset_series_amlogic_aml,
cpuinfo_arm_chipset_series_amlogic_s,
cpuinfo_arm_chipset_series_broadcom_bcm,
cpuinfo_arm_chipset_series_lg_nuclun,
cpuinfo_arm_chipset_series_leadcore_lc,
cpuinfo_arm_chipset_series_marvell_pxa,
cpuinfo_arm_chipset_series_mstar_6a,
cpuinfo_arm_chipset_series_novathor_u,
cpuinfo_arm_chipset_series_nvidia_tegra_t,
cpuinfo_arm_chipset_series_nvidia_tegra_ap,
cpuinfo_arm_chipset_series_nvidia_tegra_sl,
cpuinfo_arm_chipset_series_pinecone_surge_s,
cpuinfo_arm_chipset_series_renesas_mp,
cpuinfo_arm_chipset_series_rockchip_rk,
cpuinfo_arm_chipset_series_spreadtrum_sc,
cpuinfo_arm_chipset_series_telechips_tcc,
cpuinfo_arm_chipset_series_texas_instruments_omap,
cpuinfo_arm_chipset_series_wondermedia_wm,
cpuinfo_arm_chipset_series_max,
};
#define CPUINFO_ARM_CHIPSET_SUFFIX_MAX 8
struct cpuinfo_arm_chipset {
enum cpuinfo_arm_chipset_vendor vendor;
enum cpuinfo_arm_chipset_series series;
uint32_t model;
char suffix[CPUINFO_ARM_CHIPSET_SUFFIX_MAX];
};
#define CPUINFO_ARM_CHIPSET_NAME_MAX CPUINFO_PACKAGE_NAME_MAX
#ifndef __cplusplus
CPUINFO_INTERNAL void cpuinfo_arm_chipset_to_string(
const struct cpuinfo_arm_chipset chipset[restrict static 1],
char name[restrict static CPUINFO_ARM_CHIPSET_NAME_MAX]);
CPUINFO_INTERNAL void cpuinfo_arm_fixup_chipset(
struct cpuinfo_arm_chipset chipset[restrict static 1], uint32_t cores, uint32_t max_cpu_freq_max);
CPUINFO_INTERNAL void cpuinfo_arm_decode_vendor_uarch(
uint32_t midr,
#if CPUINFO_ARCH_ARM
bool has_vfpv4,
#endif
enum cpuinfo_vendor vendor[restrict static 1],
enum cpuinfo_uarch uarch[restrict static 1]);
CPUINFO_INTERNAL void cpuinfo_arm_decode_cache(
enum cpuinfo_uarch uarch,
uint32_t cluster_cores,
uint32_t midr,
const struct cpuinfo_arm_chipset chipset[restrict static 1],
uint32_t cluster_id,
uint32_t arch_version,
struct cpuinfo_cache l1i[restrict static 1],
struct cpuinfo_cache l1d[restrict static 1],
struct cpuinfo_cache l2[restrict static 1],
struct cpuinfo_cache l3[restrict static 1]);
CPUINFO_INTERNAL uint32_t cpuinfo_arm_compute_max_cache_size(
const struct cpuinfo_processor processor[restrict static 1]);
#else /* defined(__cplusplus) */
CPUINFO_INTERNAL void cpuinfo_arm_decode_cache(
enum cpuinfo_uarch uarch,
uint32_t cluster_cores,
uint32_t midr,
const struct cpuinfo_arm_chipset chipset[1],
uint32_t cluster_id,
uint32_t arch_version,
struct cpuinfo_cache l1i[1],
struct cpuinfo_cache l1d[1],
struct cpuinfo_cache l2[1],
struct cpuinfo_cache l3[1]);
#endif

1676
3rdparty/cpuinfo/src/arm/cache.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,267 @@
#include <stdint.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
#endif
#include <arm/linux/api.h>
#include <arm/linux/cp.h>
#include <arm/midr.h>
#include <cpuinfo/log.h>
#if CPUINFO_MOCK
uint32_t cpuinfo_arm_fpsid = 0;
uint32_t cpuinfo_arm_mvfr0 = 0;
uint32_t cpuinfo_arm_wcid = 0;
void cpuinfo_set_fpsid(uint32_t fpsid) {
cpuinfo_arm_fpsid = fpsid;
}
void cpuinfo_set_wcid(uint32_t wcid) {
cpuinfo_arm_wcid = wcid;
}
#endif
void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
uint32_t features,
uint32_t features2,
uint32_t midr,
uint32_t architecture_version,
uint32_t architecture_flags,
const struct cpuinfo_arm_chipset chipset[restrict static 1],
struct cpuinfo_arm_isa isa[restrict static 1])
{
if (architecture_version >= 8) {
/*
* ARMv7 code running on ARMv8: IDIV, VFP, NEON are always supported,
* but may be not reported in /proc/cpuinfo features.
*/
isa->armv5e = true;
isa->armv6 = true;
isa->armv6k = true;
isa->armv7 = true;
isa->armv7mp = true;
isa->armv8 = true;
isa->thumb = true;
isa->thumb2 = true;
isa->idiv = true;
isa->vfpv3 = true;
isa->d32 = true;
isa->fp16 = true;
isa->fma = true;
isa->neon = true;
/*
* NEON FP16 compute extension and VQRDMLAH/VQRDMLSH instructions are not indicated in /proc/cpuinfo.
* Use a MIDR-based heuristic to whitelist processors known to support it:
* - Processors with Cortex-A55 cores
* - Processors with Cortex-A65 cores
* - Processors with Cortex-A75 cores
* - Processors with Cortex-A76 cores
* - Processors with Cortex-A77 cores
* - Processors with Exynos M4 cores
* - Processors with Exynos M5 cores
* - Neoverse N1 cores
*/
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
/* Only little cores of Exynos 9810 support FP16 & RDM */
cpuinfo_log_warning("FP16 arithmetics and RDM disabled: only little cores in Exynos 9810 support these extensions");
} else {
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x4100D050): /* Cortex-A55 */
case UINT32_C(0x4100D060): /* Cortex-A65 */
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
case UINT32_C(0x53000030): /* Exynos M4 */
case UINT32_C(0x53000040): /* Exynos M5 */
isa->fp16arith = true;
isa->rdm = true;
break;
}
}
/*
* NEON VDOT instructions are not indicated in /proc/cpuinfo.
* Use a MIDR-based heuristic to whitelist processors known to support it.
*/
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
case UINT32_C(0x53000030): /* Exynos-M4 */
case UINT32_C(0x53000040): /* Exynos-M5 */
isa->dot = true;
break;
case UINT32_C(0x4100D050): /* Cortex A55: revision 1 or later only */
isa->dot = !!(midr_get_variant(midr) >= 1);
break;
case UINT32_C(0x4100D0A0): /* Cortex A75: revision 2 or later only */
isa->dot = !!(midr_get_variant(midr) >= 2);
break;
}
} else {
/* ARMv7 or lower: use feature flags to detect optional features */
/*
* ARM11 (ARM 1136/1156/1176/11 MPCore) processors can report v7 architecture
* even though they support only ARMv6 instruction set.
*/
if (architecture_version == 7 && midr_is_arm11(midr)) {
cpuinfo_log_warning("kernel-reported architecture ARMv7 ignored due to mismatch with processor microarchitecture (ARM11)");
architecture_version = 6;
}
if (architecture_version < 7) {
const uint32_t armv7_features_mask = CPUINFO_ARM_LINUX_FEATURE_VFPV3 | CPUINFO_ARM_LINUX_FEATURE_VFPV3D16 | CPUINFO_ARM_LINUX_FEATURE_VFPD32 |
CPUINFO_ARM_LINUX_FEATURE_VFPV4 | CPUINFO_ARM_LINUX_FEATURE_NEON | CPUINFO_ARM_LINUX_FEATURE_IDIVT | CPUINFO_ARM_LINUX_FEATURE_IDIVA;
if (features & armv7_features_mask) {
architecture_version = 7;
}
}
if ((architecture_version >= 6) || (features & CPUINFO_ARM_LINUX_FEATURE_EDSP) || (architecture_flags & CPUINFO_ARM_LINUX_ARCH_E)) {
isa->armv5e = true;
}
if (architecture_version >= 6) {
isa->armv6 = true;
}
if (architecture_version >= 7) {
isa->armv6k = true;
isa->armv7 = true;
/*
* ARMv7 MP extension (PLDW instruction) is not indicated in /proc/cpuinfo.
* Use heuristic list of supporting processors:
* - Processors supporting UDIV/SDIV instructions ("idiva" + "idivt" features in /proc/cpuinfo)
* - Cortex-A5
* - Cortex-A9
* - Dual-Core Scorpion
* - Krait (supports UDIV/SDIV, but kernels may not report it in /proc/cpuinfo)
*
* TODO: check single-core Qualcomm Scorpion.
*/
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x4100C050): /* Cortex-A5 */
case UINT32_C(0x4100C090): /* Cortex-A9 */
case UINT32_C(0x510002D0): /* Scorpion (dual-core) */
case UINT32_C(0x510004D0): /* Krait (dual-core) */
case UINT32_C(0x510006F0): /* Krait (quad-core) */
isa->armv7mp = true;
break;
default:
/* In practice IDIV instruction implies ARMv7+MP ISA */
isa->armv7mp = (features & CPUINFO_ARM_LINUX_FEATURE_IDIV) == CPUINFO_ARM_LINUX_FEATURE_IDIV;
break;
}
}
if (features & CPUINFO_ARM_LINUX_FEATURE_IWMMXT) {
const uint32_t wcid = read_wcid();
cpuinfo_log_debug("WCID = 0x%08"PRIx32, wcid);
const uint32_t coprocessor_type = (wcid >> 8) & UINT32_C(0xFF);
if (coprocessor_type >= 0x10) {
isa->wmmx = true;
if (coprocessor_type >= 0x20) {
isa->wmmx2 = true;
}
} else {
cpuinfo_log_warning("WMMX ISA disabled: OS reported iwmmxt feature, "
"but WCID coprocessor type 0x%"PRIx32" indicates no WMMX support",
coprocessor_type);
}
}
if ((features & CPUINFO_ARM_LINUX_FEATURE_THUMB) || (architecture_flags & CPUINFO_ARM_LINUX_ARCH_T)) {
isa->thumb = true;
/*
* There is no separate feature flag for Thumb 2.
* All ARMv7 processors and ARM 1156 support Thumb 2.
*/
if (architecture_version >= 7 || midr_is_arm1156(midr)) {
isa->thumb2 = true;
}
}
if (features & CPUINFO_ARM_LINUX_FEATURE_THUMBEE) {
isa->thumbee = true;
}
if ((features & CPUINFO_ARM_LINUX_FEATURE_JAVA) || (architecture_flags & CPUINFO_ARM_LINUX_ARCH_J)) {
isa->jazelle = true;
}
/* Qualcomm Krait may have buggy kernel configuration that doesn't report IDIV */
if ((features & CPUINFO_ARM_LINUX_FEATURE_IDIV) == CPUINFO_ARM_LINUX_FEATURE_IDIV || midr_is_krait(midr)) {
isa->idiv = true;
}
const uint32_t vfp_mask = \
CPUINFO_ARM_LINUX_FEATURE_VFP | CPUINFO_ARM_LINUX_FEATURE_VFPV3 | CPUINFO_ARM_LINUX_FEATURE_VFPV3D16 | \
CPUINFO_ARM_LINUX_FEATURE_VFPD32 | CPUINFO_ARM_LINUX_FEATURE_VFPV4 | CPUINFO_ARM_LINUX_FEATURE_NEON;
if (features & vfp_mask) {
const uint32_t vfpv3_mask = CPUINFO_ARM_LINUX_FEATURE_VFPV3 | CPUINFO_ARM_LINUX_FEATURE_VFPV3D16 | \
CPUINFO_ARM_LINUX_FEATURE_VFPD32 | CPUINFO_ARM_LINUX_FEATURE_VFPV4 | CPUINFO_ARM_LINUX_FEATURE_NEON;
if ((architecture_version >= 7) || (features & vfpv3_mask)) {
isa->vfpv3 = true;
const uint32_t d32_mask = CPUINFO_ARM_LINUX_FEATURE_VFPD32 | CPUINFO_ARM_LINUX_FEATURE_NEON;
if (features & d32_mask) {
isa->d32 = true;
}
} else {
#if defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH) && (__ARM_ARCH >= 7)
isa->vfpv3 = true;
#else
const uint32_t fpsid = read_fpsid();
cpuinfo_log_debug("FPSID = 0x%08"PRIx32, fpsid);
const uint32_t subarchitecture = (fpsid >> 16) & UINT32_C(0x7F);
if (subarchitecture >= 0x01) {
isa->vfpv2 = true;
}
#endif
}
}
if (features & CPUINFO_ARM_LINUX_FEATURE_NEON) {
isa->neon = true;
}
/*
* There is no separate feature flag for FP16 support.
* VFPv4 implies VFPv3-FP16 support (and in practice, NEON-HP as well).
* Additionally, ARM Cortex-A9 and Qualcomm Scorpion support FP16.
*/
if ((features & CPUINFO_ARM_LINUX_FEATURE_VFPV4) || midr_is_cortex_a9(midr) || midr_is_scorpion(midr)) {
isa->fp16 = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_VFPV4) {
isa->fma = true;
}
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_AES) {
isa->aes = true;
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_PMULL) {
isa->pmull = true;
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SHA1) {
isa->sha1 = true;
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SHA2) {
isa->sha2 = true;
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_CRC32) {
isa->crc32 = true;
}
}

View File

@@ -0,0 +1,127 @@
#include <stdint.h>
#include <arm/linux/api.h>
#include <cpuinfo/log.h>
void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
uint32_t features,
uint32_t features2,
uint32_t midr,
const struct cpuinfo_arm_chipset chipset[restrict static 1],
struct cpuinfo_arm_isa isa[restrict static 1])
{
if (features & CPUINFO_ARM_LINUX_FEATURE_AES) {
isa->aes = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_PMULL) {
isa->pmull = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_SHA1) {
isa->sha1 = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_SHA2) {
isa->sha2 = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_CRC32) {
isa->crc32 = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_ATOMICS) {
isa->atomics = true;
}
/*
* Some phones ship with an old kernel configuration that doesn't report NEON FP16 compute extension and SQRDMLAH/SQRDMLSH/UQRDMLAH/UQRDMLSH instructions.
* Use a MIDR-based heuristic to whitelist processors known to support it:
* - Processors with Cortex-A55 cores
* - Processors with Cortex-A65 cores
* - Processors with Cortex-A75 cores
* - Processors with Cortex-A76 cores
* - Processors with Cortex-A77 cores
* - Processors with Exynos M4 cores
* - Processors with Exynos M5 cores
* - Neoverse N1 cores
*/
if (chipset->series == cpuinfo_arm_chipset_series_samsung_exynos && chipset->model == 9810) {
/* Exynos 9810 reports that it supports FP16 compute, but in fact only little cores do */
cpuinfo_log_warning("FP16 arithmetics and RDM disabled: only little cores in Exynos 9810 support these extensions");
} else {
const uint32_t fp16arith_mask = CPUINFO_ARM_LINUX_FEATURE_FPHP | CPUINFO_ARM_LINUX_FEATURE_ASIMDHP;
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x4100D050): /* Cortex-A55 */
case UINT32_C(0x4100D060): /* Cortex-A65 */
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
case UINT32_C(0x51008020): /* Kryo 385 Gold (Cortex-A75) */
case UINT32_C(0x51008030): /* Kryo 385 Silver (Cortex-A55) */
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
case UINT32_C(0x53000030): /* Exynos M4 */
case UINT32_C(0x53000040): /* Exynos M5 */
isa->fp16arith = true;
isa->rdm = true;
break;
default:
if ((features & fp16arith_mask) == fp16arith_mask) {
isa->fp16arith = true;
} else if (features & CPUINFO_ARM_LINUX_FEATURE_FPHP) {
cpuinfo_log_warning("FP16 arithmetics disabled: detected support only for scalar operations");
} else if (features & CPUINFO_ARM_LINUX_FEATURE_ASIMDHP) {
cpuinfo_log_warning("FP16 arithmetics disabled: detected support only for SIMD operations");
}
if (features & CPUINFO_ARM_LINUX_FEATURE_ASIMDRDM) {
isa->rdm = true;
}
break;
}
}
/*
* Many phones ship with an old kernel configuration that doesn't report UDOT/SDOT instructions.
* Use a MIDR-based heuristic to whitelist processors known to support it.
*/
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x4100D060): /* Cortex-A65 */
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
case UINT32_C(0x4100D0C0): /* Neoverse N1 */
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
case UINT32_C(0x4100D4A0): /* Neoverse E1 */
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
case UINT32_C(0x51008040): /* Kryo 485 Gold (Cortex-A76) */
case UINT32_C(0x51008050): /* Kryo 485 Silver (Cortex-A55) */
case UINT32_C(0x53000030): /* Exynos-M4 */
case UINT32_C(0x53000040): /* Exynos-M5 */
isa->dot = true;
break;
case UINT32_C(0x4100D050): /* Cortex A55: revision 1 or later only */
isa->dot = !!(midr_get_variant(midr) >= 1);
break;
case UINT32_C(0x4100D0A0): /* Cortex A75: revision 2 or later only */
isa->dot = !!(midr_get_variant(midr) >= 2);
break;
default:
if (features & CPUINFO_ARM_LINUX_FEATURE_ASIMDDP) {
isa->dot = true;
}
break;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_JSCVT) {
isa->jscvt = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_JSCVT) {
isa->jscvt = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_FCMA) {
isa->fcma = true;
}
if (features & CPUINFO_ARM_LINUX_FEATURE_SVE) {
isa->sve = true;
}
if (features2 & CPUINFO_ARM_LINUX_FEATURE2_SVE2) {
isa->sve2 = true;
}
}

384
3rdparty/cpuinfo/src/arm/linux/api.h vendored Normal file
View File

@@ -0,0 +1,384 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <cpuinfo.h>
#include <cpuinfo/common.h>
#include <arm/midr.h>
#include <arm/api.h>
#include <linux/api.h>
/* No hard limit in the kernel, maximum length observed on non-rogue kernels is 64 */
#define CPUINFO_HARDWARE_VALUE_MAX 64
/* No hard limit in the kernel, maximum length on Raspberry Pi is 8. Add 1 symbol to detect overly large revision strings */
#define CPUINFO_REVISION_VALUE_MAX 9
#ifdef __ANDROID__
/* As per include/sys/system_properties.h in Android NDK */
#define CPUINFO_BUILD_PROP_NAME_MAX 32
#define CPUINFO_BUILD_PROP_VALUE_MAX 92
struct cpuinfo_android_properties {
char proc_cpuinfo_hardware[CPUINFO_HARDWARE_VALUE_MAX];
char ro_product_board[CPUINFO_BUILD_PROP_VALUE_MAX];
char ro_board_platform[CPUINFO_BUILD_PROP_VALUE_MAX];
char ro_mediatek_platform[CPUINFO_BUILD_PROP_VALUE_MAX];
char ro_arch[CPUINFO_BUILD_PROP_VALUE_MAX];
char ro_chipname[CPUINFO_BUILD_PROP_VALUE_MAX];
char ro_hardware_chipname[CPUINFO_BUILD_PROP_VALUE_MAX];
};
#endif
#define CPUINFO_ARM_LINUX_ARCH_T UINT32_C(0x00000001)
#define CPUINFO_ARM_LINUX_ARCH_E UINT32_C(0x00000002)
#define CPUINFO_ARM_LINUX_ARCH_J UINT32_C(0x00000004)
#define CPUINFO_ARM_LINUX_ARCH_TE UINT32_C(0x00000003)
#define CPUINFO_ARM_LINUX_ARCH_TEJ UINT32_C(0x00000007)
struct cpuinfo_arm_linux_proc_cpuinfo_cache {
uint32_t i_size;
uint32_t i_assoc;
uint32_t i_line_length;
uint32_t i_sets;
uint32_t d_size;
uint32_t d_assoc;
uint32_t d_line_length;
uint32_t d_sets;
};
#if CPUINFO_ARCH_ARM
/* arch/arm/include/uapi/asm/hwcap.h */
#define CPUINFO_ARM_LINUX_FEATURE_SWP UINT32_C(0x00000001)
#define CPUINFO_ARM_LINUX_FEATURE_HALF UINT32_C(0x00000002)
#define CPUINFO_ARM_LINUX_FEATURE_THUMB UINT32_C(0x00000004)
#define CPUINFO_ARM_LINUX_FEATURE_26BIT UINT32_C(0x00000008)
#define CPUINFO_ARM_LINUX_FEATURE_FASTMULT UINT32_C(0x00000010)
#define CPUINFO_ARM_LINUX_FEATURE_FPA UINT32_C(0x00000020)
#define CPUINFO_ARM_LINUX_FEATURE_VFP UINT32_C(0x00000040)
#define CPUINFO_ARM_LINUX_FEATURE_EDSP UINT32_C(0x00000080)
#define CPUINFO_ARM_LINUX_FEATURE_JAVA UINT32_C(0x00000100)
#define CPUINFO_ARM_LINUX_FEATURE_IWMMXT UINT32_C(0x00000200)
#define CPUINFO_ARM_LINUX_FEATURE_CRUNCH UINT32_C(0x00000400)
#define CPUINFO_ARM_LINUX_FEATURE_THUMBEE UINT32_C(0x00000800)
#define CPUINFO_ARM_LINUX_FEATURE_NEON UINT32_C(0x00001000)
#define CPUINFO_ARM_LINUX_FEATURE_VFPV3 UINT32_C(0x00002000)
#define CPUINFO_ARM_LINUX_FEATURE_VFPV3D16 UINT32_C(0x00004000) /* Also set for VFPv4 with 16 double-precision registers */
#define CPUINFO_ARM_LINUX_FEATURE_TLS UINT32_C(0x00008000)
#define CPUINFO_ARM_LINUX_FEATURE_VFPV4 UINT32_C(0x00010000)
#define CPUINFO_ARM_LINUX_FEATURE_IDIVA UINT32_C(0x00020000)
#define CPUINFO_ARM_LINUX_FEATURE_IDIVT UINT32_C(0x00040000)
#define CPUINFO_ARM_LINUX_FEATURE_IDIV UINT32_C(0x00060000)
#define CPUINFO_ARM_LINUX_FEATURE_VFPD32 UINT32_C(0x00080000)
#define CPUINFO_ARM_LINUX_FEATURE_LPAE UINT32_C(0x00100000)
#define CPUINFO_ARM_LINUX_FEATURE_EVTSTRM UINT32_C(0x00200000)
#define CPUINFO_ARM_LINUX_FEATURE2_AES UINT32_C(0x00000001)
#define CPUINFO_ARM_LINUX_FEATURE2_PMULL UINT32_C(0x00000002)
#define CPUINFO_ARM_LINUX_FEATURE2_SHA1 UINT32_C(0x00000004)
#define CPUINFO_ARM_LINUX_FEATURE2_SHA2 UINT32_C(0x00000008)
#define CPUINFO_ARM_LINUX_FEATURE2_CRC32 UINT32_C(0x00000010)
#elif CPUINFO_ARCH_ARM64
/* arch/arm64/include/uapi/asm/hwcap.h */
#define CPUINFO_ARM_LINUX_FEATURE_FP UINT32_C(0x00000001)
#define CPUINFO_ARM_LINUX_FEATURE_ASIMD UINT32_C(0x00000002)
#define CPUINFO_ARM_LINUX_FEATURE_EVTSTRM UINT32_C(0x00000004)
#define CPUINFO_ARM_LINUX_FEATURE_AES UINT32_C(0x00000008)
#define CPUINFO_ARM_LINUX_FEATURE_PMULL UINT32_C(0x00000010)
#define CPUINFO_ARM_LINUX_FEATURE_SHA1 UINT32_C(0x00000020)
#define CPUINFO_ARM_LINUX_FEATURE_SHA2 UINT32_C(0x00000040)
#define CPUINFO_ARM_LINUX_FEATURE_CRC32 UINT32_C(0x00000080)
#define CPUINFO_ARM_LINUX_FEATURE_ATOMICS UINT32_C(0x00000100)
#define CPUINFO_ARM_LINUX_FEATURE_FPHP UINT32_C(0x00000200)
#define CPUINFO_ARM_LINUX_FEATURE_ASIMDHP UINT32_C(0x00000400)
#define CPUINFO_ARM_LINUX_FEATURE_CPUID UINT32_C(0x00000800)
#define CPUINFO_ARM_LINUX_FEATURE_ASIMDRDM UINT32_C(0x00001000)
#define CPUINFO_ARM_LINUX_FEATURE_JSCVT UINT32_C(0x00002000)
#define CPUINFO_ARM_LINUX_FEATURE_FCMA UINT32_C(0x00004000)
#define CPUINFO_ARM_LINUX_FEATURE_LRCPC UINT32_C(0x00008000)
#define CPUINFO_ARM_LINUX_FEATURE_DCPOP UINT32_C(0x00010000)
#define CPUINFO_ARM_LINUX_FEATURE_SHA3 UINT32_C(0x00020000)
#define CPUINFO_ARM_LINUX_FEATURE_SM3 UINT32_C(0x00040000)
#define CPUINFO_ARM_LINUX_FEATURE_SM4 UINT32_C(0x00080000)
#define CPUINFO_ARM_LINUX_FEATURE_ASIMDDP UINT32_C(0x00100000)
#define CPUINFO_ARM_LINUX_FEATURE_SHA512 UINT32_C(0x00200000)
#define CPUINFO_ARM_LINUX_FEATURE_SVE UINT32_C(0x00400000)
#define CPUINFO_ARM_LINUX_FEATURE_ASIMDFHM UINT32_C(0x00800000)
#define CPUINFO_ARM_LINUX_FEATURE_DIT UINT32_C(0x01000000)
#define CPUINFO_ARM_LINUX_FEATURE_USCAT UINT32_C(0x02000000)
#define CPUINFO_ARM_LINUX_FEATURE_ILRCPC UINT32_C(0x04000000)
#define CPUINFO_ARM_LINUX_FEATURE_FLAGM UINT32_C(0x08000000)
#define CPUINFO_ARM_LINUX_FEATURE_SSBS UINT32_C(0x10000000)
#define CPUINFO_ARM_LINUX_FEATURE_SB UINT32_C(0x20000000)
#define CPUINFO_ARM_LINUX_FEATURE_PACA UINT32_C(0x40000000)
#define CPUINFO_ARM_LINUX_FEATURE_PACG UINT32_C(0x80000000)
#define CPUINFO_ARM_LINUX_FEATURE2_DCPODP UINT32_C(0x00000001)
#define CPUINFO_ARM_LINUX_FEATURE2_SVE2 UINT32_C(0x00000002)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEAES UINT32_C(0x00000004)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEPMULL UINT32_C(0x00000008)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEBITPERM UINT32_C(0x00000010)
#define CPUINFO_ARM_LINUX_FEATURE2_SVESHA3 UINT32_C(0x00000020)
#define CPUINFO_ARM_LINUX_FEATURE2_SVESM4 UINT32_C(0x00000040)
#define CPUINFO_ARM_LINUX_FEATURE2_FLAGM2 UINT32_C(0x00000080)
#define CPUINFO_ARM_LINUX_FEATURE2_FRINT UINT32_C(0x00000100)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEI8MM UINT32_C(0x00000200)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEF32MM UINT32_C(0x00000400)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEF64MM UINT32_C(0x00000800)
#define CPUINFO_ARM_LINUX_FEATURE2_SVEBF16 UINT32_C(0x00001000)
#define CPUINFO_ARM_LINUX_FEATURE2_I8MM UINT32_C(0x00002000)
#define CPUINFO_ARM_LINUX_FEATURE2_BF16 UINT32_C(0x00004000)
#define CPUINFO_ARM_LINUX_FEATURE2_DGH UINT32_C(0x00008000)
#define CPUINFO_ARM_LINUX_FEATURE2_RNG UINT32_C(0x00010000)
#define CPUINFO_ARM_LINUX_FEATURE2_BTI UINT32_C(0x00020000)
#endif
#define CPUINFO_ARM_LINUX_VALID_ARCHITECTURE UINT32_C(0x00010000)
#define CPUINFO_ARM_LINUX_VALID_IMPLEMENTER UINT32_C(0x00020000)
#define CPUINFO_ARM_LINUX_VALID_VARIANT UINT32_C(0x00040000)
#define CPUINFO_ARM_LINUX_VALID_PART UINT32_C(0x00080000)
#define CPUINFO_ARM_LINUX_VALID_REVISION UINT32_C(0x00100000)
#define CPUINFO_ARM_LINUX_VALID_PROCESSOR UINT32_C(0x00200000)
#define CPUINFO_ARM_LINUX_VALID_FEATURES UINT32_C(0x00400000)
#if CPUINFO_ARCH_ARM
#define CPUINFO_ARM_LINUX_VALID_ICACHE_SIZE UINT32_C(0x01000000)
#define CPUINFO_ARM_LINUX_VALID_ICACHE_SETS UINT32_C(0x02000000)
#define CPUINFO_ARM_LINUX_VALID_ICACHE_WAYS UINT32_C(0x04000000)
#define CPUINFO_ARM_LINUX_VALID_ICACHE_LINE UINT32_C(0x08000000)
#define CPUINFO_ARM_LINUX_VALID_DCACHE_SIZE UINT32_C(0x10000000)
#define CPUINFO_ARM_LINUX_VALID_DCACHE_SETS UINT32_C(0x20000000)
#define CPUINFO_ARM_LINUX_VALID_DCACHE_WAYS UINT32_C(0x40000000)
#define CPUINFO_ARM_LINUX_VALID_DCACHE_LINE UINT32_C(0x80000000)
#endif
#define CPUINFO_ARM_LINUX_VALID_INFO UINT32_C(0x007F0000)
#define CPUINFO_ARM_LINUX_VALID_MIDR UINT32_C(0x003F0000)
#if CPUINFO_ARCH_ARM
#define CPUINFO_ARM_LINUX_VALID_ICACHE UINT32_C(0x0F000000)
#define CPUINFO_ARM_LINUX_VALID_DCACHE UINT32_C(0xF0000000)
#define CPUINFO_ARM_LINUX_VALID_CACHE_LINE UINT32_C(0x88000000)
#endif
struct cpuinfo_arm_linux_processor {
uint32_t architecture_version;
#if CPUINFO_ARCH_ARM
uint32_t architecture_flags;
struct cpuinfo_arm_linux_proc_cpuinfo_cache proc_cpuinfo_cache;
#endif
uint32_t features;
uint32_t features2;
/**
* Main ID Register value.
*/
uint32_t midr;
enum cpuinfo_vendor vendor;
enum cpuinfo_uarch uarch;
uint32_t uarch_index;
/**
* ID of the physical package which includes this logical processor.
* The value is parsed from /sys/devices/system/cpu/cpu<N>/topology/physical_package_id
*/
uint32_t package_id;
/**
* Minimum processor ID on the package which includes this logical processor.
* This value can serve as an ID for the cluster of logical processors: it is the
* same for all logical processors on the same package.
*/
uint32_t package_leader_id;
/**
* Number of logical processors in the package.
*/
uint32_t package_processor_count;
/**
* Maximum frequency, in kHZ.
* The value is parsed from /sys/devices/system/cpu/cpu<N>/cpufreq/cpuinfo_max_freq
* If failed to read or parse the file, the value is 0.
*/
uint32_t max_frequency;
/**
* Minimum frequency, in kHZ.
* The value is parsed from /sys/devices/system/cpu/cpu<N>/cpufreq/cpuinfo_min_freq
* If failed to read or parse the file, the value is 0.
*/
uint32_t min_frequency;
/** Linux processor ID */
uint32_t system_processor_id;
uint32_t flags;
};
struct cpuinfo_arm_linux_cluster {
uint32_t processor_id_min;
uint32_t processor_id_max;
};
/* Returns true if the two processors do belong to the same cluster */
static inline bool cpuinfo_arm_linux_processor_equals(
struct cpuinfo_arm_linux_processor processor_i[restrict static 1],
struct cpuinfo_arm_linux_processor processor_j[restrict static 1])
{
const uint32_t joint_flags = processor_i->flags & processor_j->flags;
bool same_max_frequency = false;
if (joint_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (processor_i->max_frequency != processor_j->max_frequency) {
return false;
} else {
same_max_frequency = true;
}
}
bool same_min_frequency = false;
if (joint_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (processor_i->min_frequency != processor_j->min_frequency) {
return false;
} else {
same_min_frequency = true;
}
}
if ((joint_flags & CPUINFO_ARM_LINUX_VALID_MIDR) == CPUINFO_ARM_LINUX_VALID_MIDR) {
if (processor_i->midr == processor_j->midr) {
if (midr_is_cortex_a53(processor_i->midr)) {
return same_min_frequency & same_max_frequency;
} else {
return true;
}
}
}
return same_max_frequency && same_min_frequency;
}
/* Returns true if the two processors certainly don't belong to the same cluster */
static inline bool cpuinfo_arm_linux_processor_not_equals(
struct cpuinfo_arm_linux_processor processor_i[restrict static 1],
struct cpuinfo_arm_linux_processor processor_j[restrict static 1])
{
const uint32_t joint_flags = processor_i->flags & processor_j->flags;
if (joint_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (processor_i->max_frequency != processor_j->max_frequency) {
return true;
}
}
if (joint_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (processor_i->min_frequency != processor_j->min_frequency) {
return true;
}
}
if ((joint_flags & CPUINFO_ARM_LINUX_VALID_MIDR) == CPUINFO_ARM_LINUX_VALID_MIDR) {
if (processor_i->midr != processor_j->midr) {
return true;
}
}
return false;
}
CPUINFO_INTERNAL bool cpuinfo_arm_linux_parse_proc_cpuinfo(
char hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
char revision[restrict static CPUINFO_REVISION_VALUE_MAX],
uint32_t max_processors_count,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors_count]);
#if CPUINFO_ARCH_ARM
CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_getauxval(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1]);
CPUINFO_INTERNAL bool cpuinfo_arm_linux_hwcap_from_procfs(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1]);
CPUINFO_INTERNAL void cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
uint32_t features,
uint32_t features2,
uint32_t midr,
uint32_t architecture_version,
uint32_t architecture_flags,
const struct cpuinfo_arm_chipset chipset[restrict static 1],
struct cpuinfo_arm_isa isa[restrict static 1]);
#elif CPUINFO_ARCH_ARM64
CPUINFO_INTERNAL void cpuinfo_arm_linux_hwcap_from_getauxval(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1]);
CPUINFO_INTERNAL void cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
uint32_t features,
uint32_t features2,
uint32_t midr,
const struct cpuinfo_arm_chipset chipset[restrict static 1],
struct cpuinfo_arm_isa isa[restrict static 1]);
#endif
#ifdef __ANDROID__
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset(
const struct cpuinfo_android_properties properties[restrict static 1],
uint32_t cores,
uint32_t max_cpu_freq_max);
#else
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_linux_decode_chipset(
const char hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
const char revision[restrict static CPUINFO_REVISION_VALUE_MAX],
uint32_t cores,
uint32_t max_cpu_freq_max);
#endif
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_hardware(
const char proc_cpuinfo_hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
uint32_t cores, uint32_t max_cpu_freq_max, bool is_tegra);
#ifdef __ANDROID__
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_product_board(
const char ro_product_board[restrict static CPUINFO_BUILD_PROP_VALUE_MAX],
uint32_t cores, uint32_t max_cpu_freq_max);
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_board_platform(
const char ro_board_platform[restrict static CPUINFO_BUILD_PROP_VALUE_MAX],
uint32_t cores, uint32_t max_cpu_freq_max);
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_mediatek_platform(
const char ro_mediatek_platform[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_arch(
const char ro_arch[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_chipname(
const char ro_chipname[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_android_decode_chipset_from_ro_hardware_chipname(
const char ro_hardware_chipname[restrict static CPUINFO_BUILD_PROP_VALUE_MAX]);
#else
CPUINFO_INTERNAL struct cpuinfo_arm_chipset
cpuinfo_arm_linux_decode_chipset_from_proc_cpuinfo_revision(
const char proc_cpuinfo_revision[restrict static CPUINFO_REVISION_VALUE_MAX]);
#endif
CPUINFO_INTERNAL bool cpuinfo_arm_linux_detect_core_clusters_by_heuristic(
uint32_t usable_processors,
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
CPUINFO_INTERNAL void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
CPUINFO_INTERNAL void cpuinfo_arm_linux_count_cluster_processors(
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
CPUINFO_INTERNAL uint32_t cpuinfo_arm_linux_detect_cluster_midr(
const struct cpuinfo_arm_chipset chipset[restrict static 1],
uint32_t max_processors,
uint32_t usable_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors]);
extern CPUINFO_INTERNAL const uint32_t* cpuinfo_linux_cpu_to_uarch_index_map;
extern CPUINFO_INTERNAL uint32_t cpuinfo_linux_cpu_to_uarch_index_map_entries;

3860
3rdparty/cpuinfo/src/arm/linux/chipset.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,493 @@
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <cpuinfo.h>
#include <arm/linux/api.h>
#if defined(__ANDROID__)
#include <arm/android/api.h>
#endif
#include <arm/api.h>
#include <arm/midr.h>
#include <linux/api.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
static inline bool bitmask_all(uint32_t bitfield, uint32_t mask) {
return (bitfield & mask) == mask;
}
/*
* Assigns logical processors to clusters of cores using heuristic based on the typical configuration of clusters for
* 5, 6, 8, and 10 cores:
* - 5 cores (ARM32 Android only): 2 clusters of 4+1 cores
* - 6 cores: 2 clusters of 4+2 cores
* - 8 cores: 2 clusters of 4+4 cores
* - 10 cores: 3 clusters of 4+4+2 cores
*
* The function must be called after parsing OS-provided information on core clusters.
* Its purpose is to detect clusters of cores when OS-provided information is lacking or incomplete, i.e.
* - Linux kernel is not configured to report information in sysfs topology leaf.
* - Linux kernel reports topology information only for online cores, and only cores on one cluster are online, e.g.:
* - Exynos 8890 has 8 cores in 4+4 clusters, but only the first cluster of 4 cores is reported, and cluster
* configuration of logical processors 4-7 is not reported (all remaining processors 4-7 form cluster 1)
* - MT6797 has 10 cores in 4+4+2, but only the first cluster of 4 cores is reported, and cluster configuration
* of logical processors 4-9 is not reported (processors 4-7 form cluster 1, and processors 8-9 form cluster 2).
*
* Heuristic assignment of processors to the above pre-defined clusters fails if such assignment would contradict
* information provided by the operating system:
* - Any of the OS-reported processor clusters is different than the corresponding heuristic cluster.
* - Processors in a heuristic cluster have no OS-provided cluster siblings information, but have known and different
* minimum/maximum frequency.
* - Processors in a heuristic cluster have no OS-provided cluster siblings information, but have known and different
* MIDR components.
*
* If the heuristic assignment of processors to clusters of cores fails, all processors' clusters are unchanged.
*
* @param usable_processors - number of processors in the @p processors array with CPUINFO_LINUX_FLAG_VALID flags.
* @param max_processors - number of elements in the @p processors array.
* @param[in,out] processors - processor descriptors with pre-parsed POSSIBLE and PRESENT flags, minimum/maximum
* frequency, MIDR infromation, and core cluster (package siblings list) information.
*
* @retval true if the heuristic successfully assigned all processors into clusters of cores.
* @retval false if known details about processors contradict the heuristic configuration of core clusters.
*/
bool cpuinfo_arm_linux_detect_core_clusters_by_heuristic(
uint32_t usable_processors,
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors])
{
uint32_t cluster_processors[3];
switch (usable_processors) {
case 10:
cluster_processors[0] = 4;
cluster_processors[1] = 4;
cluster_processors[2] = 2;
break;
case 8:
cluster_processors[0] = 4;
cluster_processors[1] = 4;
break;
case 6:
cluster_processors[0] = 4;
cluster_processors[1] = 2;
break;
#if defined(__ANDROID__) && CPUINFO_ARCH_ARM
case 5:
/*
* The only processor with 5 cores is Leadcore L1860C (ARMv7, mobile),
* but this configuration is not too unreasonable for a virtualized ARM server.
*/
cluster_processors[0] = 4;
cluster_processors[1] = 1;
break;
#endif
default:
return false;
}
/*
* Assignment of processors to core clusters is done in two passes:
* 1. Verify that the clusters proposed by heuristic are compatible with known details about processors.
* 2. If verification passed, update core clusters for the processors.
*/
uint32_t cluster = 0;
uint32_t expected_cluster_processors = 0;
uint32_t cluster_start, cluster_flags, cluster_midr, cluster_max_frequency, cluster_min_frequency;
bool expected_cluster_exists;
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (expected_cluster_processors == 0) {
/* Expect this processor to start a new cluster */
expected_cluster_exists = !!(processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER);
if (expected_cluster_exists) {
if (processors[i].package_leader_id != i) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"processor %"PRIu32" is expected to start a new cluster #%"PRIu32" with %"PRIu32" cores, "
"but system siblings lists reported it as a sibling of processor %"PRIu32,
i, cluster, cluster_processors[cluster], processors[i].package_leader_id);
return false;
}
} else {
cluster_flags = 0;
}
cluster_start = i;
expected_cluster_processors = cluster_processors[cluster++];
} else {
/* Expect this processor to belong to the same cluster as processor */
if (expected_cluster_exists) {
/*
* The cluster suggested by the heuristic was already parsed from system siblings lists.
* For all processors we expect in the cluster, check that:
* - They have pre-assigned cluster from siblings lists (CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER flag).
* - They were assigned to the same cluster based on siblings lists
* (package_leader_id points to the first processor in the cluster).
*/
if ((processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER) == 0) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"processor %"PRIu32" is expected to belong to the cluster of processor %"PRIu32", "
"but system siblings lists did not report it as a sibling of processor %"PRIu32,
i, cluster_start, cluster_start);
return false;
}
if (processors[i].package_leader_id != cluster_start) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"processor %"PRIu32" is expected to belong to the cluster of processor %"PRIu32", "
"but system siblings lists reported it to belong to the cluster of processor %"PRIu32,
i, cluster_start, cluster_start);
return false;
}
} else {
/*
* The cluster suggest by the heuristic was not parsed from system siblings lists.
* For all processors we expect in the cluster, check that:
* - They have no pre-assigned cluster from siblings lists.
* - If their min/max CPU frequency is known, it is the same.
* - If any part of their MIDR (Implementer, Variant, Part, Revision) is known, it is the same.
*/
if (processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"processor %"PRIu32" is expected to be unassigned to any cluster, "
"but system siblings lists reported it to belong to the cluster of processor %"PRIu32,
i, processors[i].package_leader_id);
return false;
}
if (processors[i].flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (cluster_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (cluster_min_frequency != processors[i].min_frequency) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"minimum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of its expected cluster (%"PRIu32" KHz)",
i, processors[i].min_frequency, cluster_min_frequency);
return false;
}
} else {
cluster_min_frequency = processors[i].min_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MIN_FREQUENCY;
}
}
if (processors[i].flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (cluster_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (cluster_max_frequency != processors[i].max_frequency) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"maximum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of its expected cluster (%"PRIu32" KHz)",
i, processors[i].max_frequency, cluster_max_frequency);
return false;
}
} else {
cluster_max_frequency = processors[i].max_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MAX_FREQUENCY;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
if ((cluster_midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK)) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"CPU Implementer of processor %"PRIu32" (0x%02"PRIx32") is different than of its expected cluster (0x%02"PRIx32")",
i, midr_get_implementer(processors[i].midr), midr_get_implementer(cluster_midr));
return false;
}
} else {
cluster_midr = midr_copy_implementer(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_IMPLEMENTER;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
if ((cluster_midr & CPUINFO_ARM_MIDR_VARIANT_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_VARIANT_MASK)) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"CPU Variant of processor %"PRIu32" (0x%"PRIx32") is different than of its expected cluster (0x%"PRIx32")",
i, midr_get_variant(processors[i].midr), midr_get_variant(cluster_midr));
return false;
}
} else {
cluster_midr = midr_copy_variant(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_VARIANT;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_PART) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_PART) {
if ((cluster_midr & CPUINFO_ARM_MIDR_PART_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_PART_MASK)) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"CPU Part of processor %"PRIu32" (0x%03"PRIx32") is different than of its expected cluster (0x%03"PRIx32")",
i, midr_get_part(processors[i].midr), midr_get_part(cluster_midr));
return false;
}
} else {
cluster_midr = midr_copy_part(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_PART;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
if ((cluster_midr & CPUINFO_ARM_MIDR_REVISION_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_REVISION_MASK)) {
cpuinfo_log_debug(
"heuristic detection of core clusters failed: "
"CPU Revision of processor %"PRIu32" (0x%"PRIx32") is different than of its expected cluster (0x%"PRIx32")",
i, midr_get_revision(cluster_midr), midr_get_revision(processors[i].midr));
return false;
}
} else {
cluster_midr = midr_copy_revision(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_REVISION;
}
}
}
}
expected_cluster_processors--;
}
}
/* Verification passed, assign all processors to new clusters */
cluster = 0;
expected_cluster_processors = 0;
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (expected_cluster_processors == 0) {
/* Expect this processor to start a new cluster */
cluster_start = i;
expected_cluster_processors = cluster_processors[cluster++];
} else {
/* Expect this processor to belong to the same cluster as processor */
if (!(processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER)) {
cpuinfo_log_debug("assigned processor %"PRIu32" to cluster of processor %"PRIu32" based on heuristic",
i, cluster_start);
}
processors[i].package_leader_id = cluster_start;
processors[i].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
}
expected_cluster_processors--;
}
}
return true;
}
/*
* Assigns logical processors to clusters of cores in sequential manner:
* - Clusters detected from OS-provided information are unchanged:
* - Processors assigned to these clusters stay assigned to the same clusters
* - No new processors are added to these clusters
* - Processors without pre-assigned cluster are clustered in one sequential scan:
* - If known details (min/max frequency, MIDR components) of a processor are compatible with a preceeding
* processor, without pre-assigned cluster, the processor is assigned to the cluster of the preceeding processor.
* - If known details (min/max frequency, MIDR components) of a processor are not compatible with a preceeding
* processor, the processor is assigned to a newly created cluster.
*
* The function must be called after parsing OS-provided information on core clusters, and usually is called only
* if heuristic assignment of processors to clusters (cpuinfo_arm_linux_cluster_processors_by_heuristic) failed.
*
* Its purpose is to detect clusters of cores when OS-provided information is lacking or incomplete, i.e.
* - Linux kernel is not configured to report information in sysfs topology leaf.
* - Linux kernel reports topology information only for online cores, and all cores on some of the clusters are offline.
*
* Sequential assignment of processors to clusters always succeeds, and upon exit, all usable processors in the
* @p processors array have cluster information.
*
* @param max_processors - number of elements in the @p processors array.
* @param[in,out] processors - processor descriptors with pre-parsed POSSIBLE and PRESENT flags, minimum/maximum
* frequency, MIDR infromation, and core cluster (package siblings list) information.
*
* @retval true if the heuristic successfully assigned all processors into clusters of cores.
* @retval false if known details about processors contradict the heuristic configuration of core clusters.
*/
void cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors])
{
uint32_t cluster_flags = 0;
uint32_t cluster_processors = 0;
uint32_t cluster_start, cluster_midr, cluster_max_frequency, cluster_min_frequency;
for (uint32_t i = 0; i < max_processors; i++) {
if ((processors[i].flags & (CPUINFO_LINUX_FLAG_VALID | CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER)) == CPUINFO_LINUX_FLAG_VALID) {
if (cluster_processors == 0) {
goto new_cluster;
}
if (processors[i].flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (cluster_flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
if (cluster_min_frequency != processors[i].min_frequency) {
cpuinfo_log_info(
"minimum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceeding cluster (%"PRIu32" KHz); "
"processor %"PRIu32" starts to a new cluster",
i, processors[i].min_frequency, cluster_min_frequency, i);
goto new_cluster;
}
} else {
cluster_min_frequency = processors[i].min_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MIN_FREQUENCY;
}
}
if (processors[i].flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (cluster_flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (cluster_max_frequency != processors[i].max_frequency) {
cpuinfo_log_debug(
"maximum frequency of processor %"PRIu32" (%"PRIu32" KHz) is different than of preceeding cluster (%"PRIu32" KHz); "
"processor %"PRIu32" starts a new cluster",
i, processors[i].max_frequency, cluster_max_frequency, i);
goto new_cluster;
}
} else {
cluster_max_frequency = processors[i].max_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MAX_FREQUENCY;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
if ((cluster_midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK)) {
cpuinfo_log_debug(
"CPU Implementer of processor %"PRIu32" (0x%02"PRIx32") is different than of preceeding cluster (0x%02"PRIx32"); "
"processor %"PRIu32" starts to a new cluster",
i, midr_get_implementer(processors[i].midr), midr_get_implementer(cluster_midr), i);
goto new_cluster;
}
} else {
cluster_midr = midr_copy_implementer(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_IMPLEMENTER;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
if ((cluster_midr & CPUINFO_ARM_MIDR_VARIANT_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_VARIANT_MASK)) {
cpuinfo_log_debug(
"CPU Variant of processor %"PRIu32" (0x%"PRIx32") is different than of its expected cluster (0x%"PRIx32")"
"processor %"PRIu32" starts to a new cluster",
i, midr_get_variant(processors[i].midr), midr_get_variant(cluster_midr), i);
goto new_cluster;
}
} else {
cluster_midr = midr_copy_variant(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_VARIANT;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_PART) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_PART) {
if ((cluster_midr & CPUINFO_ARM_MIDR_PART_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_PART_MASK)) {
cpuinfo_log_debug(
"CPU Part of processor %"PRIu32" (0x%03"PRIx32") is different than of its expected cluster (0x%03"PRIx32")"
"processor %"PRIu32" starts to a new cluster",
i, midr_get_part(processors[i].midr), midr_get_part(cluster_midr), i);
goto new_cluster;
}
} else {
cluster_midr = midr_copy_part(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_PART;
}
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
if (cluster_flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
if ((cluster_midr & CPUINFO_ARM_MIDR_REVISION_MASK) != (processors[i].midr & CPUINFO_ARM_MIDR_REVISION_MASK)) {
cpuinfo_log_debug(
"CPU Revision of processor %"PRIu32" (0x%"PRIx32") is different than of its expected cluster (0x%"PRIx32")"
"processor %"PRIu32" starts to a new cluster",
i, midr_get_revision(cluster_midr), midr_get_revision(processors[i].midr), i);
goto new_cluster;
}
} else {
cluster_midr = midr_copy_revision(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_REVISION;
}
}
/* All checks passed, attach processor to the preceeding cluster */
cluster_processors++;
processors[i].package_leader_id = cluster_start;
processors[i].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
cpuinfo_log_debug("assigned processor %"PRIu32" to preceeding cluster of processor %"PRIu32, i, cluster_start);
continue;
new_cluster:
/* Create a new cluster starting with processor i */
cluster_start = i;
processors[i].package_leader_id = i;
processors[i].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
cluster_processors = 1;
/* Copy known information from processor to cluster, and set the flags accordingly */
cluster_flags = 0;
if (processors[i].flags & CPUINFO_LINUX_FLAG_MIN_FREQUENCY) {
cluster_min_frequency = processors[i].min_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MIN_FREQUENCY;
}
if (processors[i].flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
cluster_max_frequency = processors[i].max_frequency;
cluster_flags |= CPUINFO_LINUX_FLAG_MAX_FREQUENCY;
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
cluster_midr = midr_copy_implementer(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_IMPLEMENTER;
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
cluster_midr = midr_copy_variant(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_VARIANT;
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_PART) {
cluster_midr = midr_copy_part(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_PART;
}
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
cluster_midr = midr_copy_revision(cluster_midr, processors[i].midr);
cluster_flags |= CPUINFO_ARM_LINUX_VALID_REVISION;
}
}
}
}
/*
* Counts the number of logical processors in each core cluster.
* This function should be called after all processors are assigned to core clusters.
*
* @param max_processors - number of elements in the @p processors array.
* @param[in,out] processors - processor descriptors with pre-parsed POSSIBLE and PRESENT flags,
* and decoded core cluster (package_leader_id) information.
* The function expects the value of processors[i].package_processor_count to be zero.
* Upon return, processors[i].package_processor_count will contain the number of logical
* processors in the respective core cluster.
*/
void cpuinfo_arm_linux_count_cluster_processors(
uint32_t max_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors])
{
/* First pass: accumulate the number of processors at the group leader's package_processor_count */
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
const uint32_t package_leader_id = processors[i].package_leader_id;
processors[package_leader_id].package_processor_count += 1;
}
}
/* Second pass: copy the package_processor_count from the group leader processor */
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
const uint32_t package_leader_id = processors[i].package_leader_id;
processors[i].package_processor_count = processors[package_leader_id].package_processor_count;
}
}
}

44
3rdparty/cpuinfo/src/arm/linux/cp.h vendored Normal file
View File

@@ -0,0 +1,44 @@
#include <stdint.h>
#if CPUINFO_MOCK
extern uint32_t cpuinfo_arm_fpsid;
extern uint32_t cpuinfo_arm_mvfr0;
extern uint32_t cpuinfo_arm_wcid;
static inline uint32_t read_fpsid(void) {
return cpuinfo_arm_fpsid;
}
static inline uint32_t read_mvfr0(void) {
return cpuinfo_arm_mvfr0;
}
static inline uint32_t read_wcid(void) {
return cpuinfo_arm_wcid;
}
#else
#if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_8A__) && !(defined(__ARM_ARCH) && (__ARM_ARCH >= 7))
/*
* CoProcessor 10 is inaccessible from user mode since ARMv7,
* and clang refuses to compile inline assembly when targeting ARMv7+
*/
static inline uint32_t read_fpsid(void) {
uint32_t fpsid;
__asm__ __volatile__("MRC p10, 0x7, %[fpsid], cr0, cr0, 0" : [fpsid] "=r" (fpsid));
return fpsid;
}
static inline uint32_t read_mvfr0(void) {
uint32_t mvfr0;
__asm__ __volatile__("MRC p10, 0x7, %[mvfr0], cr7, cr0, 0" : [mvfr0] "=r" (mvfr0));
return mvfr0;
}
#endif
static inline uint32_t read_wcid(void) {
uint32_t wcid;
__asm__ __volatile__("MRC p1, 0, %[wcid], c0, c0" : [wcid] "=r" (wcid));
return wcid;
}
#endif

908
3rdparty/cpuinfo/src/arm/linux/cpuinfo.c vendored Normal file
View File

@@ -0,0 +1,908 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <linux/api.h>
#include <arm/linux/api.h>
#include <arm/midr.h>
#include <cpuinfo/log.h>
/*
* Size, in chars, of the on-stack buffer used for parsing lines of /proc/cpuinfo.
* This is also the limit on the length of a single line.
*/
#define BUFFER_SIZE 1024
static uint32_t parse_processor_number(
const char* processor_start,
const char* processor_end)
{
const size_t processor_length = (size_t) (processor_end - processor_start);
if (processor_length == 0) {
cpuinfo_log_warning("Processor number in /proc/cpuinfo is ignored: string is empty");
return 0;
}
uint32_t processor_number = 0;
for (const char* digit_ptr = processor_start; digit_ptr != processor_end; digit_ptr++) {
const uint32_t digit = (uint32_t) (*digit_ptr - '0');
if (digit > 10) {
cpuinfo_log_warning("non-decimal suffix %.*s in /proc/cpuinfo processor number is ignored",
(int) (processor_end - digit_ptr), digit_ptr);
break;
}
processor_number = processor_number * 10 + digit;
}
return processor_number;
}
/*
* Full list of ARM features reported in /proc/cpuinfo:
*
* * swp - support for SWP instruction (deprecated in ARMv7, can be removed in future)
* * half - support for half-word loads and stores. These instruction are part of ARMv4,
* so no need to check it on supported CPUs.
* * thumb - support for 16-bit Thumb instruction set. Note that BX instruction is detected
* by ARMv4T architecture, not by this flag.
* * 26bit - old CPUs merged 26-bit PC and program status register (flags) into 32-bit PC
* and had special instructions for working with packed PC. Now it is all deprecated.
* * fastmult - most old ARM CPUs could only compute 2 bits of multiplication result per clock
* cycle, but CPUs with M suffix (e.g. ARM7TDMI) could compute 4 bits per cycle.
* Of course, now it makes no sense.
* * fpa - floating point accelerator available. On original ARM ABI all floating-point operations
* generated FPA instructions. If FPA was not available, these instructions generated
* "illegal operation" interrupts, and the OS processed them by emulating the FPA instructions.
* Debian used this ABI before it switched to EABI. Now FPA is deprecated.
* * vfp - vector floating point instructions. Available on most modern CPUs (as part of VFPv3).
* Required by Android ARMv7A ABI and by Ubuntu on ARM.
* Note: there is no flag for VFPv2.
* * edsp - V5E instructions: saturating add/sub and 16-bit x 16-bit -> 32/64-bit multiplications.
* Required on Android, supported by all CPUs in production.
* * java - Jazelle extension. Supported on most CPUs.
* * iwmmxt - Intel/Marvell Wireless MMX instructions. 64-bit integer SIMD.
* Supported on XScale (Since PXA270) and Sheeva (PJ1, PJ4) architectures.
* Note that there is no flag for WMMX2 instructions.
* * crunch - Maverick Crunch instructions. Junk.
* * thumbee - ThumbEE instructions. Almost no documentation is available.
* * neon - NEON instructions (aka Advanced SIMD). MVFR1 register gives more
* fine-grained information on particular supported features, but
* the Linux kernel exports only a single flag for all of them.
* According to ARMv7A docs it also implies the availability of VFPv3
* (with 32 double-precision registers d0-d31).
* * vfpv3 - VFPv3 instructions. Available on most modern CPUs. Augment VFPv2 by
* conversion to/from integers and load constant instructions.
* Required by Android ARMv7A ABI and by Ubuntu on ARM.
* * vfpv3d16 - VFPv3 instructions with only 16 double-precision registers (d0-d15).
* * tls - software thread ID registers.
* Used by kernel (and likely libc) for efficient implementation of TLS.
* * vfpv4 - fused multiply-add instructions.
* * idiva - DIV instructions available in ARM mode.
* * idivt - DIV instructions available in Thumb mode.
* * vfpd32 - VFP (of any version) with 32 double-precision registers d0-d31.
* * lpae - Large Physical Address Extension (physical address up to 40 bits).
* * evtstrm - generation of Event Stream by timer.
* * aes - AES instructions.
* * pmull - Polinomial Multiplication instructions.
* * sha1 - SHA1 instructions.
* * sha2 - SHA2 instructions.
* * crc32 - CRC32 instructions.
*
* /proc/cpuinfo on ARM is populated in file arch/arm/kernel/setup.c in Linux kernel
* Note that some devices may use patched Linux kernels with different feature names.
* However, the names above were checked on a large number of /proc/cpuinfo listings.
*/
static void parse_features(
const char* features_start,
const char* features_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
const char* feature_start = features_start;
const char* feature_end;
/* Mark the features as valid */
processor->flags |= CPUINFO_ARM_LINUX_VALID_FEATURES | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
do {
feature_end = feature_start + 1;
for (; feature_end != features_end; feature_end++) {
if (*feature_end == ' ') {
break;
}
}
const size_t feature_length = (size_t) (feature_end - feature_start);
switch (feature_length) {
case 2:
if (memcmp(feature_start, "fp", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FP;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "wp", feature_length) == 0) {
/*
* Some AArch64 kernels, including the one on Nexus 5X,
* erroneously report "swp" as "wp" to AArch32 programs
*/
processor->features |= CPUINFO_ARM_LINUX_FEATURE_SWP;
#endif
} else {
goto unexpected;
}
break;
case 3:
if (memcmp(feature_start, "aes", feature_length) == 0) {
#if CPUINFO_ARCH_ARM
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_AES;
#elif CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_AES;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "swp", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_SWP;
} else if (memcmp(feature_start, "fpa", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FPA;
} else if (memcmp(feature_start, "vfp", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_VFP;
} else if (memcmp(feature_start, "tls", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_TLS;
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unexpected;
}
break;
case 4:
if (memcmp(feature_start, "sha1", feature_length) == 0) {
#if CPUINFO_ARCH_ARM
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_SHA1;
#elif CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_SHA1;
#endif
} else if (memcmp(feature_start, "sha2", feature_length) == 0) {
#if CPUINFO_ARCH_ARM
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_SHA2;
#elif CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_SHA2;
#endif
} else if (memcmp(feature_start, "fphp", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FPHP;
#endif
} else if (memcmp(feature_start, "fcma", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FCMA;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "half", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_HALF;
} else if (memcmp(feature_start, "edsp", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_EDSP;
} else if (memcmp(feature_start, "java", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_JAVA;
} else if (memcmp(feature_start, "neon", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_NEON;
} else if (memcmp(feature_start, "lpae", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_LPAE;
} else if (memcmp(feature_start, "tlsi", feature_length) == 0) {
/*
* Some AArch64 kernels, including the one on Nexus 5X,
* erroneously report "tls" as "tlsi" to AArch32 programs
*/
processor->features |= CPUINFO_ARM_LINUX_FEATURE_TLS;
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unexpected;
}
break;
case 5:
if (memcmp(feature_start, "pmull", feature_length) == 0) {
#if CPUINFO_ARCH_ARM
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_PMULL;
#elif CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_PMULL;
#endif
} else if (memcmp(feature_start, "crc32", feature_length) == 0) {
#if CPUINFO_ARCH_ARM
processor->features2 |= CPUINFO_ARM_LINUX_FEATURE2_CRC32;
#elif CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_CRC32;
#endif
} else if (memcmp(feature_start, "asimd", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ASIMD;
#endif
} else if (memcmp(feature_start, "cpuid", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_CPUID;
#endif
} else if (memcmp(feature_start, "jscvt", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_JSCVT;
#endif
} else if (memcmp(feature_start, "lrcpc", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_LRCPC;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "thumb", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_THUMB;
} else if (memcmp(feature_start, "26bit", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_26BIT;
} else if (memcmp(feature_start, "vfpv3", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_VFPV3;
} else if (memcmp(feature_start, "vfpv4", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_VFPV4;
} else if (memcmp(feature_start, "idiva", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_IDIVA;
} else if (memcmp(feature_start, "idivt", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_IDIVT;
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unexpected;
}
break;
#if CPUINFO_ARCH_ARM
case 6:
if (memcmp(feature_start, "iwmmxt", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_IWMMXT;
} else if (memcmp(feature_start, "crunch", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_CRUNCH;
} else if (memcmp(feature_start, "vfpd32", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_VFPD32;
} else {
goto unexpected;
}
break;
#endif /* CPUINFO_ARCH_ARM */
case 7:
if (memcmp(feature_start, "evtstrm", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_EVTSTRM;
} else if (memcmp(feature_start, "atomics", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ATOMICS;
#endif
} else if (memcmp(feature_start, "asimdhp", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ASIMDHP;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "thumbee", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_THUMBEE;
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unexpected;
}
break;
case 8:
if (memcmp(feature_start, "asimdrdm", feature_length) == 0) {
#if CPUINFO_ARCH_ARM64
processor->features |= CPUINFO_ARM_LINUX_FEATURE_ASIMDRDM;
#endif
#if CPUINFO_ARCH_ARM
} else if (memcmp(feature_start, "fastmult", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_FASTMULT;
} else if (memcmp(feature_start, "vfpv3d16", feature_length) == 0) {
processor->features |= CPUINFO_ARM_LINUX_FEATURE_VFPV3D16;
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unexpected;
}
break;
default:
unexpected:
cpuinfo_log_warning("unexpected /proc/cpuinfo feature \"%.*s\" is ignored",
(int) feature_length, feature_start);
break;
}
feature_start = feature_end;
for (; feature_start != features_end; feature_start++) {
if (*feature_start != ' ') {
break;
}
}
} while (feature_start != feature_end);
}
static void parse_cpu_architecture(
const char* cpu_architecture_start,
const char* cpu_architecture_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
const size_t cpu_architecture_length = (size_t) (cpu_architecture_end - cpu_architecture_start);
/* Early AArch64 kernels report "CPU architecture: AArch64" instead of a numeric value 8 */
if (cpu_architecture_length == 7) {
if (memcmp(cpu_architecture_start, "AArch64", cpu_architecture_length) == 0) {
processor->midr = midr_set_architecture(processor->midr, UINT32_C(0xF));
processor->architecture_version = 8;
processor->flags |= CPUINFO_ARM_LINUX_VALID_ARCHITECTURE | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
return;
}
}
uint32_t architecture = 0;
const char* cpu_architecture_ptr = cpu_architecture_start;
for (; cpu_architecture_ptr != cpu_architecture_end; cpu_architecture_ptr++) {
const uint32_t digit = (*cpu_architecture_ptr) - '0';
/* Verify that CPU architecture is a decimal number */
if (digit >= 10) {
break;
}
architecture = architecture * 10 + digit;
}
if (cpu_architecture_ptr == cpu_architecture_start) {
cpuinfo_log_warning("CPU architecture %.*s in /proc/cpuinfo is ignored due to non-digit at the beginning of the string",
(int) cpu_architecture_length, cpu_architecture_start);
} else {
if (architecture != 0) {
processor->architecture_version = architecture;
processor->flags |= CPUINFO_ARM_LINUX_VALID_ARCHITECTURE | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
for (; cpu_architecture_ptr != cpu_architecture_end; cpu_architecture_ptr++) {
const char feature = *cpu_architecture_ptr;
switch (feature) {
#if CPUINFO_ARCH_ARM
case 'T':
processor->architecture_flags |= CPUINFO_ARM_LINUX_ARCH_T;
break;
case 'E':
processor->architecture_flags |= CPUINFO_ARM_LINUX_ARCH_E;
break;
case 'J':
processor->architecture_flags |= CPUINFO_ARM_LINUX_ARCH_J;
break;
#endif /* CPUINFO_ARCH_ARM */
case ' ':
case '\t':
/* Ignore whitespace at the end */
break;
default:
cpuinfo_log_warning("skipped unknown architectural feature '%c' for ARMv%"PRIu32,
feature, architecture);
break;
}
}
} else {
cpuinfo_log_warning("CPU architecture %.*s in /proc/cpuinfo is ignored due to invalid value (0)",
(int) cpu_architecture_length, cpu_architecture_start);
}
}
uint32_t midr_architecture = UINT32_C(0xF);
#if CPUINFO_ARCH_ARM
switch (processor->architecture_version) {
case 6:
midr_architecture = UINT32_C(0x7); /* ARMv6 */
break;
case 5:
if ((processor->architecture_flags & CPUINFO_ARM_LINUX_ARCH_TEJ) == CPUINFO_ARM_LINUX_ARCH_TEJ) {
midr_architecture = UINT32_C(0x6); /* ARMv5TEJ */
} else if ((processor->architecture_flags & CPUINFO_ARM_LINUX_ARCH_TE) == CPUINFO_ARM_LINUX_ARCH_TE) {
midr_architecture = UINT32_C(0x5); /* ARMv5TE */
} else {
midr_architecture = UINT32_C(0x4); /* ARMv5T */
}
break;
}
#endif
processor->midr = midr_set_architecture(processor->midr, midr_architecture);
}
static void parse_cpu_part(
const char* cpu_part_start,
const char* cpu_part_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
const size_t cpu_part_length = (size_t) (cpu_part_end - cpu_part_start);
/*
* CPU part should contain hex prefix (0x) and one to three hex digits.
* I have never seen less than three digits as a value of this field,
* but I don't think it is impossible to see such values in future.
* Value can not contain more than three hex digits since
* Main ID Register (MIDR) assigns only a 12-bit value for CPU part.
*/
if (cpu_part_length < 3 || cpu_part_length > 5) {
cpuinfo_log_warning("CPU part %.*s in /proc/cpuinfo is ignored due to unexpected length (%zu)",
(int) cpu_part_length, cpu_part_start, cpu_part_length);
return;
}
/* Verify the presence of hex prefix */
if (cpu_part_start[0] != '0' || cpu_part_start[1] != 'x') {
cpuinfo_log_warning("CPU part %.*s in /proc/cpuinfo is ignored due to lack of 0x prefix",
(int) cpu_part_length, cpu_part_start);
return;
}
/* Verify that characters after hex prefix are hexadecimal digits and decode them */
uint32_t cpu_part = 0;
for (const char* digit_ptr = cpu_part_start + 2; digit_ptr != cpu_part_end; digit_ptr++) {
const char digit_char = *digit_ptr;
uint32_t digit;
if (digit_char >= '0' && digit_char <= '9') {
digit = digit_char - '0';
} else if ((uint32_t) (digit_char - 'A') < 6) {
digit = 10 + (digit_char - 'A');
} else if ((uint32_t) (digit_char - 'a') < 6) {
digit = 10 + (digit_char - 'a');
} else {
cpuinfo_log_warning("CPU part %.*s in /proc/cpuinfo is ignored due to unexpected non-hex character %c at offset %zu",
(int) cpu_part_length, cpu_part_start, digit_char, (size_t) (digit_ptr - cpu_part_start));
return;
}
cpu_part = cpu_part * 16 + digit;
}
processor->midr = midr_set_part(processor->midr, cpu_part);
processor->flags |= CPUINFO_ARM_LINUX_VALID_PART | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
}
static void parse_cpu_implementer(
const char* cpu_implementer_start,
const char* cpu_implementer_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
const size_t cpu_implementer_length = cpu_implementer_end - cpu_implementer_start;
/*
* Value should contain hex prefix (0x) and one or two hex digits.
* I have never seen single hex digit as a value of this field,
* but I don't think it is impossible in future.
* Value can not contain more than two hex digits since
* Main ID Register (MIDR) assigns only an 8-bit value for CPU implementer.
*/
switch (cpu_implementer_length) {
case 3:
case 4:
break;
default:
cpuinfo_log_warning("CPU implementer %.*s in /proc/cpuinfo is ignored due to unexpected length (%zu)",
(int) cpu_implementer_length, cpu_implementer_start, cpu_implementer_length);
return;
}
/* Verify the presence of hex prefix */
if (cpu_implementer_start[0] != '0' || cpu_implementer_start[1] != 'x') {
cpuinfo_log_warning("CPU implementer %.*s in /proc/cpuinfo is ignored due to lack of 0x prefix",
(int) cpu_implementer_length, cpu_implementer_start);
return;
}
/* Verify that characters after hex prefix are hexadecimal digits and decode them */
uint32_t cpu_implementer = 0;
for (const char* digit_ptr = cpu_implementer_start + 2; digit_ptr != cpu_implementer_end; digit_ptr++) {
const char digit_char = *digit_ptr;
uint32_t digit;
if (digit_char >= '0' && digit_char <= '9') {
digit = digit_char - '0';
} else if ((uint32_t) (digit_char - 'A') < 6) {
digit = 10 + (digit_char - 'A');
} else if ((uint32_t) (digit_char - 'a') < 6) {
digit = 10 + (digit_char - 'a');
} else {
cpuinfo_log_warning("CPU implementer %.*s in /proc/cpuinfo is ignored due to unexpected non-hex character '%c' at offset %zu",
(int) cpu_implementer_length, cpu_implementer_start, digit_char, (size_t) (digit_ptr - cpu_implementer_start));
return;
}
cpu_implementer = cpu_implementer * 16 + digit;
}
processor->midr = midr_set_implementer(processor->midr, cpu_implementer);
processor->flags |= CPUINFO_ARM_LINUX_VALID_IMPLEMENTER | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
}
static void parse_cpu_variant(
const char* cpu_variant_start,
const char* cpu_variant_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
const size_t cpu_variant_length = cpu_variant_end - cpu_variant_start;
/*
* Value should contain hex prefix (0x) and one hex digit.
* Value can not contain more than one hex digits since
* Main ID Register (MIDR) assigns only a 4-bit value for CPU variant.
*/
if (cpu_variant_length != 3) {
cpuinfo_log_warning("CPU variant %.*s in /proc/cpuinfo is ignored due to unexpected length (%zu)",
(int) cpu_variant_length, cpu_variant_start, cpu_variant_length);
return;
}
/* Skip if there is no hex prefix (0x) */
if (cpu_variant_start[0] != '0' || cpu_variant_start[1] != 'x') {
cpuinfo_log_warning("CPU variant %.*s in /proc/cpuinfo is ignored due to lack of 0x prefix",
(int) cpu_variant_length, cpu_variant_start);
return;
}
/* Check if the value after hex prefix is indeed a hex digit and decode it. */
const char digit_char = cpu_variant_start[2];
uint32_t cpu_variant;
if ((uint32_t) (digit_char - '0') < 10) {
cpu_variant = (uint32_t) (digit_char - '0');
} else if ((uint32_t) (digit_char - 'A') < 6) {
cpu_variant = 10 + (uint32_t) (digit_char - 'A');
} else if ((uint32_t) (digit_char - 'a') < 6) {
cpu_variant = 10 + (uint32_t) (digit_char - 'a');
} else {
cpuinfo_log_warning("CPU variant %.*s in /proc/cpuinfo is ignored due to unexpected non-hex character '%c'",
(int) cpu_variant_length, cpu_variant_start, digit_char);
return;
}
processor->midr = midr_set_variant(processor->midr, cpu_variant);
processor->flags |= CPUINFO_ARM_LINUX_VALID_VARIANT | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
}
static void parse_cpu_revision(
const char* cpu_revision_start,
const char* cpu_revision_end,
struct cpuinfo_arm_linux_processor processor[restrict static 1])
{
uint32_t cpu_revision = 0;
for (const char* digit_ptr = cpu_revision_start; digit_ptr != cpu_revision_end; digit_ptr++) {
const uint32_t digit = (uint32_t) (*digit_ptr - '0');
/* Verify that the character in CPU revision is a decimal digit */
if (digit >= 10) {
cpuinfo_log_warning("CPU revision %.*s in /proc/cpuinfo is ignored due to unexpected non-digit character '%c' at offset %zu",
(int) (cpu_revision_end - cpu_revision_start), cpu_revision_start,
*digit_ptr, (size_t) (digit_ptr - cpu_revision_start));
return;
}
cpu_revision = cpu_revision * 10 + digit;
}
processor->midr = midr_set_revision(processor->midr, cpu_revision);
processor->flags |= CPUINFO_ARM_LINUX_VALID_REVISION | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
}
#if CPUINFO_ARCH_ARM
/*
* Decode one of the cache-related numbers reported by Linux kernel
* for pre-ARMv7 architecture.
* An example cache-related information in /proc/cpuinfo:
*
* I size : 32768
* I assoc : 4
* I line length : 32
* I sets : 256
* D size : 16384
* D assoc : 4
* D line length : 32
* D sets : 128
*
*/
static void parse_cache_number(
const char* number_start,
const char* number_end,
const char* number_name,
uint32_t number_ptr[restrict static 1],
uint32_t flags[restrict static 1],
uint32_t number_mask)
{
uint32_t number = 0;
for (const char* digit_ptr = number_start; digit_ptr != number_end; digit_ptr++) {
const uint32_t digit = *digit_ptr - '0';
if (digit >= 10) {
cpuinfo_log_warning("%s %.*s in /proc/cpuinfo is ignored due to unexpected non-digit character '%c' at offset %zu",
number_name, (int) (number_end - number_start), number_start,
*digit_ptr, (size_t) (digit_ptr - number_start));
return;
}
number = number * 10 + digit;
}
if (number == 0) {
cpuinfo_log_warning("%s %.*s in /proc/cpuinfo is ignored due to invalid value of zero reported by the kernel",
number_name, (int) (number_end - number_start), number_start);
}
/* If the number specifies a cache line size, verify that is a reasonable power of 2 */
if (number_mask & CPUINFO_ARM_LINUX_VALID_CACHE_LINE) {
switch (number) {
case 16:
case 32:
case 64:
case 128:
break;
default:
cpuinfo_log_warning("invalid %s %.*s is ignored: a value of 16, 32, 64, or 128 expected",
number_name, (int) (number_end - number_start), number_start);
}
}
*number_ptr = number;
*flags |= number_mask | CPUINFO_ARM_LINUX_VALID_PROCESSOR;
}
#endif /* CPUINFO_ARCH_ARM */
struct proc_cpuinfo_parser_state {
char* hardware;
char* revision;
uint32_t processor_index;
uint32_t max_processors_count;
struct cpuinfo_arm_linux_processor* processors;
struct cpuinfo_arm_linux_processor dummy_processor;
};
/*
* Decode a single line of /proc/cpuinfo information.
* Lines have format <words-with-spaces>[ ]*:[ ]<space-separated words>
* An example of /proc/cpuinfo (from Pandaboard-ES):
*
* Processor : ARMv7 Processor rev 10 (v7l)
* processor : 0
* BogoMIPS : 1392.74
*
* processor : 1
* BogoMIPS : 1363.33
*
* Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
* CPU implementer : 0x41
* CPU architecture: 7
* CPU variant : 0x2
* CPU part : 0xc09
* CPU revision : 10
*
* Hardware : OMAP4 Panda board
* Revision : 0020
* Serial : 0000000000000000
*/
static bool parse_line(
const char* line_start,
const char* line_end,
struct proc_cpuinfo_parser_state state[restrict static 1],
uint64_t line_number)
{
/* Empty line. Skip. */
if (line_start == line_end) {
return true;
}
/* Search for ':' on the line. */
const char* separator = line_start;
for (; separator != line_end; separator++) {
if (*separator == ':') {
break;
}
}
/* Skip line if no ':' separator was found. */
if (separator == line_end) {
cpuinfo_log_info("Line %.*s in /proc/cpuinfo is ignored: key/value separator ':' not found",
(int) (line_end - line_start), line_start);
return true;
}
/* Skip trailing spaces in key part. */
const char* key_end = separator;
for (; key_end != line_start; key_end--) {
if (key_end[-1] != ' ' && key_end[-1] != '\t') {
break;
}
}
/* Skip line if key contains nothing but spaces. */
if (key_end == line_start) {
cpuinfo_log_info("Line %.*s in /proc/cpuinfo is ignored: key contains only spaces",
(int) (line_end - line_start), line_start);
return true;
}
/* Skip leading spaces in value part. */
const char* value_start = separator + 1;
for (; value_start != line_end; value_start++) {
if (*value_start != ' ') {
break;
}
}
/* Value part contains nothing but spaces. Skip line. */
if (value_start == line_end) {
cpuinfo_log_info("Line %.*s in /proc/cpuinfo is ignored: value contains only spaces",
(int) (line_end - line_start), line_start);
return true;
}
/* Skip trailing spaces in value part (if any) */
const char* value_end = line_end;
for (; value_end != value_start; value_end--) {
if (value_end[-1] != ' ') {
break;
}
}
const uint32_t processor_index = state->processor_index;
const uint32_t max_processors_count = state->max_processors_count;
struct cpuinfo_arm_linux_processor* processors = state->processors;
struct cpuinfo_arm_linux_processor* processor = &state->dummy_processor;
if (processor_index < max_processors_count) {
processor = &processors[processor_index];
}
const size_t key_length = key_end - line_start;
switch (key_length) {
case 6:
if (memcmp(line_start, "Serial", key_length) == 0) {
/* Usually contains just zeros, useless */
#if CPUINFO_ARCH_ARM
} else if (memcmp(line_start, "I size", key_length) == 0) {
parse_cache_number(value_start, value_end,
"instruction cache size", &processor->proc_cpuinfo_cache.i_size,
&processor->flags, CPUINFO_ARM_LINUX_VALID_ICACHE_SIZE);
} else if (memcmp(line_start, "I sets", key_length) == 0) {
parse_cache_number(value_start, value_end,
"instruction cache sets", &processor->proc_cpuinfo_cache.i_sets,
&processor->flags, CPUINFO_ARM_LINUX_VALID_ICACHE_SETS);
} else if (memcmp(line_start, "D size", key_length) == 0) {
parse_cache_number(value_start, value_end,
"data cache size", &processor->proc_cpuinfo_cache.d_size,
&processor->flags, CPUINFO_ARM_LINUX_VALID_DCACHE_SIZE);
} else if (memcmp(line_start, "D sets", key_length) == 0) {
parse_cache_number(value_start, value_end,
"data cache sets", &processor->proc_cpuinfo_cache.d_sets,
&processor->flags, CPUINFO_ARM_LINUX_VALID_DCACHE_SETS);
#endif /* CPUINFO_ARCH_ARM */
} else {
goto unknown;
}
break;
#if CPUINFO_ARCH_ARM
case 7:
if (memcmp(line_start, "I assoc", key_length) == 0) {
parse_cache_number(value_start, value_end,
"instruction cache associativity", &processor->proc_cpuinfo_cache.i_assoc,
&processor->flags, CPUINFO_ARM_LINUX_VALID_ICACHE_WAYS);
} else if (memcmp(line_start, "D assoc", key_length) == 0) {
parse_cache_number(value_start, value_end,
"data cache associativity", &processor->proc_cpuinfo_cache.d_assoc,
&processor->flags, CPUINFO_ARM_LINUX_VALID_DCACHE_WAYS);
} else {
goto unknown;
}
break;
#endif /* CPUINFO_ARCH_ARM */
case 8:
if (memcmp(line_start, "CPU part", key_length) == 0) {
parse_cpu_part(value_start, value_end, processor);
} else if (memcmp(line_start, "Features", key_length) == 0) {
parse_features(value_start, value_end, processor);
} else if (memcmp(line_start, "BogoMIPS", key_length) == 0) {
/* BogoMIPS is useless, don't parse */
} else if (memcmp(line_start, "Hardware", key_length) == 0) {
size_t value_length = value_end - value_start;
if (value_length > CPUINFO_HARDWARE_VALUE_MAX) {
cpuinfo_log_info(
"length of Hardware value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit",
(int) value_length, value_start, CPUINFO_HARDWARE_VALUE_MAX);
value_length = CPUINFO_HARDWARE_VALUE_MAX;
} else {
state->hardware[value_length] = '\0';
}
memcpy(state->hardware, value_start, value_length);
cpuinfo_log_debug("parsed /proc/cpuinfo Hardware = \"%.*s\"", (int) value_length, value_start);
} else if (memcmp(line_start, "Revision", key_length) == 0) {
size_t value_length = value_end - value_start;
if (value_length > CPUINFO_REVISION_VALUE_MAX) {
cpuinfo_log_info(
"length of Revision value \"%.*s\" in /proc/cpuinfo exceeds limit (%d): truncating to the limit",
(int) value_length, value_start, CPUINFO_REVISION_VALUE_MAX);
value_length = CPUINFO_REVISION_VALUE_MAX;
} else {
state->revision[value_length] = '\0';
}
memcpy(state->revision, value_start, value_length);
cpuinfo_log_debug("parsed /proc/cpuinfo Revision = \"%.*s\"", (int) value_length, value_start);
} else {
goto unknown;
}
break;
case 9:
if (memcmp(line_start, "processor", key_length) == 0) {
const uint32_t new_processor_index = parse_processor_number(value_start, value_end);
if (new_processor_index < processor_index) {
/* Strange: decreasing processor number */
cpuinfo_log_warning(
"unexpectedly low processor number %"PRIu32" following processor %"PRIu32" in /proc/cpuinfo",
new_processor_index, processor_index);
} else if (new_processor_index > processor_index + 1) {
/* Strange, but common: skipped processor $(processor_index + 1) */
cpuinfo_log_info(
"unexpectedly high processor number %"PRIu32" following processor %"PRIu32" in /proc/cpuinfo",
new_processor_index, processor_index);
}
if (new_processor_index < max_processors_count) {
/* Record that the processor was mentioned in /proc/cpuinfo */
processors[new_processor_index].flags |= CPUINFO_ARM_LINUX_VALID_PROCESSOR;
} else {
/* Log and ignore processor */
cpuinfo_log_warning("processor %"PRIu32" in /proc/cpuinfo is ignored: index exceeds system limit %"PRIu32,
new_processor_index, max_processors_count - 1);
}
state->processor_index = new_processor_index;
return true;
} else if (memcmp(line_start, "Processor", key_length) == 0) {
/* TODO: parse to fix misreported architecture, similar to Android's cpufeatures */
} else {
goto unknown;
}
break;
case 11:
if (memcmp(line_start, "CPU variant", key_length) == 0) {
parse_cpu_variant(value_start, value_end, processor);
} else {
goto unknown;
}
break;
case 12:
if (memcmp(line_start, "CPU revision", key_length) == 0) {
parse_cpu_revision(value_start, value_end, processor);
} else {
goto unknown;
}
break;
#if CPUINFO_ARCH_ARM
case 13:
if (memcmp(line_start, "I line length", key_length) == 0) {
parse_cache_number(value_start, value_end,
"instruction cache line size", &processor->proc_cpuinfo_cache.i_line_length,
&processor->flags, CPUINFO_ARM_LINUX_VALID_ICACHE_LINE);
} else if (memcmp(line_start, "D line length", key_length) == 0) {
parse_cache_number(value_start, value_end,
"data cache line size", &processor->proc_cpuinfo_cache.d_line_length,
&processor->flags, CPUINFO_ARM_LINUX_VALID_DCACHE_LINE);
} else {
goto unknown;
}
break;
#endif /* CPUINFO_ARCH_ARM */
case 15:
if (memcmp(line_start, "CPU implementer", key_length) == 0) {
parse_cpu_implementer(value_start, value_end, processor);
} else if (memcmp(line_start, "CPU implementor", key_length) == 0) {
parse_cpu_implementer(value_start, value_end, processor);
} else {
goto unknown;
}
break;
case 16:
if (memcmp(line_start, "CPU architecture", key_length) == 0) {
parse_cpu_architecture(value_start, value_end, processor);
} else {
goto unknown;
}
break;
default:
unknown:
cpuinfo_log_debug("unknown /proc/cpuinfo key: %.*s", (int) key_length, line_start);
}
return true;
}
bool cpuinfo_arm_linux_parse_proc_cpuinfo(
char hardware[restrict static CPUINFO_HARDWARE_VALUE_MAX],
char revision[restrict static CPUINFO_REVISION_VALUE_MAX],
uint32_t max_processors_count,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors_count])
{
struct proc_cpuinfo_parser_state state = {
.hardware = hardware,
.revision = revision,
.processor_index = 0,
.max_processors_count = max_processors_count,
.processors = processors,
};
return cpuinfo_linux_parse_multiline_file("/proc/cpuinfo", BUFFER_SIZE,
(cpuinfo_line_callback) parse_line, &state);
}

159
3rdparty/cpuinfo/src/arm/linux/hwcap.c vendored Normal file
View File

@@ -0,0 +1,159 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <dlfcn.h>
#include <elf.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
#endif
#include <cpuinfo.h>
#include <arm/linux/api.h>
#include <cpuinfo/log.h>
#if CPUINFO_ARCH_ARM64 || CPUINFO_ARCH_ARM && !defined(__ANDROID__)
#include <sys/auxv.h>
#else
#define AT_HWCAP 16
#define AT_HWCAP2 26
#endif
#if CPUINFO_MOCK
static uint32_t mock_hwcap = 0;
void cpuinfo_set_hwcap(uint32_t hwcap) {
mock_hwcap = hwcap;
}
static uint32_t mock_hwcap2 = 0;
void cpuinfo_set_hwcap2(uint32_t hwcap2) {
mock_hwcap2 = hwcap2;
}
#endif
#if CPUINFO_ARCH_ARM
typedef unsigned long (*getauxval_function_t)(unsigned long);
bool cpuinfo_arm_linux_hwcap_from_getauxval(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1])
{
#if CPUINFO_MOCK
*hwcap = mock_hwcap;
*hwcap2 = mock_hwcap2;
return true;
#elif defined(__ANDROID__)
/* Android: dynamically check if getauxval is supported */
void* libc = NULL;
getauxval_function_t getauxval = NULL;
dlerror();
libc = dlopen("libc.so", RTLD_LAZY);
if (libc == NULL) {
cpuinfo_log_warning("failed to load libc.so: %s", dlerror());
goto cleanup;
}
getauxval = (getauxval_function_t) dlsym(libc, "getauxval");
if (getauxval == NULL) {
cpuinfo_log_info("failed to locate getauxval in libc.so: %s", dlerror());
goto cleanup;
}
*hwcap = getauxval(AT_HWCAP);
*hwcap2 = getauxval(AT_HWCAP2);
cleanup:
if (libc != NULL) {
dlclose(libc);
libc = NULL;
}
return getauxval != NULL;
#else
/* GNU/Linux: getauxval is always supported */
*hwcap = getauxval(AT_HWCAP);
*hwcap2 = getauxval(AT_HWCAP2);
return true;
#endif
}
#ifdef __ANDROID__
bool cpuinfo_arm_linux_hwcap_from_procfs(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1])
{
#if CPUINFO_MOCK
*hwcap = mock_hwcap;
*hwcap2 = mock_hwcap2;
return true;
#else
uint32_t hwcaps[2] = { 0, 0 };
bool result = false;
int file = -1;
file = open("/proc/self/auxv", O_RDONLY);
if (file == -1) {
cpuinfo_log_warning("failed to open /proc/self/auxv: %s", strerror(errno));
goto cleanup;
}
ssize_t bytes_read;
do {
Elf32_auxv_t elf_auxv;
bytes_read = read(file, &elf_auxv, sizeof(Elf32_auxv_t));
if (bytes_read < 0) {
cpuinfo_log_warning("failed to read /proc/self/auxv: %s", strerror(errno));
goto cleanup;
} else if (bytes_read > 0) {
if (bytes_read == sizeof(elf_auxv)) {
switch (elf_auxv.a_type) {
case AT_HWCAP:
hwcaps[0] = (uint32_t) elf_auxv.a_un.a_val;
break;
case AT_HWCAP2:
hwcaps[1] = (uint32_t) elf_auxv.a_un.a_val;
break;
}
} else {
cpuinfo_log_warning(
"failed to read %zu bytes from /proc/self/auxv: %zu bytes available",
sizeof(elf_auxv), (size_t) bytes_read);
goto cleanup;
}
}
} while (bytes_read == sizeof(Elf32_auxv_t));
/* Success, commit results */
*hwcap = hwcaps[0];
*hwcap2 = hwcaps[1];
result = true;
cleanup:
if (file != -1) {
close(file);
file = -1;
}
return result;
#endif
}
#endif /* __ANDROID__ */
#elif CPUINFO_ARCH_ARM64
void cpuinfo_arm_linux_hwcap_from_getauxval(
uint32_t hwcap[restrict static 1],
uint32_t hwcap2[restrict static 1])
{
#if CPUINFO_MOCK
*hwcap = mock_hwcap;
*hwcap2 = mock_hwcap2;
#else
*hwcap = (uint32_t) getauxval(AT_HWCAP);
*hwcap2 = (uint32_t) getauxval(AT_HWCAP2);
return ;
#endif
}
#endif

765
3rdparty/cpuinfo/src/arm/linux/init.c vendored Normal file
View File

@@ -0,0 +1,765 @@
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <cpuinfo.h>
#include <arm/linux/api.h>
#if defined(__ANDROID__)
#include <arm/android/api.h>
#endif
#include <arm/api.h>
#include <arm/midr.h>
#include <linux/api.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
struct cpuinfo_arm_isa cpuinfo_isa = { 0 };
static struct cpuinfo_package package = { { 0 } };
static inline bool bitmask_all(uint32_t bitfield, uint32_t mask) {
return (bitfield & mask) == mask;
}
static inline uint32_t min(uint32_t a, uint32_t b) {
return a < b ? a : b;
}
static inline int cmp(uint32_t a, uint32_t b) {
return (a > b) - (a < b);
}
static bool cluster_siblings_parser(
uint32_t processor, uint32_t siblings_start, uint32_t siblings_end,
struct cpuinfo_arm_linux_processor* processors)
{
processors[processor].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
uint32_t package_leader_id = processors[processor].package_leader_id;
for (uint32_t sibling = siblings_start; sibling < siblings_end; sibling++) {
if (!bitmask_all(processors[sibling].flags, CPUINFO_LINUX_FLAG_VALID)) {
cpuinfo_log_info("invalid processor %"PRIu32" reported as a sibling for processor %"PRIu32,
sibling, processor);
continue;
}
const uint32_t sibling_package_leader_id = processors[sibling].package_leader_id;
if (sibling_package_leader_id < package_leader_id) {
package_leader_id = sibling_package_leader_id;
}
processors[sibling].package_leader_id = package_leader_id;
processors[sibling].flags |= CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER;
}
processors[processor].package_leader_id = package_leader_id;
return true;
}
static int cmp_arm_linux_processor(const void* ptr_a, const void* ptr_b) {
const struct cpuinfo_arm_linux_processor* processor_a = (const struct cpuinfo_arm_linux_processor*) ptr_a;
const struct cpuinfo_arm_linux_processor* processor_b = (const struct cpuinfo_arm_linux_processor*) ptr_b;
/* Move usable processors towards the start of the array */
const bool usable_a = bitmask_all(processor_a->flags, CPUINFO_LINUX_FLAG_VALID);
const bool usable_b = bitmask_all(processor_b->flags, CPUINFO_LINUX_FLAG_VALID);
if (usable_a != usable_b) {
return (int) usable_b - (int) usable_a;
}
/* Compare based on core type (e.g. Cortex-A57 < Cortex-A53) */
const uint32_t midr_a = processor_a->midr;
const uint32_t midr_b = processor_b->midr;
if (midr_a != midr_b) {
const uint32_t score_a = midr_score_core(midr_a);
const uint32_t score_b = midr_score_core(midr_b);
if (score_a != score_b) {
return score_a > score_b ? -1 : 1;
}
}
/* Compare based on core frequency (e.g. 2.0 GHz < 1.2 GHz) */
const uint32_t frequency_a = processor_a->max_frequency;
const uint32_t frequency_b = processor_b->max_frequency;
if (frequency_a != frequency_b) {
return frequency_a > frequency_b ? -1 : 1;
}
/* Compare based on cluster leader id (i.e. cluster 1 < cluster 0) */
const uint32_t cluster_a = processor_a->package_leader_id;
const uint32_t cluster_b = processor_b->package_leader_id;
if (cluster_a != cluster_b) {
return cluster_a > cluster_b ? -1 : 1;
}
/* Compare based on system processor id (i.e. processor 0 < processor 1) */
const uint32_t id_a = processor_a->system_processor_id;
const uint32_t id_b = processor_b->system_processor_id;
return cmp(id_a, id_b);
}
void cpuinfo_arm_linux_init(void) {
struct cpuinfo_arm_linux_processor* arm_linux_processors = NULL;
struct cpuinfo_processor* processors = NULL;
struct cpuinfo_core* cores = NULL;
struct cpuinfo_cluster* clusters = NULL;
struct cpuinfo_uarch_info* uarchs = NULL;
struct cpuinfo_cache* l1i = NULL;
struct cpuinfo_cache* l1d = NULL;
struct cpuinfo_cache* l2 = NULL;
struct cpuinfo_cache* l3 = NULL;
const struct cpuinfo_processor** linux_cpu_to_processor_map = NULL;
const struct cpuinfo_core** linux_cpu_to_core_map = NULL;
uint32_t* linux_cpu_to_uarch_index_map = NULL;
const uint32_t max_processors_count = cpuinfo_linux_get_max_processors_count();
cpuinfo_log_debug("system maximum processors count: %"PRIu32, max_processors_count);
const uint32_t max_possible_processors_count = 1 +
cpuinfo_linux_get_max_possible_processor(max_processors_count);
cpuinfo_log_debug("maximum possible processors count: %"PRIu32, max_possible_processors_count);
const uint32_t max_present_processors_count = 1 +
cpuinfo_linux_get_max_present_processor(max_processors_count);
cpuinfo_log_debug("maximum present processors count: %"PRIu32, max_present_processors_count);
uint32_t valid_processor_mask = 0;
uint32_t arm_linux_processors_count = max_processors_count;
if (max_present_processors_count != 0) {
arm_linux_processors_count = min(arm_linux_processors_count, max_present_processors_count);
valid_processor_mask = CPUINFO_LINUX_FLAG_PRESENT;
}
if (max_possible_processors_count != 0) {
arm_linux_processors_count = min(arm_linux_processors_count, max_possible_processors_count);
valid_processor_mask |= CPUINFO_LINUX_FLAG_POSSIBLE;
}
if ((max_present_processors_count | max_possible_processors_count) == 0) {
cpuinfo_log_error("failed to parse both lists of possible and present processors");
return;
}
arm_linux_processors = calloc(arm_linux_processors_count, sizeof(struct cpuinfo_arm_linux_processor));
if (arm_linux_processors == NULL) {
cpuinfo_log_error(
"failed to allocate %zu bytes for descriptions of %"PRIu32" ARM logical processors",
arm_linux_processors_count * sizeof(struct cpuinfo_arm_linux_processor),
arm_linux_processors_count);
return;
}
if (max_possible_processors_count) {
cpuinfo_linux_detect_possible_processors(
arm_linux_processors_count, &arm_linux_processors->flags,
sizeof(struct cpuinfo_arm_linux_processor),
CPUINFO_LINUX_FLAG_POSSIBLE);
}
if (max_present_processors_count) {
cpuinfo_linux_detect_present_processors(
arm_linux_processors_count, &arm_linux_processors->flags,
sizeof(struct cpuinfo_arm_linux_processor),
CPUINFO_LINUX_FLAG_PRESENT);
}
#if defined(__ANDROID__)
struct cpuinfo_android_properties android_properties;
cpuinfo_arm_android_parse_properties(&android_properties);
#else
char proc_cpuinfo_hardware[CPUINFO_HARDWARE_VALUE_MAX];
#endif
char proc_cpuinfo_revision[CPUINFO_REVISION_VALUE_MAX];
if (!cpuinfo_arm_linux_parse_proc_cpuinfo(
#if defined(__ANDROID__)
android_properties.proc_cpuinfo_hardware,
#else
proc_cpuinfo_hardware,
#endif
proc_cpuinfo_revision,
arm_linux_processors_count,
arm_linux_processors)) {
cpuinfo_log_error("failed to parse processor information from /proc/cpuinfo");
return;
}
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, valid_processor_mask)) {
arm_linux_processors[i].flags |= CPUINFO_LINUX_FLAG_VALID;
cpuinfo_log_debug("parsed processor %"PRIu32" MIDR 0x%08"PRIx32,
i, arm_linux_processors[i].midr);
}
}
uint32_t valid_processors = 0, last_midr = 0;
#if CPUINFO_ARCH_ARM
uint32_t last_architecture_version = 0, last_architecture_flags = 0;
#endif
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
arm_linux_processors[i].system_processor_id = i;
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
valid_processors += 1;
if (!(arm_linux_processors[i].flags & CPUINFO_ARM_LINUX_VALID_PROCESSOR)) {
/*
* Processor is in possible and present lists, but not reported in /proc/cpuinfo.
* This is fairly common: high-index processors can be not reported if they are offline.
*/
cpuinfo_log_info("processor %"PRIu32" is not listed in /proc/cpuinfo", i);
}
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_ARM_LINUX_VALID_MIDR)) {
last_midr = arm_linux_processors[i].midr;
}
#if CPUINFO_ARCH_ARM
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_ARM_LINUX_VALID_ARCHITECTURE)) {
last_architecture_version = arm_linux_processors[i].architecture_version;
last_architecture_flags = arm_linux_processors[i].architecture_flags;
}
#endif
} else {
/* Processor reported in /proc/cpuinfo, but not in possible and/or present lists: log and ignore */
if (!(arm_linux_processors[i].flags & CPUINFO_ARM_LINUX_VALID_PROCESSOR)) {
cpuinfo_log_warning("invalid processor %"PRIu32" reported in /proc/cpuinfo", i);
}
}
}
#if defined(__ANDROID__)
const struct cpuinfo_arm_chipset chipset =
cpuinfo_arm_android_decode_chipset(&android_properties, valid_processors, 0);
#else
const struct cpuinfo_arm_chipset chipset =
cpuinfo_arm_linux_decode_chipset(proc_cpuinfo_hardware, proc_cpuinfo_revision, valid_processors, 0);
#endif
#if CPUINFO_ARCH_ARM
uint32_t isa_features = 0, isa_features2 = 0;
#ifdef __ANDROID__
/*
* On Android before API 20, libc.so does not provide getauxval function.
* Thus, we try to dynamically find it, or use two fallback mechanisms:
* 1. dlopen libc.so, and try to find getauxval
* 2. Parse /proc/self/auxv procfs file
* 3. Use features reported in /proc/cpuinfo
*/
if (!cpuinfo_arm_linux_hwcap_from_getauxval(&isa_features, &isa_features2)) {
/* getauxval can't be used, fall back to parsing /proc/self/auxv */
if (!cpuinfo_arm_linux_hwcap_from_procfs(&isa_features, &isa_features2)) {
/*
* Reading /proc/self/auxv failed, probably due to file permissions.
* Use information from /proc/cpuinfo to detect ISA.
*
* If different processors report different ISA features, take the intersection.
*/
uint32_t processors_with_features = 0;
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID | CPUINFO_ARM_LINUX_VALID_FEATURES)) {
if (processors_with_features == 0) {
isa_features = arm_linux_processors[i].features;
isa_features2 = arm_linux_processors[i].features2;
} else {
isa_features &= arm_linux_processors[i].features;
isa_features2 &= arm_linux_processors[i].features2;
}
processors_with_features += 1;
}
}
}
}
#else
/* On GNU/Linux getauxval is always available */
cpuinfo_arm_linux_hwcap_from_getauxval(&isa_features, &isa_features2);
#endif
cpuinfo_arm_linux_decode_isa_from_proc_cpuinfo(
isa_features, isa_features2,
last_midr, last_architecture_version, last_architecture_flags,
&chipset, &cpuinfo_isa);
#elif CPUINFO_ARCH_ARM64
uint32_t isa_features = 0, isa_features2 = 0;
/* getauxval is always available on ARM64 Android */
cpuinfo_arm_linux_hwcap_from_getauxval(&isa_features, &isa_features2);
cpuinfo_arm64_linux_decode_isa_from_proc_cpuinfo(
isa_features, isa_features2, last_midr, &chipset, &cpuinfo_isa);
#endif
/* Detect min/max frequency and package ID */
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
const uint32_t max_frequency = cpuinfo_linux_get_processor_max_frequency(i);
if (max_frequency != 0) {
arm_linux_processors[i].max_frequency = max_frequency;
arm_linux_processors[i].flags |= CPUINFO_LINUX_FLAG_MAX_FREQUENCY;
}
const uint32_t min_frequency = cpuinfo_linux_get_processor_min_frequency(i);
if (min_frequency != 0) {
arm_linux_processors[i].min_frequency = min_frequency;
arm_linux_processors[i].flags |= CPUINFO_LINUX_FLAG_MIN_FREQUENCY;
}
if (cpuinfo_linux_get_processor_package_id(i, &arm_linux_processors[i].package_id)) {
arm_linux_processors[i].flags |= CPUINFO_LINUX_FLAG_PACKAGE_ID;
}
}
}
/* Initialize topology group IDs */
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
arm_linux_processors[i].package_leader_id = i;
}
/* Propagate topology group IDs among siblings */
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (!bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
continue;
}
if (arm_linux_processors[i].flags & CPUINFO_LINUX_FLAG_PACKAGE_ID) {
cpuinfo_linux_detect_core_siblings(
arm_linux_processors_count, i,
(cpuinfo_siblings_callback) cluster_siblings_parser,
arm_linux_processors);
}
}
/* Propagate all cluster IDs */
uint32_t clustered_processors = 0;
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID | CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER)) {
clustered_processors += 1;
const uint32_t package_leader_id = arm_linux_processors[i].package_leader_id;
if (package_leader_id < i) {
arm_linux_processors[i].package_leader_id = arm_linux_processors[package_leader_id].package_leader_id;
}
cpuinfo_log_debug("processor %"PRIu32" clustered with processor %"PRIu32" as inferred from system siblings lists",
i, arm_linux_processors[i].package_leader_id);
}
}
if (clustered_processors != valid_processors) {
/*
* Topology information about some or all logical processors may be unavailable, for the following reasons:
* - Linux kernel is too old, or configured without support for topology information in sysfs.
* - Core is offline, and Linux kernel is configured to not report topology for offline cores.
*
* In this case, we assign processors to clusters using two methods:
* - Try heuristic cluster configurations (e.g. 6-core SoC usually has 4+2 big.LITTLE configuration).
* - If heuristic failed, assign processors to core clusters in a sequential scan.
*/
if (!cpuinfo_arm_linux_detect_core_clusters_by_heuristic(valid_processors, arm_linux_processors_count, arm_linux_processors)) {
cpuinfo_arm_linux_detect_core_clusters_by_sequential_scan(arm_linux_processors_count, arm_linux_processors);
}
}
cpuinfo_arm_linux_count_cluster_processors(arm_linux_processors_count, arm_linux_processors);
const uint32_t cluster_count = cpuinfo_arm_linux_detect_cluster_midr(
&chipset,
arm_linux_processors_count, valid_processors, arm_linux_processors);
/* Initialize core vendor, uarch, MIDR, and frequency for every logical processor */
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
const uint32_t cluster_leader = arm_linux_processors[i].package_leader_id;
if (cluster_leader == i) {
/* Cluster leader: decode core vendor and uarch */
cpuinfo_arm_decode_vendor_uarch(
arm_linux_processors[cluster_leader].midr,
#if CPUINFO_ARCH_ARM
!!(arm_linux_processors[cluster_leader].features & CPUINFO_ARM_LINUX_FEATURE_VFPV4),
#endif
&arm_linux_processors[cluster_leader].vendor,
&arm_linux_processors[cluster_leader].uarch);
} else {
/* Cluster non-leader: copy vendor, uarch, MIDR, and frequency from cluster leader */
arm_linux_processors[i].flags |= arm_linux_processors[cluster_leader].flags &
(CPUINFO_ARM_LINUX_VALID_MIDR | CPUINFO_LINUX_FLAG_MAX_FREQUENCY);
arm_linux_processors[i].midr = arm_linux_processors[cluster_leader].midr;
arm_linux_processors[i].vendor = arm_linux_processors[cluster_leader].vendor;
arm_linux_processors[i].uarch = arm_linux_processors[cluster_leader].uarch;
arm_linux_processors[i].max_frequency = arm_linux_processors[cluster_leader].max_frequency;
}
}
}
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
cpuinfo_log_debug("post-analysis processor %"PRIu32": MIDR %08"PRIx32" frequency %"PRIu32,
i, arm_linux_processors[i].midr, arm_linux_processors[i].max_frequency);
}
}
qsort(arm_linux_processors, arm_linux_processors_count,
sizeof(struct cpuinfo_arm_linux_processor), cmp_arm_linux_processor);
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
cpuinfo_log_debug("post-sort processor %"PRIu32": system id %"PRIu32" MIDR %08"PRIx32" frequency %"PRIu32,
i, arm_linux_processors[i].system_processor_id, arm_linux_processors[i].midr, arm_linux_processors[i].max_frequency);
}
}
uint32_t uarchs_count = 0;
enum cpuinfo_uarch last_uarch;
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (uarchs_count == 0 || arm_linux_processors[i].uarch != last_uarch) {
last_uarch = arm_linux_processors[i].uarch;
uarchs_count += 1;
}
arm_linux_processors[i].uarch_index = uarchs_count - 1;
}
}
/*
* Assumptions:
* - No SMP (i.e. each core supports only one hardware thread).
* - Level 1 instruction and data caches are private to the core clusters.
* - Level 2 and level 3 cache is shared between cores in the same cluster.
*/
cpuinfo_arm_chipset_to_string(&chipset, package.name);
package.processor_count = valid_processors;
package.core_count = valid_processors;
package.cluster_count = cluster_count;
processors = calloc(valid_processors, sizeof(struct cpuinfo_processor));
if (processors == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" logical processors",
valid_processors * sizeof(struct cpuinfo_processor), valid_processors);
goto cleanup;
}
cores = calloc(valid_processors, sizeof(struct cpuinfo_core));
if (cores == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" cores",
valid_processors * sizeof(struct cpuinfo_core), valid_processors);
goto cleanup;
}
clusters = calloc(cluster_count, sizeof(struct cpuinfo_cluster));
if (clusters == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" core clusters",
cluster_count * sizeof(struct cpuinfo_cluster), cluster_count);
goto cleanup;
}
uarchs = calloc(uarchs_count, sizeof(struct cpuinfo_uarch_info));
if (uarchs == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" microarchitectures",
uarchs_count * sizeof(struct cpuinfo_uarch_info), uarchs_count);
goto cleanup;
}
linux_cpu_to_processor_map = calloc(arm_linux_processors_count, sizeof(struct cpuinfo_processor*));
if (linux_cpu_to_processor_map == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" logical processor mapping entries",
arm_linux_processors_count * sizeof(struct cpuinfo_processor*), arm_linux_processors_count);
goto cleanup;
}
linux_cpu_to_core_map = calloc(arm_linux_processors_count, sizeof(struct cpuinfo_core*));
if (linux_cpu_to_core_map == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" core mapping entries",
arm_linux_processors_count * sizeof(struct cpuinfo_core*), arm_linux_processors_count);
goto cleanup;
}
if (uarchs_count > 1) {
linux_cpu_to_uarch_index_map = calloc(arm_linux_processors_count, sizeof(uint32_t));
if (linux_cpu_to_uarch_index_map == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for %"PRIu32" uarch index mapping entries",
arm_linux_processors_count * sizeof(uint32_t), arm_linux_processors_count);
goto cleanup;
}
}
l1i = calloc(valid_processors, sizeof(struct cpuinfo_cache));
if (l1i == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1I caches",
valid_processors * sizeof(struct cpuinfo_cache), valid_processors);
goto cleanup;
}
l1d = calloc(valid_processors, sizeof(struct cpuinfo_cache));
if (l1d == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1D caches",
valid_processors * sizeof(struct cpuinfo_cache), valid_processors);
goto cleanup;
}
uint32_t uarchs_index = 0;
for (uint32_t i = 0; i < arm_linux_processors_count; i++) {
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (uarchs_index == 0 || arm_linux_processors[i].uarch != last_uarch) {
last_uarch = arm_linux_processors[i].uarch;
uarchs[uarchs_index] = (struct cpuinfo_uarch_info) {
.uarch = arm_linux_processors[i].uarch,
.midr = arm_linux_processors[i].midr,
};
uarchs_index += 1;
}
uarchs[uarchs_index - 1].processor_count += 1;
uarchs[uarchs_index - 1].core_count += 1;
}
}
uint32_t l2_count = 0, l3_count = 0, big_l3_size = 0, cluster_id = UINT32_MAX;
/* Indication whether L3 (if it exists) is shared between all cores */
bool shared_l3 = true;
/* Populate cache infromation structures in l1i, l1d */
for (uint32_t i = 0; i < valid_processors; i++) {
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
cluster_id += 1;
clusters[cluster_id] = (struct cpuinfo_cluster) {
.processor_start = i,
.processor_count = arm_linux_processors[i].package_processor_count,
.core_start = i,
.core_count = arm_linux_processors[i].package_processor_count,
.cluster_id = cluster_id,
.package = &package,
.vendor = arm_linux_processors[i].vendor,
.uarch = arm_linux_processors[i].uarch,
.midr = arm_linux_processors[i].midr,
};
}
processors[i].smt_id = 0;
processors[i].core = cores + i;
processors[i].cluster = clusters + cluster_id;
processors[i].package = &package;
processors[i].linux_id = (int) arm_linux_processors[i].system_processor_id;
processors[i].cache.l1i = l1i + i;
processors[i].cache.l1d = l1d + i;
linux_cpu_to_processor_map[arm_linux_processors[i].system_processor_id] = &processors[i];
cores[i].processor_start = i;
cores[i].processor_count = 1;
cores[i].core_id = i;
cores[i].cluster = clusters + cluster_id;
cores[i].package = &package;
cores[i].vendor = arm_linux_processors[i].vendor;
cores[i].uarch = arm_linux_processors[i].uarch;
cores[i].midr = arm_linux_processors[i].midr;
linux_cpu_to_core_map[arm_linux_processors[i].system_processor_id] = &cores[i];
if (linux_cpu_to_uarch_index_map != NULL) {
linux_cpu_to_uarch_index_map[arm_linux_processors[i].system_processor_id] =
arm_linux_processors[i].uarch_index;
}
struct cpuinfo_cache temp_l2 = { 0 }, temp_l3 = { 0 };
cpuinfo_arm_decode_cache(
arm_linux_processors[i].uarch,
arm_linux_processors[i].package_processor_count,
arm_linux_processors[i].midr,
&chipset,
cluster_id,
arm_linux_processors[i].architecture_version,
&l1i[i], &l1d[i], &temp_l2, &temp_l3);
l1i[i].processor_start = l1d[i].processor_start = i;
l1i[i].processor_count = l1d[i].processor_count = 1;
#if CPUINFO_ARCH_ARM
/* L1I reported in /proc/cpuinfo overrides defaults */
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_ARM_LINUX_VALID_ICACHE)) {
l1i[i] = (struct cpuinfo_cache) {
.size = arm_linux_processors[i].proc_cpuinfo_cache.i_size,
.associativity = arm_linux_processors[i].proc_cpuinfo_cache.i_assoc,
.sets = arm_linux_processors[i].proc_cpuinfo_cache.i_sets,
.partitions = 1,
.line_size = arm_linux_processors[i].proc_cpuinfo_cache.i_line_length
};
}
/* L1D reported in /proc/cpuinfo overrides defaults */
if (bitmask_all(arm_linux_processors[i].flags, CPUINFO_ARM_LINUX_VALID_DCACHE)) {
l1d[i] = (struct cpuinfo_cache) {
.size = arm_linux_processors[i].proc_cpuinfo_cache.d_size,
.associativity = arm_linux_processors[i].proc_cpuinfo_cache.d_assoc,
.sets = arm_linux_processors[i].proc_cpuinfo_cache.d_sets,
.partitions = 1,
.line_size = arm_linux_processors[i].proc_cpuinfo_cache.d_line_length
};
}
#endif
if (temp_l3.size != 0) {
/*
* Assumptions:
* - L2 is private to each core
* - L3 is shared by cores in the same cluster
* - If cores in different clusters report the same L3, it is shared between all cores.
*/
l2_count += 1;
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
if (cluster_id == 0) {
big_l3_size = temp_l3.size;
l3_count = 1;
} else if (temp_l3.size != big_l3_size) {
/* If some cores have different L3 size, L3 is not shared between all cores */
shared_l3 = false;
l3_count += 1;
}
}
} else {
/* If some cores don't have L3 cache, L3 is not shared between all cores */
shared_l3 = false;
if (temp_l2.size != 0) {
/* Assume L2 is shared by cores in the same cluster */
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
l2_count += 1;
}
}
}
}
if (l2_count != 0) {
l2 = calloc(l2_count, sizeof(struct cpuinfo_cache));
if (l2 == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L2 caches",
l2_count * sizeof(struct cpuinfo_cache), l2_count);
goto cleanup;
}
if (l3_count != 0) {
l3 = calloc(l3_count, sizeof(struct cpuinfo_cache));
if (l3 == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L3 caches",
l3_count * sizeof(struct cpuinfo_cache), l3_count);
goto cleanup;
}
}
}
cluster_id = UINT32_MAX;
uint32_t l2_index = UINT32_MAX, l3_index = UINT32_MAX;
for (uint32_t i = 0; i < valid_processors; i++) {
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
cluster_id++;
}
struct cpuinfo_cache dummy_l1i, dummy_l1d, temp_l2 = { 0 }, temp_l3 = { 0 };
cpuinfo_arm_decode_cache(
arm_linux_processors[i].uarch,
arm_linux_processors[i].package_processor_count,
arm_linux_processors[i].midr,
&chipset,
cluster_id,
arm_linux_processors[i].architecture_version,
&dummy_l1i, &dummy_l1d, &temp_l2, &temp_l3);
if (temp_l3.size != 0) {
/*
* Assumptions:
* - L2 is private to each core
* - L3 is shared by cores in the same cluster
* - If cores in different clusters report the same L3, it is shared between all cores.
*/
l2_index += 1;
l2[l2_index] = (struct cpuinfo_cache) {
.size = temp_l2.size,
.associativity = temp_l2.associativity,
.sets = temp_l2.sets,
.partitions = 1,
.line_size = temp_l2.line_size,
.flags = temp_l2.flags,
.processor_start = i,
.processor_count = 1,
};
processors[i].cache.l2 = l2 + l2_index;
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
l3_index += 1;
if (l3_index < l3_count) {
l3[l3_index] = (struct cpuinfo_cache) {
.size = temp_l3.size,
.associativity = temp_l3.associativity,
.sets = temp_l3.sets,
.partitions = 1,
.line_size = temp_l3.line_size,
.flags = temp_l3.flags,
.processor_start = i,
.processor_count =
shared_l3 ? valid_processors : arm_linux_processors[i].package_processor_count,
};
}
}
if (shared_l3) {
processors[i].cache.l3 = l3;
} else if (l3_index < l3_count) {
processors[i].cache.l3 = l3 + l3_index;
}
} else if (temp_l2.size != 0) {
/* Assume L2 is shared by cores in the same cluster */
if (arm_linux_processors[i].package_leader_id == arm_linux_processors[i].system_processor_id) {
l2_index += 1;
l2[l2_index] = (struct cpuinfo_cache) {
.size = temp_l2.size,
.associativity = temp_l2.associativity,
.sets = temp_l2.sets,
.partitions = 1,
.line_size = temp_l2.line_size,
.flags = temp_l2.flags,
.processor_start = i,
.processor_count = arm_linux_processors[i].package_processor_count,
};
}
processors[i].cache.l2 = l2 + l2_index;
}
}
/* Commit */
cpuinfo_processors = processors;
cpuinfo_cores = cores;
cpuinfo_clusters = clusters;
cpuinfo_packages = &package;
cpuinfo_uarchs = uarchs;
cpuinfo_cache[cpuinfo_cache_level_1i] = l1i;
cpuinfo_cache[cpuinfo_cache_level_1d] = l1d;
cpuinfo_cache[cpuinfo_cache_level_2] = l2;
cpuinfo_cache[cpuinfo_cache_level_3] = l3;
cpuinfo_processors_count = valid_processors;
cpuinfo_cores_count = valid_processors;
cpuinfo_clusters_count = cluster_count;
cpuinfo_packages_count = 1;
cpuinfo_uarchs_count = uarchs_count;
cpuinfo_cache_count[cpuinfo_cache_level_1i] = valid_processors;
cpuinfo_cache_count[cpuinfo_cache_level_1d] = valid_processors;
cpuinfo_cache_count[cpuinfo_cache_level_2] = l2_count;
cpuinfo_cache_count[cpuinfo_cache_level_3] = l3_count;
cpuinfo_max_cache_size = cpuinfo_arm_compute_max_cache_size(&processors[0]);
cpuinfo_linux_cpu_max = arm_linux_processors_count;
cpuinfo_linux_cpu_to_processor_map = linux_cpu_to_processor_map;
cpuinfo_linux_cpu_to_core_map = linux_cpu_to_core_map;
cpuinfo_linux_cpu_to_uarch_index_map = linux_cpu_to_uarch_index_map;
__sync_synchronize();
cpuinfo_is_initialized = true;
processors = NULL;
cores = NULL;
clusters = NULL;
uarchs = NULL;
l1i = l1d = l2 = l3 = NULL;
linux_cpu_to_processor_map = NULL;
linux_cpu_to_core_map = NULL;
linux_cpu_to_uarch_index_map = NULL;
cleanup:
free(arm_linux_processors);
free(processors);
free(cores);
free(clusters);
free(uarchs);
free(l1i);
free(l1d);
free(l2);
free(l3);
free(linux_cpu_to_processor_map);
free(linux_cpu_to_core_map);
free(linux_cpu_to_uarch_index_map);
}

863
3rdparty/cpuinfo/src/arm/linux/midr.c vendored Normal file
View File

@@ -0,0 +1,863 @@
#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <cpuinfo.h>
#include <arm/linux/api.h>
#if defined(__ANDROID__)
#include <arm/android/api.h>
#endif
#include <arm/api.h>
#include <arm/midr.h>
#include <linux/api.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
#include <cpuinfo/common.h>
#define CLUSTERS_MAX 3
static inline bool bitmask_all(uint32_t bitfield, uint32_t mask) {
return (bitfield & mask) == mask;
}
/* Description of core clusters configuration in a chipset (identified by series and model number) */
struct cluster_config {
/* Number of cores (logical processors) */
uint8_t cores;
/* ARM chipset series (see cpuinfo_arm_chipset_series enum) */
uint8_t series;
/* Chipset model number (see cpuinfo_arm_chipset struct) */
uint16_t model;
/* Number of heterogenous clusters in the CPU package */
uint8_t clusters;
/*
* Number of cores in each cluster:
# - Symmetric configurations: [0] = # cores
* - big.LITTLE configurations: [0] = # LITTLE cores, [1] = # big cores
* - Max.Med.Min configurations: [0] = # Min cores, [1] = # Med cores, [2] = # Max cores
*/
uint8_t cluster_cores[CLUSTERS_MAX];
/*
* MIDR of cores in each cluster:
* - Symmetric configurations: [0] = core MIDR
* - big.LITTLE configurations: [0] = LITTLE core MIDR, [1] = big core MIDR
* - Max.Med.Min configurations: [0] = Min core MIDR, [1] = Med core MIDR, [2] = Max core MIDR
*/
uint32_t cluster_midr[CLUSTERS_MAX];
};
/*
* The list of chipsets where MIDR may not be unambigiously decoded at least on some devices.
* The typical reasons for impossibility to decoded MIDRs are buggy kernels, which either do not report all MIDR
* information (e.g. on ATM7029 kernel doesn't report CPU Part), or chipsets have more than one type of cores
* (i.e. 4x Cortex-A53 + 4x Cortex-A53 is out) and buggy kernels report MIDR information only about some cores
* in /proc/cpuinfo (either only online cores, or only the core that reads /proc/cpuinfo). On these kernels/chipsets,
* it is not possible to detect all core types by just parsing /proc/cpuinfo, so we use chipset name and this table to
* find their MIDR (and thus microarchitecture, cache, etc).
*
* Note: not all chipsets with heterogeneous multiprocessing need an entry in this table. The following HMP
* chipsets always list information about all cores in /proc/cpuinfo:
*
* - Snapdragon 660
* - Snapdragon 820 (MSM8996)
* - Snapdragon 821 (MSM8996PRO)
* - Snapdragon 835 (MSM8998)
* - Exynos 8895
* - Kirin 960
*
* As these are all new processors, there is hope that this table won't uncontrollably grow over time.
*/
static const struct cluster_config cluster_configs[] = {
#if CPUINFO_ARCH_ARM
{
/*
* MSM8916 (Snapdragon 410): 4x Cortex-A53
* Some AArch32 phones use non-standard /proc/cpuinfo format.
*/
.cores = 4,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8916),
.clusters = 1,
.cluster_cores = {
[0] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD030),
},
},
{
/*
* MSM8939 (Snapdragon 615): 4x Cortex-A53 + 4x Cortex-A53
* Some AArch32 phones use non-standard /proc/cpuinfo format.
*/
.cores = 8,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8939),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD034),
},
},
#endif
{
/* MSM8956 (Snapdragon 650): 2x Cortex-A72 + 4x Cortex-A53 */
.cores = 6,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8956),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD080),
},
},
{
/* MSM8976/MSM8976PRO (Snapdragon 652/653): 4x Cortex-A72 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8976),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD080),
},
},
{
/* MSM8992 (Snapdragon 808): 2x Cortex-A57 + 4x Cortex-A53 */
.cores = 6,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8992),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD033),
[1] = UINT32_C(0x411FD072),
},
},
{
/* MSM8994/MSM8994V (Snapdragon 810): 4x Cortex-A57 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_qualcomm_msm,
.model = UINT16_C(8994),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD032),
[1] = UINT32_C(0x411FD071),
},
},
#if CPUINFO_ARCH_ARM
{
/* Exynos 5422: 4x Cortex-A15 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_samsung_exynos,
.model = UINT16_C(5422),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC073),
[1] = UINT32_C(0x412FC0F3),
},
},
{
/* Exynos 5430: 4x Cortex-A15 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_samsung_exynos,
.model = UINT16_C(5430),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC074),
[1] = UINT32_C(0x413FC0F3),
},
},
#endif /* CPUINFO_ARCH_ARM */
{
/* Exynos 5433: 4x Cortex-A57 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_samsung_exynos,
.model = UINT16_C(5433),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD031),
[1] = UINT32_C(0x411FD070),
},
},
{
/* Exynos 7420: 4x Cortex-A57 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_samsung_exynos,
.model = UINT16_C(7420),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD032),
[1] = UINT32_C(0x411FD070),
},
},
{
/* Exynos 8890: 4x Exynos M1 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_samsung_exynos,
.model = UINT16_C(8890),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x531F0011),
},
},
#if CPUINFO_ARCH_ARM
{
/* Kirin 920: 4x Cortex-A15 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_hisilicon_kirin,
.model = UINT16_C(920),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC075),
[1] = UINT32_C(0x413FC0F3),
},
},
{
/* Kirin 925: 4x Cortex-A15 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_hisilicon_kirin,
.model = UINT16_C(925),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC075),
[1] = UINT32_C(0x413FC0F3),
},
},
{
/* Kirin 928: 4x Cortex-A15 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_hisilicon_kirin,
.model = UINT16_C(928),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC075),
[1] = UINT32_C(0x413FC0F3),
},
},
#endif /* CPUINFO_ARCH_ARM */
{
/* Kirin 950: 4x Cortex-A72 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_hisilicon_kirin,
.model = UINT16_C(950),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD080),
},
},
{
/* Kirin 955: 4x Cortex-A72 + 4x Cortex-A53 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_hisilicon_kirin,
.model = UINT16_C(955),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD080),
},
},
#if CPUINFO_ARCH_ARM
{
/* MediaTek MT8135: 2x Cortex-A7 + 2x Cortex-A15 */
.cores = 4,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(8135),
.clusters = 2,
.cluster_cores = {
[0] = 2,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC073),
[1] = UINT32_C(0x413FC0F2),
},
},
#endif
{
/* MediaTek MT8173: 2x Cortex-A72 + 2x Cortex-A53 */
.cores = 4,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(8173),
.clusters = 2,
.cluster_cores = {
[0] = 2,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD032),
[1] = UINT32_C(0x410FD080),
},
},
{
/* MediaTek MT8176: 2x Cortex-A72 + 4x Cortex-A53 */
.cores = 6,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(8176),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD032),
[1] = UINT32_C(0x410FD080),
},
},
#if CPUINFO_ARCH_ARM64
{
/*
* MediaTek MT8735: 4x Cortex-A53
* Some AArch64 phones use non-standard /proc/cpuinfo format.
*/
.cores = 4,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(8735),
.clusters = 1,
.cluster_cores = {
[0] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
},
},
#endif
#if CPUINFO_ARCH_ARM
{
/*
* MediaTek MT6592: 4x Cortex-A7 + 4x Cortex-A7
* Some phones use non-standard /proc/cpuinfo format.
*/
.cores = 4,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(6592),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC074),
[1] = UINT32_C(0x410FC074),
},
},
{
/* MediaTek MT6595: 4x Cortex-A17 + 4x Cortex-A7 */
.cores = 8,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(6595),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC075),
[1] = UINT32_C(0x410FC0E0),
},
},
#endif
{
/* MediaTek MT6797: 2x Cortex-A72 + 4x Cortex-A53 + 4x Cortex-A53 */
.cores = 10,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(6797),
.clusters = 3,
.cluster_cores = {
[0] = 4,
[1] = 4,
[2] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD034),
[2] = UINT32_C(0x410FD081),
},
},
{
/* MediaTek MT6799: 2x Cortex-A73 + 4x Cortex-A53 + 4x Cortex-A35 */
.cores = 10,
.series = cpuinfo_arm_chipset_series_mediatek_mt,
.model = UINT16_C(6799),
.clusters = 3,
.cluster_cores = {
[0] = 4,
[1] = 4,
[2] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD041),
[1] = UINT32_C(0x410FD034),
[2] = UINT32_C(0x410FD092),
},
},
{
/* Rockchip RK3399: 2x Cortex-A72 + 4x Cortex-A53 */
.cores = 6,
.series = cpuinfo_arm_chipset_series_rockchip_rk,
.model = UINT16_C(3399),
.clusters = 2,
.cluster_cores = {
[0] = 4,
[1] = 2,
},
.cluster_midr = {
[0] = UINT32_C(0x410FD034),
[1] = UINT32_C(0x410FD082),
},
},
#if CPUINFO_ARCH_ARM
{
/* Actions ATM8029: 4x Cortex-A5
* Most devices use non-standard /proc/cpuinfo format.
*/
.cores = 4,
.series = cpuinfo_arm_chipset_series_actions_atm,
.model = UINT16_C(7029),
.clusters = 1,
.cluster_cores = {
[0] = 4,
},
.cluster_midr = {
[0] = UINT32_C(0x410FC051),
},
},
#endif
};
/*
* Searches chipset name in mapping of chipset name to cores' MIDR values. If match is successful, initializes MIDR
* for all clusters' leaders with tabulated values.
*
* @param[in] chipset - chipset (SoC) name information.
* @param clusters_count - number of CPU core clusters detected in the SoC.
* @param cluster_leaders - indices of core clusters' leaders in the @p processors array.
* @param processors_count - number of usable logical processors in the system.
* @param[in,out] processors - array of logical processor descriptions with pre-parsed MIDR, maximum frequency,
* and decoded core cluster (package_leader_id) information.
* Upon successful return, processors[i].midr for all clusters' leaders contains the
* tabulated MIDR values.
* @param verify_midr - indicated whether the function should check that the MIDR values to be assigned to leaders of
* core clusters are consistent with known parts of their parsed values.
* Set if to false if the only MIDR value parsed from /proc/cpuinfo is for the last processor
* reported in /proc/cpuinfo and thus can't be unambiguously attributed to that processor.
*
* @retval true if the chipset was found in the mapping and core clusters' leaders initialized with MIDR values.
* @retval false if the chipset was not found in the mapping, or any consistency check failed.
*/
static bool cpuinfo_arm_linux_detect_cluster_midr_by_chipset(
const struct cpuinfo_arm_chipset chipset[restrict static 1],
uint32_t clusters_count,
const uint32_t cluster_leaders[restrict static CLUSTERS_MAX],
uint32_t processors_count,
struct cpuinfo_arm_linux_processor processors[restrict static processors_count],
bool verify_midr)
{
if (clusters_count <= CLUSTERS_MAX) {
for (uint32_t c = 0; c < CPUINFO_COUNT_OF(cluster_configs); c++) {
if (cluster_configs[c].model == chipset->model && cluster_configs[c].series == chipset->series) {
/* Verify that the total number of cores and clusters of cores matches expectation */
if (cluster_configs[c].cores != processors_count || cluster_configs[c].clusters != clusters_count) {
return false;
}
/* Verify that core cluster configuration matches expectation */
for (uint32_t cluster = 0; cluster < clusters_count; cluster++) {
const uint32_t cluster_leader = cluster_leaders[cluster];
if (cluster_configs[c].cluster_cores[cluster] != processors[cluster_leader].package_processor_count) {
return false;
}
}
if (verify_midr) {
/* Verify known parts of MIDR */
for (uint32_t cluster = 0; cluster < clusters_count; cluster++) {
const uint32_t cluster_leader = cluster_leaders[cluster];
/* Create a mask of known midr bits */
uint32_t midr_mask = 0;
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
midr_mask |= CPUINFO_ARM_MIDR_IMPLEMENTER_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
midr_mask |= CPUINFO_ARM_MIDR_VARIANT_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_PART) {
midr_mask |= CPUINFO_ARM_MIDR_PART_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
midr_mask |= CPUINFO_ARM_MIDR_REVISION_MASK;
}
/* Verify the bits under the mask */
if ((processors[cluster_leader].midr ^ cluster_configs[c].cluster_midr[cluster]) & midr_mask) {
cpuinfo_log_debug("parsed MIDR of cluster %08"PRIu32" does not match tabulated value %08"PRIu32,
processors[cluster_leader].midr, cluster_configs[c].cluster_midr[cluster]);
return false;
}
}
}
/* Assign MIDRs according to tabulated configurations */
for (uint32_t cluster = 0; cluster < clusters_count; cluster++) {
const uint32_t cluster_leader = cluster_leaders[cluster];
processors[cluster_leader].midr = cluster_configs[c].cluster_midr[cluster];
processors[cluster_leader].flags |= CPUINFO_ARM_LINUX_VALID_MIDR;
cpuinfo_log_debug("cluster %"PRIu32" MIDR = 0x%08"PRIx32, cluster, cluster_configs[c].cluster_midr[cluster]);
}
return true;
}
}
}
return false;
}
/*
* Initializes MIDR for leaders of core clusters using a heuristic for big.LITTLE systems:
* - If the only known MIDR is for the big core cluster, guess the matching MIDR for the LITTLE cluster.
* - Estimate which of the clusters is big using maximum frequency, if known, otherwise using system processor ID.
* - Initialize the MIDR for big and LITTLE core clusters using the guesstimates values.
*
* @param clusters_count - number of CPU core clusters detected in the SoC.
* @param cluster_with_midr_count - number of CPU core clusters in the SoC with known MIDR values.
* @param last_processor_with_midr - index of the last logical processor with known MIDR in the @p processors array.
* @param cluster_leaders - indices of core clusters' leaders in the @p processors array.
* @param[in,out] processors - array of logical processor descriptions with pre-parsed MIDR, maximum frequency,
* and decoded core cluster (package_leader_id) information.
* Upon successful return, processors[i].midr for all core clusters' leaders contains
* the heuristically detected MIDR value.
* @param verify_midr - indicated whether the function should check that the MIDR values to be assigned to leaders of
* core clusters are consistent with known parts of their parsed values.
* Set if to false if the only MIDR value parsed from /proc/cpuinfo is for the last processor
* reported in /proc/cpuinfo and thus can't be unambiguously attributed to that processor.
*
* @retval true if this is a big.LITTLE system with only one known MIDR and the CPU core clusters' leaders were
* initialized with MIDR values.
* @retval false if this is not a big.LITTLE system.
*/
static bool cpuinfo_arm_linux_detect_cluster_midr_by_big_little_heuristic(
uint32_t clusters_count,
uint32_t cluster_with_midr_count,
uint32_t last_processor_with_midr,
const uint32_t cluster_leaders[restrict static CLUSTERS_MAX],
struct cpuinfo_arm_linux_processor processors[restrict static last_processor_with_midr],
bool verify_midr)
{
if (clusters_count != 2 || cluster_with_midr_count != 1) {
/* Not a big.LITTLE system, or MIDR is known for both/neither clusters */
return false;
}
const uint32_t midr_flags =
(processors[processors[last_processor_with_midr].package_leader_id].flags & CPUINFO_ARM_LINUX_VALID_MIDR);
const uint32_t big_midr = processors[processors[last_processor_with_midr].package_leader_id].midr;
const uint32_t little_midr = midr_little_core_for_big(big_midr);
/* Default assumption: the first reported cluster is LITTLE cluster (this holds on most Linux kernels) */
uint32_t little_cluster_leader = cluster_leaders[0];
const uint32_t other_cluster_leader = cluster_leaders[1];
/* If maximum frequency is known for both clusters, assume LITTLE cluster is the one with lower frequency */
if (processors[little_cluster_leader].flags & processors[other_cluster_leader].flags & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
if (processors[little_cluster_leader].max_frequency > processors[other_cluster_leader].max_frequency) {
little_cluster_leader = other_cluster_leader;
}
}
if (verify_midr) {
/* Verify known parts of MIDR */
for (uint32_t cluster = 0; cluster < clusters_count; cluster++) {
const uint32_t cluster_leader = cluster_leaders[cluster];
/* Create a mask of known midr bits */
uint32_t midr_mask = 0;
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_IMPLEMENTER) {
midr_mask |= CPUINFO_ARM_MIDR_IMPLEMENTER_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_VARIANT) {
midr_mask |= CPUINFO_ARM_MIDR_VARIANT_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_PART) {
midr_mask |= CPUINFO_ARM_MIDR_PART_MASK;
}
if (processors[cluster_leader].flags & CPUINFO_ARM_LINUX_VALID_REVISION) {
midr_mask |= CPUINFO_ARM_MIDR_REVISION_MASK;
}
/* Verify the bits under the mask */
const uint32_t midr = (cluster_leader == little_cluster_leader) ? little_midr : big_midr;
if ((processors[cluster_leader].midr ^ midr) & midr_mask) {
cpuinfo_log_debug(
"parsed MIDR %08"PRIu32" of cluster leader %"PRIu32" is inconsistent with expected value %08"PRIu32,
processors[cluster_leader].midr, cluster_leader, midr);
return false;
}
}
}
for (uint32_t c = 0; c < clusters_count; c++) {
/* Skip cluster with already assigned MIDR */
const uint32_t cluster_leader = cluster_leaders[c];
if (bitmask_all(processors[cluster_leader].flags, CPUINFO_ARM_LINUX_VALID_MIDR)) {
continue;
}
const uint32_t midr = (cluster_leader == little_cluster_leader) ? little_midr : big_midr;
cpuinfo_log_info("assume processor %"PRIu32" to have MIDR %08"PRIx32, cluster_leader, midr);
/* To be consistent, we copy the MIDR entirely, rather than by parts */
processors[cluster_leader].midr = midr;
processors[cluster_leader].flags |= midr_flags;
}
return true;
}
/*
* Initializes MIDR for leaders of core clusters in a single sequential scan:
* - Clusters preceeding the first reported MIDR value are assumed to have default MIDR value.
* - Clusters following any reported MIDR value to have that MIDR value.
*
* @param default_midr - MIDR value that will be assigned to cluster leaders preceeding any reported MIDR value.
* @param processors_count - number of logical processor descriptions in the @p processors array.
* @param[in,out] processors - array of logical processor descriptions with pre-parsed MIDR, maximum frequency,
* and decoded core cluster (package_leader_id) information.
* Upon successful return, processors[i].midr for all core clusters' leaders contains
* the assigned MIDR value.
*/
static void cpuinfo_arm_linux_detect_cluster_midr_by_sequential_scan(
uint32_t default_midr,
uint32_t processors_count,
struct cpuinfo_arm_linux_processor processors[restrict static processors_count])
{
uint32_t midr = default_midr;
for (uint32_t i = 0; i < processors_count; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (processors[i].package_leader_id == i) {
if (bitmask_all(processors[i].flags, CPUINFO_ARM_LINUX_VALID_MIDR)) {
midr = processors[i].midr;
} else {
cpuinfo_log_info("assume processor %"PRIu32" to have MIDR %08"PRIx32, i, midr);
/* To be consistent, we copy the MIDR entirely, rather than by parts */
processors[i].midr = midr;
processors[i].flags |= CPUINFO_ARM_LINUX_VALID_MIDR;
}
}
}
}
}
/*
* Detects MIDR of each CPU core clusters' leader.
*
* @param[in] chipset - chipset (SoC) name information.
* @param max_processors - number of processor descriptions in the @p processors array.
* @param usable_processors - number of processor descriptions in the @p processors array with both POSSIBLE and
* PRESENT flags.
* @param[in,out] processors - array of logical processor descriptions with pre-parsed MIDR, maximum frequency,
* and decoded core cluster (package_leader_id) information.
* Upon return, processors[i].midr for all clusters' leaders contains the MIDR value.
*
* @returns The number of core clusters
*/
uint32_t cpuinfo_arm_linux_detect_cluster_midr(
const struct cpuinfo_arm_chipset chipset[restrict static 1],
uint32_t max_processors,
uint32_t usable_processors,
struct cpuinfo_arm_linux_processor processors[restrict static max_processors])
{
uint32_t clusters_count = 0;
uint32_t cluster_leaders[CLUSTERS_MAX];
uint32_t last_processor_in_cpuinfo = max_processors;
uint32_t last_processor_with_midr = max_processors;
uint32_t processors_with_midr_count = 0;
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID)) {
if (processors[i].flags & CPUINFO_ARM_LINUX_VALID_PROCESSOR) {
last_processor_in_cpuinfo = i;
}
if (bitmask_all(processors[i].flags, CPUINFO_ARM_LINUX_VALID_IMPLEMENTER | CPUINFO_ARM_LINUX_VALID_PART)) {
last_processor_with_midr = i;
processors_with_midr_count += 1;
}
const uint32_t group_leader = processors[i].package_leader_id;
if (group_leader == i) {
if (clusters_count < CLUSTERS_MAX) {
cluster_leaders[clusters_count] = i;
}
clusters_count += 1;
} else {
/* Copy known bits of information to cluster leader */
if ((processors[i].flags & ~processors[group_leader].flags) & CPUINFO_LINUX_FLAG_MAX_FREQUENCY) {
processors[group_leader].max_frequency = processors[i].max_frequency;
processors[group_leader].flags |= CPUINFO_LINUX_FLAG_MAX_FREQUENCY;
}
if (!bitmask_all(processors[group_leader].flags, CPUINFO_ARM_LINUX_VALID_MIDR) &&
bitmask_all(processors[i].flags, CPUINFO_ARM_LINUX_VALID_MIDR))
{
processors[group_leader].midr = processors[i].midr;
processors[group_leader].flags |= CPUINFO_ARM_LINUX_VALID_MIDR;
}
}
}
}
cpuinfo_log_debug("detected %"PRIu32" core clusters", clusters_count);
/*
* Two relations between reported /proc/cpuinfo information, and cores is possible:
* - /proc/cpuinfo reports information for all or some of the cores below the corresponding
* "processor : <number>" lines. Information on offline cores may be missing.
* - /proc/cpuinfo reports information only once, after all "processor : <number>" lines.
* The reported information may relate to processor #0 or to the processor which
* executed the system calls to read /proc/cpuinfo. It is also indistinguishable
* from /proc/cpuinfo reporting information only for the last core (e.g. if all other
* cores are offline).
*
* We detect the second case by checking if /proc/cpuinfo contains valid MIDR only for one,
* last reported, processor. Note, that the last reported core may be not the last
* present & possible processor, as /proc/cpuinfo may non-report high-index offline cores.
*/
if (processors_with_midr_count == 1 && last_processor_in_cpuinfo == last_processor_with_midr && clusters_count > 1) {
/*
* There are multiple core clusters, but /proc/cpuinfo reported MIDR only for one
* processor, and we don't even know which logical processor this information refers to.
*
* We make three attempts to detect MIDR for all clusters:
* 1. Search tabulated MIDR values for chipsets which have heterogeneous clusters and ship with Linux
* kernels which do not always report all cores in /proc/cpuinfo. If found, use the tabulated values.
* 2. For systems with 2 clusters and MIDR known for one cluster, assume big.LITTLE configuration,
* and estimate MIDR for the other cluster under assumption that MIDR for the big cluster is known.
* 3. Initialize MIDRs for all core clusters to the only parsed MIDR value.
*/
cpuinfo_log_debug("the only reported MIDR can not be attributed to a particular processor");
if (cpuinfo_arm_linux_detect_cluster_midr_by_chipset(
chipset, clusters_count, cluster_leaders, usable_processors, processors, false))
{
return clusters_count;
}
/* Try big.LITTLE heuristic */
if (cpuinfo_arm_linux_detect_cluster_midr_by_big_little_heuristic(
clusters_count, 1, last_processor_with_midr,
cluster_leaders, processors, false))
{
return clusters_count;
}
/* Fall back to sequential initialization of MIDR values for core clusters */
cpuinfo_arm_linux_detect_cluster_midr_by_sequential_scan(
processors[processors[last_processor_with_midr].package_leader_id].midr,
max_processors, processors);
} else if (processors_with_midr_count < usable_processors) {
/*
* /proc/cpuinfo reported MIDR only for some processors, and probably some core clusters do not have MIDR
* for any of the cores. Check if this is the case.
*/
uint32_t clusters_with_midr_count = 0;
for (uint32_t i = 0; i < max_processors; i++) {
if (bitmask_all(processors[i].flags, CPUINFO_LINUX_FLAG_VALID | CPUINFO_ARM_LINUX_VALID_MIDR)) {
if (processors[i].package_leader_id == i) {
clusters_with_midr_count += 1;
}
}
}
if (clusters_with_midr_count < clusters_count) {
/*
* /proc/cpuinfo reported MIDR only for some clusters, need to reconstruct others.
* We make three attempts to detect MIDR for clusters without it:
* 1. Search tabulated MIDR values for chipsets which have heterogeneous clusters and ship with Linux
* kernels which do not always report all cores in /proc/cpuinfo. If found, use the tabulated values.
* 2. For systems with 2 clusters and MIDR known for one cluster, assume big.LITTLE configuration,
* and estimate MIDR for the other cluster under assumption that MIDR for the big cluster is known.
* 3. Initialize MIDRs for core clusters in a single sequential scan:
* - Clusters preceeding the first reported MIDR value are assumed to have the last reported MIDR value.
* - Clusters following any reported MIDR value to have that MIDR value.
*/
if (cpuinfo_arm_linux_detect_cluster_midr_by_chipset(
chipset, clusters_count, cluster_leaders, usable_processors, processors, true))
{
return clusters_count;
}
if (last_processor_with_midr != max_processors) {
/* Try big.LITTLE heuristic */
if (cpuinfo_arm_linux_detect_cluster_midr_by_big_little_heuristic(
clusters_count, processors_with_midr_count, last_processor_with_midr,
cluster_leaders, processors, true))
{
return clusters_count;
}
/* Fall back to sequential initialization of MIDR values for core clusters */
cpuinfo_arm_linux_detect_cluster_midr_by_sequential_scan(
processors[processors[last_processor_with_midr].package_leader_id].midr,
max_processors, processors);
}
}
}
return clusters_count;
}

619
3rdparty/cpuinfo/src/arm/mach/init.c vendored Normal file
View File

@@ -0,0 +1,619 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <alloca.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <mach/machine.h>
#include <cpuinfo.h>
#include <mach/api.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
/* Polyfill recent CPUFAMILY_ARM_* values for older SDKs */
#ifndef CPUFAMILY_ARM_MONSOON_MISTRAL
#define CPUFAMILY_ARM_MONSOON_MISTRAL 0xE81E7EF6
#endif
#ifndef CPUFAMILY_ARM_VORTEX_TEMPEST
#define CPUFAMILY_ARM_VORTEX_TEMPEST 0x07D34B9F
#endif
#ifndef CPUFAMILY_ARM_LIGHTNING_THUNDER
#define CPUFAMILY_ARM_LIGHTNING_THUNDER 0x462504D2
#endif
#ifndef CPUFAMILY_ARM_FIRESTORM_ICESTORM
#define CPUFAMILY_ARM_FIRESTORM_ICESTORM 0x1B588BB3
#endif
struct cpuinfo_arm_isa cpuinfo_isa = {
#if CPUINFO_ARCH_ARM
.thumb = true,
.thumb2 = true,
.thumbee = false,
.jazelle = false,
.armv5e = true,
.armv6 = true,
.armv6k = true,
.armv7 = true,
.vfpv2 = false,
.vfpv3 = true,
.d32 = true,
.wmmx = false,
.wmmx2 = false,
.neon = true,
#endif
#if CPUINFO_ARCH_ARM64
.aes = true,
.sha1 = true,
.sha2 = true,
.pmull = true,
.crc32 = true,
#endif
};
static uint32_t get_sys_info(int type_specifier, const char* name) {
size_t size = 0;
uint32_t result = 0;
int mib[2] = { CTL_HW, type_specifier };
if (sysctl(mib, 2, NULL, &size, NULL, 0) != 0) {
cpuinfo_log_info("sysctl(\"%s\") failed: %s", name, strerror(errno));
} else if (size == sizeof(uint32_t)) {
sysctl(mib, 2, &result, &size, NULL, 0);
cpuinfo_log_debug("%s: %"PRIu32 ", size = %lu", name, result, size);
} else {
cpuinfo_log_info("sysctl does not support non-integer lookup for (\"%s\")", name);
}
return result;
}
static uint32_t get_sys_info_by_name(const char* type_specifier) {
size_t size = 0;
uint32_t result = 0;
if (sysctlbyname(type_specifier, NULL, &size, NULL, 0) != 0) {
cpuinfo_log_info("sysctlbyname(\"%s\") failed: %s", type_specifier, strerror(errno));
} else if (size == sizeof(uint32_t)) {
sysctlbyname(type_specifier, &result, &size, NULL, 0);
cpuinfo_log_debug("%s: %"PRIu32 ", size = %lu", type_specifier, result, size);
} else {
cpuinfo_log_info("sysctl does not support non-integer lookup for (\"%s\")", type_specifier);
}
return result;
}
static enum cpuinfo_uarch decode_uarch(uint32_t cpu_family, uint32_t cpu_subtype, uint32_t core_index, uint32_t core_count) {
switch (cpu_family) {
case CPUFAMILY_ARM_SWIFT:
return cpuinfo_uarch_swift;
case CPUFAMILY_ARM_CYCLONE:
return cpuinfo_uarch_cyclone;
case CPUFAMILY_ARM_TYPHOON:
return cpuinfo_uarch_typhoon;
case CPUFAMILY_ARM_TWISTER:
return cpuinfo_uarch_twister;
case CPUFAMILY_ARM_HURRICANE:
return cpuinfo_uarch_hurricane;
case CPUFAMILY_ARM_MONSOON_MISTRAL:
/* 2x Monsoon + 4x Mistral cores */
return core_index < 2 ? cpuinfo_uarch_monsoon : cpuinfo_uarch_mistral;
case CPUFAMILY_ARM_VORTEX_TEMPEST:
/* Hexa-core: 2x Vortex + 4x Tempest; Octa-core: 4x Cortex + 4x Tempest */
return core_index + 4 < core_count ? cpuinfo_uarch_vortex : cpuinfo_uarch_tempest;
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
/* Hexa-core: 2x Lightning + 4x Thunder; Octa-core (presumed): 4x Lightning + 4x Thunder */
return core_index + 4 < core_count ? cpuinfo_uarch_lightning : cpuinfo_uarch_thunder;
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
/* Hexa-core: 2x Firestorm + 4x Icestorm; Octa-core: 4x Firestorm + 4x Icestorm */
return core_index + 4 < core_count ? cpuinfo_uarch_firestorm : cpuinfo_uarch_icestorm;
default:
/* Use hw.cpusubtype for detection */
break;
}
#if CPUINFO_ARCH_ARM
switch (cpu_subtype) {
case CPU_SUBTYPE_ARM_V7:
return cpuinfo_uarch_cortex_a8;
case CPU_SUBTYPE_ARM_V7F:
return cpuinfo_uarch_cortex_a9;
case CPU_SUBTYPE_ARM_V7K:
return cpuinfo_uarch_cortex_a7;
default:
return cpuinfo_uarch_unknown;
}
#else
return cpuinfo_uarch_unknown;
#endif
}
static void decode_package_name(char* package_name) {
size_t size;
if (sysctlbyname("hw.machine", NULL, &size, NULL, 0) != 0) {
cpuinfo_log_warning("sysctlbyname(\"hw.machine\") failed: %s", strerror(errno));
return;
}
char *machine_name = alloca(size);
if (sysctlbyname("hw.machine", machine_name, &size, NULL, 0) != 0) {
cpuinfo_log_warning("sysctlbyname(\"hw.machine\") failed: %s", strerror(errno));
return;
}
cpuinfo_log_debug("hw.machine: %s", machine_name);
char name[10];
uint32_t major = 0, minor = 0;
if (sscanf(machine_name, "%9[^,0123456789]%"SCNu32",%"SCNu32, name, &major, &minor) != 3) {
cpuinfo_log_warning("parsing \"hw.machine\" failed: %s", strerror(errno));
return;
}
uint32_t chip_model = 0;
char suffix = '\0';
if (strcmp(name, "iPhone") == 0) {
/*
* iPhone 4 and up are supported:
* - iPhone 4 [A4]: iPhone3,1, iPhone3,2, iPhone3,3
* - iPhone 4S [A5]: iPhone4,1
* - iPhone 5 [A6]: iPhone5,1, iPhone5,2
* - iPhone 5c [A6]: iPhone5,3, iPhone5,4
* - iPhone 5s [A7]: iPhone6,1, iPhone6,2
* - iPhone 6 [A8]: iPhone7,2
* - iPhone 6 Plus [A8]: iPhone7,1
* - iPhone 6s [A9]: iPhone8,1
* - iPhone 6s Plus [A9]: iPhone8,2
* - iPhone SE [A9]: iPhone8,4
* - iPhone 7 [A10]: iPhone9,1, iPhone9,3
* - iPhone 7 Plus [A10]: iPhone9,2, iPhone9,4
* - iPhone 8 [A11]: iPhone10,1, iPhone10,4
* - iPhone 8 Plus [A11]: iPhone10,2, iPhone10,5
* - iPhone X [A11]: iPhone10,3, iPhone10,6
* - iPhone XS [A12]: iPhone11,2,
* - iPhone XS Max [A12]: iPhone11,4, iPhone11,6
* - iPhone XR [A12]: iPhone11,8
*/
chip_model = major + 1;
} else if (strcmp(name, "iPad") == 0) {
switch (major) {
/* iPad 2 and up are supported */
case 2:
/*
* iPad 2 [A5]: iPad2,1, iPad2,2, iPad2,3, iPad2,4
* iPad mini [A5]: iPad2,5, iPad2,6, iPad2,7
*/
chip_model = major + 3;
break;
case 3:
/*
* iPad 3rd Gen [A5X]: iPad3,1, iPad3,2, iPad3,3
* iPad 4th Gen [A6X]: iPad3,4, iPad3,5, iPad3,6
*/
chip_model = (minor <= 3) ? 5 : 6;
suffix = 'X';
break;
case 4:
/*
* iPad Air [A7]: iPad4,1, iPad4,2, iPad4,3
* iPad mini Retina [A7]: iPad4,4, iPad4,5, iPad4,6
* iPad mini 3 [A7]: iPad4,7, iPad4,8, iPad4,9
*/
chip_model = major + 3;
break;
case 5:
/*
* iPad mini 4 [A8]: iPad5,1, iPad5,2
* iPad Air 2 [A8X]: iPad5,3, iPad5,4
*/
chip_model = major + 3;
suffix = (minor <= 2) ? '\0' : 'X';
break;
case 6:
/*
* iPad Pro 9.7" [A9X]: iPad6,3, iPad6,4
* iPad Pro [A9X]: iPad6,7, iPad6,8
* iPad 5th Gen [A9]: iPad6,11, iPad6,12
*/
chip_model = major + 3;
suffix = minor <= 8 ? 'X' : '\0';
break;
case 7:
/*
* iPad Pro 12.9" [A10X]: iPad7,1, iPad7,2
* iPad Pro 10.5" [A10X]: iPad7,3, iPad7,4
* iPad 6th Gen [A10]: iPad7,5, iPad7,6
*/
chip_model = major + 3;
suffix = minor <= 4 ? 'X' : '\0';
break;
default:
cpuinfo_log_info("unknown iPad: %s", machine_name);
break;
}
} else if (strcmp(name, "iPod") == 0) {
switch (major) {
case 5:
chip_model = 5;
break;
/* iPod touch (5th Gen) [A5]: iPod5,1 */
case 7:
/* iPod touch (6th Gen, 2015) [A8]: iPod7,1 */
chip_model = 8;
break;
default:
cpuinfo_log_info("unknown iPod: %s", machine_name);
break;
}
} else {
cpuinfo_log_info("unknown device: %s", machine_name);
}
if (chip_model != 0) {
snprintf(package_name, CPUINFO_PACKAGE_NAME_MAX, "Apple A%"PRIu32"%c", chip_model, suffix);
}
}
void cpuinfo_arm_mach_init(void) {
struct cpuinfo_processor* processors = NULL;
struct cpuinfo_core* cores = NULL;
struct cpuinfo_cluster* clusters = NULL;
struct cpuinfo_package* packages = NULL;
struct cpuinfo_uarch_info* uarchs = NULL;
struct cpuinfo_cache* l1i = NULL;
struct cpuinfo_cache* l1d = NULL;
struct cpuinfo_cache* l2 = NULL;
struct cpuinfo_cache* l3 = NULL;
struct cpuinfo_mach_topology mach_topology = cpuinfo_mach_detect_topology();
processors = calloc(mach_topology.threads, sizeof(struct cpuinfo_processor));
if (processors == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" logical processors",
mach_topology.threads * sizeof(struct cpuinfo_processor), mach_topology.threads);
goto cleanup;
}
cores = calloc(mach_topology.cores, sizeof(struct cpuinfo_core));
if (cores == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" cores",
mach_topology.cores * sizeof(struct cpuinfo_core), mach_topology.cores);
goto cleanup;
}
packages = calloc(mach_topology.packages, sizeof(struct cpuinfo_package));
if (packages == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" packages",
mach_topology.packages * sizeof(struct cpuinfo_package), mach_topology.packages);
goto cleanup;
}
const uint32_t threads_per_core = mach_topology.threads / mach_topology.cores;
const uint32_t threads_per_package = mach_topology.threads / mach_topology.packages;
const uint32_t cores_per_package = mach_topology.cores / mach_topology.packages;
for (uint32_t i = 0; i < mach_topology.packages; i++) {
packages[i] = (struct cpuinfo_package) {
.processor_start = i * threads_per_package,
.processor_count = threads_per_package,
.core_start = i * cores_per_package,
.core_count = cores_per_package,
};
decode_package_name(packages[i].name);
}
const uint32_t cpu_family = get_sys_info_by_name("hw.cpufamily");
const uint32_t cpu_type = get_sys_info_by_name("hw.cputype");
const uint32_t cpu_subtype = get_sys_info_by_name("hw.cpusubtype");
switch (cpu_type) {
case CPU_TYPE_ARM64:
cpuinfo_isa.aes = true;
cpuinfo_isa.sha1 = true;
cpuinfo_isa.sha2 = true;
cpuinfo_isa.pmull = true;
cpuinfo_isa.crc32 = true;
break;
#if CPUINFO_ARCH_ARM
case CPU_TYPE_ARM:
switch (cpu_subtype) {
case CPU_SUBTYPE_ARM_V8:
cpuinfo_isa.armv8 = true;
cpuinfo_isa.aes = true;
cpuinfo_isa.sha1 = true;
cpuinfo_isa.sha2 = true;
cpuinfo_isa.pmull = true;
cpuinfo_isa.crc32 = true;
/* Fall-through to add ARMv7S features */
case CPU_SUBTYPE_ARM_V7S:
case CPU_SUBTYPE_ARM_V7K:
cpuinfo_isa.fma = true;
/* Fall-through to add ARMv7F features */
case CPU_SUBTYPE_ARM_V7F:
cpuinfo_isa.armv7mp = true;
cpuinfo_isa.fp16 = true;
/* Fall-through to add ARMv7 features */
case CPU_SUBTYPE_ARM_V7:
break;
default:
break;
}
break;
#endif
}
/*
* Support for ARMv8.1 Atomics & FP16 arithmetic instructions is supposed to be detected via
* sysctlbyname calls with "hw.optional.armv8_1_atomics" and "hw.optional.neon_fp16" arguments
* (see https://devstreaming-cdn.apple.com/videos/wwdc/2018/409t8zw7rumablsh/409/409_whats_new_in_llvm.pdf),
* but on new iOS versions these calls just fail with EPERM.
*
* Thus, we whitelist CPUs known to support these instructions.
*/
switch (cpu_family) {
case CPUFAMILY_ARM_MONSOON_MISTRAL:
case CPUFAMILY_ARM_VORTEX_TEMPEST:
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
#if CPUINFO_ARCH_ARM64
cpuinfo_isa.atomics = true;
#endif
cpuinfo_isa.fp16arith = true;
}
/*
* There does not yet seem to exist an OS mechanism to detect support for
* ARMv8.2 optional dot-product instructions, so we currently whitelist CPUs
* known to support these instruction.
*/
switch (cpu_family) {
case CPUFAMILY_ARM_LIGHTNING_THUNDER:
case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
cpuinfo_isa.dot = true;
}
uint32_t num_clusters = 1;
for (uint32_t i = 0; i < mach_topology.cores; i++) {
cores[i] = (struct cpuinfo_core) {
.processor_start = i * threads_per_core,
.processor_count = threads_per_core,
.core_id = i % cores_per_package,
.package = packages + i / cores_per_package,
.vendor = cpuinfo_vendor_apple,
.uarch = decode_uarch(cpu_family, cpu_subtype, i, mach_topology.cores),
};
if (i != 0 && cores[i].uarch != cores[i - 1].uarch) {
num_clusters++;
}
}
for (uint32_t i = 0; i < mach_topology.threads; i++) {
const uint32_t smt_id = i % threads_per_core;
const uint32_t core_id = i / threads_per_core;
const uint32_t package_id = i / threads_per_package;
processors[i].smt_id = smt_id;
processors[i].core = &cores[core_id];
processors[i].package = &packages[package_id];
}
clusters = calloc(num_clusters, sizeof(struct cpuinfo_cluster));
if (clusters == NULL) {
cpuinfo_log_error(
"failed to allocate %zu bytes for descriptions of %"PRIu32" clusters",
num_clusters * sizeof(struct cpuinfo_cluster), num_clusters);
goto cleanup;
}
uarchs = calloc(num_clusters, sizeof(struct cpuinfo_uarch_info));
if (uarchs == NULL) {
cpuinfo_log_error(
"failed to allocate %zu bytes for descriptions of %"PRIu32" uarchs",
num_clusters * sizeof(enum cpuinfo_uarch), num_clusters);
goto cleanup;
}
uint32_t cluster_idx = UINT32_MAX;
for (uint32_t i = 0; i < mach_topology.cores; i++) {
if (i == 0 || cores[i].uarch != cores[i - 1].uarch) {
cluster_idx++;
uarchs[cluster_idx] = (struct cpuinfo_uarch_info) {
.uarch = cores[i].uarch,
.processor_count = 1,
.core_count = 1,
};
clusters[cluster_idx] = (struct cpuinfo_cluster) {
.processor_start = i * threads_per_core,
.processor_count = 1,
.core_start = i,
.core_count = 1,
.cluster_id = cluster_idx,
.package = cores[i].package,
.vendor = cores[i].vendor,
.uarch = cores[i].uarch,
};
} else {
uarchs[cluster_idx].processor_count++;
uarchs[cluster_idx].core_count++;
clusters[cluster_idx].processor_count++;
clusters[cluster_idx].core_count++;
}
cores[i].cluster = &clusters[cluster_idx];
}
for (uint32_t i = 0; i < mach_topology.threads; i++) {
const uint32_t core_id = i / threads_per_core;
processors[i].cluster = cores[core_id].cluster;
}
for (uint32_t i = 0; i < mach_topology.packages; i++) {
packages[i].cluster_start = 0;
packages[i].cluster_count = num_clusters;
}
const uint32_t cacheline_size = get_sys_info(HW_CACHELINE, "HW_CACHELINE");
const uint32_t l1d_cache_size = get_sys_info(HW_L1DCACHESIZE, "HW_L1DCACHESIZE");
const uint32_t l1i_cache_size = get_sys_info(HW_L1ICACHESIZE, "HW_L1ICACHESIZE");
const uint32_t l2_cache_size = get_sys_info(HW_L2CACHESIZE, "HW_L2CACHESIZE");
const uint32_t l3_cache_size = get_sys_info(HW_L3CACHESIZE, "HW_L3CACHESIZE");
const uint32_t l1_cache_associativity = 4;
const uint32_t l2_cache_associativity = 8;
const uint32_t l3_cache_associativity = 16;
const uint32_t cache_partitions = 1;
const uint32_t cache_flags = 0;
uint32_t threads_per_l1 = 0, l1_count = 0;
if (l1i_cache_size != 0 || l1d_cache_size != 0) {
/* Assume L1 caches are private to each core */
threads_per_l1 = 1;
l1_count = mach_topology.threads / threads_per_l1;
cpuinfo_log_debug("detected %"PRIu32" L1 caches", l1_count);
}
uint32_t threads_per_l2 = 0, l2_count = 0;
if (l2_cache_size != 0) {
/* Assume L2 cache is shared between all cores */
threads_per_l2 = mach_topology.cores;
l2_count = 1;
cpuinfo_log_debug("detected %"PRIu32" L2 caches", l2_count);
}
uint32_t threads_per_l3 = 0, l3_count = 0;
if (l3_cache_size != 0) {
/* Assume L3 cache is shared between all cores */
threads_per_l3 = mach_topology.cores;
l3_count = 1;
cpuinfo_log_debug("detected %"PRIu32" L3 caches", l3_count);
}
if (l1i_cache_size != 0) {
l1i = calloc(l1_count, sizeof(struct cpuinfo_cache));
if (l1i == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1I caches",
l1_count * sizeof(struct cpuinfo_cache), l1_count);
goto cleanup;
}
for (uint32_t c = 0; c < l1_count; c++) {
l1i[c] = (struct cpuinfo_cache) {
.size = l1i_cache_size,
.associativity = l1_cache_associativity,
.sets = l1i_cache_size / (l1_cache_associativity * cacheline_size),
.partitions = cache_partitions,
.line_size = cacheline_size,
.flags = cache_flags,
.processor_start = c * threads_per_l1,
.processor_count = threads_per_l1,
};
}
for (uint32_t t = 0; t < mach_topology.threads; t++) {
processors[t].cache.l1i = &l1i[t / threads_per_l1];
}
}
if (l1d_cache_size != 0) {
l1d = calloc(l1_count, sizeof(struct cpuinfo_cache));
if (l1d == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1D caches",
l1_count * sizeof(struct cpuinfo_cache), l1_count);
goto cleanup;
}
for (uint32_t c = 0; c < l1_count; c++) {
l1d[c] = (struct cpuinfo_cache) {
.size = l1d_cache_size,
.associativity = l1_cache_associativity,
.sets = l1d_cache_size / (l1_cache_associativity * cacheline_size),
.partitions = cache_partitions,
.line_size = cacheline_size,
.flags = cache_flags,
.processor_start = c * threads_per_l1,
.processor_count = threads_per_l1,
};
}
for (uint32_t t = 0; t < mach_topology.threads; t++) {
processors[t].cache.l1d = &l1d[t / threads_per_l1];
}
}
if (l2_count != 0) {
l2 = calloc(l2_count, sizeof(struct cpuinfo_cache));
if (l2 == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L2 caches",
l2_count * sizeof(struct cpuinfo_cache), l2_count);
goto cleanup;
}
for (uint32_t c = 0; c < l2_count; c++) {
l2[c] = (struct cpuinfo_cache) {
.size = l2_cache_size,
.associativity = l2_cache_associativity,
.sets = l2_cache_size / (l2_cache_associativity * cacheline_size),
.partitions = cache_partitions,
.line_size = cacheline_size,
.flags = cache_flags,
.processor_start = c * threads_per_l2,
.processor_count = threads_per_l2,
};
}
for (uint32_t t = 0; t < mach_topology.threads; t++) {
processors[t].cache.l2 = &l2[0];
}
}
if (l3_count != 0) {
l3 = calloc(l3_count, sizeof(struct cpuinfo_cache));
if (l3 == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L3 caches",
l3_count * sizeof(struct cpuinfo_cache), l3_count);
goto cleanup;
}
for (uint32_t c = 0; c < l3_count; c++) {
l3[c] = (struct cpuinfo_cache) {
.size = l3_cache_size,
.associativity = l3_cache_associativity,
.sets = l3_cache_size / (l3_cache_associativity * cacheline_size),
.partitions = cache_partitions,
.line_size = cacheline_size,
.flags = cache_flags,
.processor_start = c * threads_per_l3,
.processor_count = threads_per_l3,
};
}
for (uint32_t t = 0; t < mach_topology.threads; t++) {
processors[t].cache.l3 = &l3[0];
}
}
/* Commit changes */
cpuinfo_processors = processors;
cpuinfo_cores = cores;
cpuinfo_clusters = clusters;
cpuinfo_packages = packages;
cpuinfo_uarchs = uarchs;
cpuinfo_cache[cpuinfo_cache_level_1i] = l1i;
cpuinfo_cache[cpuinfo_cache_level_1d] = l1d;
cpuinfo_cache[cpuinfo_cache_level_2] = l2;
cpuinfo_cache[cpuinfo_cache_level_3] = l3;
cpuinfo_processors_count = mach_topology.threads;
cpuinfo_cores_count = mach_topology.cores;
cpuinfo_clusters_count = num_clusters;
cpuinfo_packages_count = mach_topology.packages;
cpuinfo_uarchs_count = num_clusters;
cpuinfo_cache_count[cpuinfo_cache_level_1i] = l1_count;
cpuinfo_cache_count[cpuinfo_cache_level_1d] = l1_count;
cpuinfo_cache_count[cpuinfo_cache_level_2] = l2_count;
cpuinfo_cache_count[cpuinfo_cache_level_3] = l3_count;
cpuinfo_max_cache_size = cpuinfo_compute_max_cache_size(&processors[0]);
__sync_synchronize();
cpuinfo_is_initialized = true;
processors = NULL;
cores = NULL;
clusters = NULL;
packages = NULL;
uarchs = NULL;
l1i = l1d = l2 = l3 = NULL;
cleanup:
free(processors);
free(cores);
free(clusters);
free(packages);
free(uarchs);
free(l1i);
free(l1d);
free(l2);
free(l3);
}

257
3rdparty/cpuinfo/src/arm/midr.h vendored Normal file
View File

@@ -0,0 +1,257 @@
#pragma once
#include <stdint.h>
#define CPUINFO_ARM_MIDR_IMPLEMENTER_MASK UINT32_C(0xFF000000)
#define CPUINFO_ARM_MIDR_VARIANT_MASK UINT32_C(0x00F00000)
#define CPUINFO_ARM_MIDR_ARCHITECTURE_MASK UINT32_C(0x000F0000)
#define CPUINFO_ARM_MIDR_PART_MASK UINT32_C(0x0000FFF0)
#define CPUINFO_ARM_MIDR_REVISION_MASK UINT32_C(0x0000000F)
#define CPUINFO_ARM_MIDR_IMPLEMENTER_OFFSET 24
#define CPUINFO_ARM_MIDR_VARIANT_OFFSET 20
#define CPUINFO_ARM_MIDR_ARCHITECTURE_OFFSET 16
#define CPUINFO_ARM_MIDR_PART_OFFSET 4
#define CPUINFO_ARM_MIDR_REVISION_OFFSET 0
#define CPUINFO_ARM_MIDR_ARM1156 UINT32_C(0x410FB560)
#define CPUINFO_ARM_MIDR_CORTEX_A7 UINT32_C(0x410FC070)
#define CPUINFO_ARM_MIDR_CORTEX_A9 UINT32_C(0x410FC090)
#define CPUINFO_ARM_MIDR_CORTEX_A15 UINT32_C(0x410FC0F0)
#define CPUINFO_ARM_MIDR_CORTEX_A17 UINT32_C(0x410FC0E0)
#define CPUINFO_ARM_MIDR_CORTEX_A35 UINT32_C(0x410FD040)
#define CPUINFO_ARM_MIDR_CORTEX_A53 UINT32_C(0x410FD030)
#define CPUINFO_ARM_MIDR_CORTEX_A55 UINT32_C(0x410FD050)
#define CPUINFO_ARM_MIDR_CORTEX_A57 UINT32_C(0x410FD070)
#define CPUINFO_ARM_MIDR_CORTEX_A72 UINT32_C(0x410FD080)
#define CPUINFO_ARM_MIDR_CORTEX_A73 UINT32_C(0x410FD090)
#define CPUINFO_ARM_MIDR_CORTEX_A75 UINT32_C(0x410FD0A0)
#define CPUINFO_ARM_MIDR_KRYO280_GOLD UINT32_C(0x51AF8001)
#define CPUINFO_ARM_MIDR_KRYO280_SILVER UINT32_C(0x51AF8014)
#define CPUINFO_ARM_MIDR_KRYO385_GOLD UINT32_C(0x518F802D)
#define CPUINFO_ARM_MIDR_KRYO385_SILVER UINT32_C(0x518F803C)
#define CPUINFO_ARM_MIDR_KRYO_SILVER_821 UINT32_C(0x510F2010)
#define CPUINFO_ARM_MIDR_KRYO_GOLD UINT32_C(0x510F2050)
#define CPUINFO_ARM_MIDR_KRYO_SILVER_820 UINT32_C(0x510F2110)
#define CPUINFO_ARM_MIDR_EXYNOS_M1_M2 UINT32_C(0x530F0010)
#define CPUINFO_ARM_MIDR_DENVER2 UINT32_C(0x4E0F0030)
inline static uint32_t midr_set_implementer(uint32_t midr, uint32_t implementer) {
return (midr & ~CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) |
((implementer << CPUINFO_ARM_MIDR_IMPLEMENTER_OFFSET) & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK);
}
inline static uint32_t midr_set_variant(uint32_t midr, uint32_t variant) {
return (midr & ~CPUINFO_ARM_MIDR_VARIANT_MASK) |
((variant << CPUINFO_ARM_MIDR_VARIANT_OFFSET) & CPUINFO_ARM_MIDR_VARIANT_MASK);
}
inline static uint32_t midr_set_architecture(uint32_t midr, uint32_t architecture) {
return (midr & ~CPUINFO_ARM_MIDR_ARCHITECTURE_MASK) |
((architecture << CPUINFO_ARM_MIDR_ARCHITECTURE_OFFSET) & CPUINFO_ARM_MIDR_ARCHITECTURE_MASK);
}
inline static uint32_t midr_set_part(uint32_t midr, uint32_t part) {
return (midr & ~CPUINFO_ARM_MIDR_PART_MASK) |
((part << CPUINFO_ARM_MIDR_PART_OFFSET) & CPUINFO_ARM_MIDR_PART_MASK);
}
inline static uint32_t midr_set_revision(uint32_t midr, uint32_t revision) {
return (midr & ~CPUINFO_ARM_MIDR_REVISION_MASK) |
((revision << CPUINFO_ARM_MIDR_REVISION_OFFSET) & CPUINFO_ARM_MIDR_REVISION_MASK);
}
inline static uint32_t midr_get_variant(uint32_t midr) {
return (midr & CPUINFO_ARM_MIDR_VARIANT_MASK) >> CPUINFO_ARM_MIDR_VARIANT_OFFSET;
}
inline static uint32_t midr_get_implementer(uint32_t midr) {
return (midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) >> CPUINFO_ARM_MIDR_IMPLEMENTER_OFFSET;
}
inline static uint32_t midr_get_part(uint32_t midr) {
return (midr & CPUINFO_ARM_MIDR_PART_MASK) >> CPUINFO_ARM_MIDR_PART_OFFSET;
}
inline static uint32_t midr_get_revision(uint32_t midr) {
return (midr & CPUINFO_ARM_MIDR_REVISION_MASK) >> CPUINFO_ARM_MIDR_REVISION_OFFSET;
}
inline static uint32_t midr_copy_implementer(uint32_t midr, uint32_t other_midr) {
return (midr & ~CPUINFO_ARM_MIDR_IMPLEMENTER_MASK) | (other_midr & CPUINFO_ARM_MIDR_IMPLEMENTER_MASK);
}
inline static uint32_t midr_copy_variant(uint32_t midr, uint32_t other_midr) {
return (midr & ~CPUINFO_ARM_MIDR_VARIANT_MASK) | (other_midr & CPUINFO_ARM_MIDR_VARIANT_MASK);
}
inline static uint32_t midr_copy_architecture(uint32_t midr, uint32_t other_midr) {
return (midr & ~CPUINFO_ARM_MIDR_ARCHITECTURE_MASK) | (other_midr & CPUINFO_ARM_MIDR_ARCHITECTURE_MASK);
}
inline static uint32_t midr_copy_part(uint32_t midr, uint32_t other_midr) {
return (midr & ~CPUINFO_ARM_MIDR_PART_MASK) | (other_midr & CPUINFO_ARM_MIDR_PART_MASK);
}
inline static uint32_t midr_copy_revision(uint32_t midr, uint32_t other_midr) {
return (midr & ~CPUINFO_ARM_MIDR_REVISION_MASK) | (other_midr & CPUINFO_ARM_MIDR_REVISION_MASK);
}
inline static bool midr_is_arm1156(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_ARM1156 & uarch_mask);
}
inline static bool midr_is_arm11(uint32_t midr) {
return (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | 0x0000F000)) == UINT32_C(0x4100B000);
}
inline static bool midr_is_cortex_a9(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_CORTEX_A9 & uarch_mask);
}
inline static bool midr_is_scorpion(uint32_t midr) {
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x510000F0):
case UINT32_C(0x510002D0):
return true;
default:
return false;
}
}
inline static bool midr_is_krait(uint32_t midr) {
switch (midr & (CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case UINT32_C(0x510004D0):
case UINT32_C(0x510006F0):
return true;
default:
return false;
}
}
inline static bool midr_is_cortex_a53(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_CORTEX_A53 & uarch_mask);
}
inline static bool midr_is_qualcomm_cortex_a53_silver(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_KRYO280_SILVER & uarch_mask);
}
inline static bool midr_is_qualcomm_cortex_a55_silver(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_KRYO385_SILVER & uarch_mask);
}
inline static bool midr_is_kryo280_gold(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_KRYO280_GOLD & uarch_mask);
}
inline static bool midr_is_kryo_silver(uint32_t midr) {
const uint32_t uarch_mask =
CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_ARCHITECTURE_MASK | CPUINFO_ARM_MIDR_PART_MASK;
switch (midr & uarch_mask) {
case CPUINFO_ARM_MIDR_KRYO_SILVER_820:
case CPUINFO_ARM_MIDR_KRYO_SILVER_821:
return true;
default:
return false;
}
}
inline static bool midr_is_kryo_gold(uint32_t midr) {
const uint32_t uarch_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
return (midr & uarch_mask) == (CPUINFO_ARM_MIDR_KRYO_GOLD & uarch_mask);
}
inline static uint32_t midr_score_core(uint32_t midr) {
const uint32_t core_mask = CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_PART_MASK;
switch (midr & core_mask) {
case UINT32_C(0x53000030): /* Exynos M4 */
case UINT32_C(0x53000040): /* Exynos M5 */
case UINT32_C(0x4100D440): /* Cortex-X1 */
/* These cores are in big role w.r.t Cortex-A75/-A76/-A77/-A78 */
return 6;
case UINT32_C(0x4E000030): /* Denver 2 */
case UINT32_C(0x53000010): /* Exynos M1 and Exynos M2 */
case UINT32_C(0x53000020): /* Exynos M3 */
case UINT32_C(0x51008040): /* Kryo 485 Gold / Gold Prime */
case UINT32_C(0x51008020): /* Kryo 385 Gold */
case UINT32_C(0x51008000): /* Kryo 260 / 280 Gold */
case UINT32_C(0x51002050): /* Kryo Gold */
case UINT32_C(0x4800D400): /* Cortex-A76 (HiSilicon) */
case UINT32_C(0x4100D410): /* Cortex-A78 */
case UINT32_C(0x4100D0D0): /* Cortex-A77 */
case UINT32_C(0x4100D0E0): /* Cortex-A76AE */
case UINT32_C(0x4100D0B0): /* Cortex-A76 */
case UINT32_C(0x4100D0A0): /* Cortex-A75 */
case UINT32_C(0x4100D090): /* Cortex-A73 */
case UINT32_C(0x4100D080): /* Cortex-A72 */
#if CPUINFO_ARCH_ARM
case UINT32_C(0x4100C0F0): /* Cortex-A15 */
case UINT32_C(0x4100C0E0): /* Cortex-A17 */
case UINT32_C(0x4100C0D0): /* Rockchip RK3288 cores */
case UINT32_C(0x4100C0C0): /* Cortex-A12 */
#endif /* CPUINFO_ARCH_ARM */
/* These cores are always in big role */
return 5;
case UINT32_C(0x4100D070): /* Cortex-A57 */
/* Cortex-A57 can be in LITTLE role w.r.t. Denver 2, or in big role w.r.t. Cortex-A53 */
return 4;
#if CPUINFO_ARCH_ARM64
case UINT32_C(0x4100D060): /* Cortex-A65 */
#endif /* CPUINFO_ARCH_ARM64 */
case UINT32_C(0x4100D050): /* Cortex-A55 */
case UINT32_C(0x4100D030): /* Cortex-A53 */
/* Cortex-A53 is usually in LITTLE role, but can be in big role w.r.t. Cortex-A35 */
return 2;
case UINT32_C(0x4100D040): /* Cortex-A35 */
#if CPUINFO_ARCH_ARM
case UINT32_C(0x4100C070): /* Cortex-A7 */
#endif /* CPUINFO_ARCH_ARM */
case UINT32_C(0x51008050): /* Kryo 485 Silver */
case UINT32_C(0x51008030): /* Kryo 385 Silver */
case UINT32_C(0x51008010): /* Kryo 260 / 280 Silver */
case UINT32_C(0x51002110): /* Kryo Silver (Snapdragon 820) */
case UINT32_C(0x51002010): /* Kryo Silver (Snapdragon 821) */
/* These cores are always in LITTLE core */
return 1;
default:
/*
* Unknown cores, or cores which do not have big/LITTLE roles.
* To be future-proof w.r.t. cores not yet recognized in cpuinfo, assume position between
* Cortex-A57/A72/A73/A75 and Cortex-A53/A55. Then at least future cores paired with
* one of these known cores will be properly scored.
*/
return 3;
}
}
inline static uint32_t midr_little_core_for_big(uint32_t midr) {
const uint32_t core_mask =
CPUINFO_ARM_MIDR_IMPLEMENTER_MASK | CPUINFO_ARM_MIDR_ARCHITECTURE_MASK | CPUINFO_ARM_MIDR_PART_MASK;
switch (midr & core_mask) {
case CPUINFO_ARM_MIDR_CORTEX_A75:
return CPUINFO_ARM_MIDR_CORTEX_A55;
case CPUINFO_ARM_MIDR_CORTEX_A73:
case CPUINFO_ARM_MIDR_CORTEX_A72:
case CPUINFO_ARM_MIDR_CORTEX_A57:
case CPUINFO_ARM_MIDR_EXYNOS_M1_M2:
return CPUINFO_ARM_MIDR_CORTEX_A53;
case CPUINFO_ARM_MIDR_CORTEX_A17:
case CPUINFO_ARM_MIDR_CORTEX_A15:
return CPUINFO_ARM_MIDR_CORTEX_A7;
case CPUINFO_ARM_MIDR_KRYO280_GOLD:
return CPUINFO_ARM_MIDR_KRYO280_SILVER;
case CPUINFO_ARM_MIDR_KRYO_GOLD:
return CPUINFO_ARM_MIDR_KRYO_SILVER_820;
case CPUINFO_ARM_MIDR_DENVER2:
return CPUINFO_ARM_MIDR_CORTEX_A57;
default:
return midr;
}
}

133
3rdparty/cpuinfo/src/arm/tlb.c vendored Normal file
View File

@@ -0,0 +1,133 @@
switch (uarch) {
case cpuinfo_uarch_cortex_a5:
/*
* Cortex-A5 Technical Reference Manual:
* 6.3.1. Micro TLB
* The first level of caching for the page table information is a micro TLB of
* 10 entries that is implemented on each of the instruction and data sides.
* 6.3.2. Main TLB
* Misses from the instruction and data micro TLBs are handled by a unified main TLB.
* The main TLB is 128-entry two-way set-associative.
*/
break;
case cpuinfo_uarch_cortex_a7:
/*
* Cortex-A7 MPCore Technical Reference Manual:
* 5.3.1. Micro TLB
* The first level of caching for the page table information is a micro TLB of
* 10 entries that is implemented on each of the instruction and data sides.
* 5.3.2. Main TLB
* Misses from the micro TLBs are handled by a unified main TLB. This is a 256-entry 2-way
* set-associative structure. The main TLB supports all the VMSAv7 page sizes of
* 4KB, 64KB, 1MB and 16MB in addition to the LPAE page sizes of 2MB and 1G.
*/
break;
case cpuinfo_uarch_cortex_a8:
/*
* Cortex-A8 Technical Reference Manual:
* 6.1. About the MMU
* The MMU features include the following:
* - separate, fully-associative, 32-entry data and instruction TLBs
* - TLB entries that support 4KB, 64KB, 1MB, and 16MB pages
*/
break;
case cpuinfo_uarch_cortex_a9:
/*
* ARM CortexA9 Technical Reference Manual:
* 6.2.1 Micro TLB
* The first level of caching for the page table information is a micro TLB of 32 entries on the data side,
* and configurable 32 or 64 entries on the instruction side.
* 6.2.2 Main TLB
* The main TLB is implemented as a combination of:
* - A fully-associative, lockable array of four elements.
* - A 2-way associative structure of 2x32, 2x64, 2x128 or 2x256 entries.
*/
break;
case cpuinfo_uarch_cortex_a15:
/*
* ARM Cortex-A15 MPCore Processor Technical Reference Manual:
* 5.2.1. L1 instruction TLB
* The L1 instruction TLB is a 32-entry fully-associative structure. This TLB caches entries at the 4KB
* granularity of Virtual Address (VA) to Physical Address (PA) mapping only. If the page tables map the
* memory region to a larger granularity than 4K, it only allocates one mapping for the particular 4K region
* to which the current access corresponds.
* 5.2.2. L1 data TLB
* There are two separate 32-entry fully-associative TLBs that are used for data loads and stores,
* respectively. Similar to the L1 instruction TLB, both of these cache entries at the 4KB granularity of
* VA to PA mappings only. At implementation time, the Cortex-A15 MPCore processor can be configured with
* the -l1tlb_1m option, to have the L1 data TLB cache entries at both the 4KB and 1MB granularity.
* With this configuration, any translation that results in a 1MB or larger page is cached in the L1 data
* TLB as a 1MB entry. Any translation that results in a page smaller than 1MB is cached in the L1 data TLB
* as a 4KB entry. By default, all translations are cached in the L1 data TLB as a 4KB entry.
* 5.2.3. L2 TLB
* Misses from the L1 instruction and data TLBs are handled by a unified L2 TLB. This is a 512-entry 4-way
* set-associative structure. The L2 TLB supports all the VMSAv7 page sizes of 4K, 64K, 1MB and 16MB in
* addition to the LPAE page sizes of 2MB and 1GB.
*/
break;
case cpuinfo_uarch_cortex_a17:
/*
* ARM Cortex-A17 MPCore Processor Technical Reference Manual:
* 5.2.1. Instruction micro TLB
* The instruction micro TLB is implemented as a 32, 48 or 64 entry, fully-associative structure. This TLB
* caches entries at the 4KB and 1MB granularity of Virtual Address (VA) to Physical Address (PA) mapping
* only. If the translation tables map the memory region to a larger granularity than 4KB or 1MB, it only
* allocates one mapping for the particular 4KB region to which the current access corresponds.
* 5.2.2. Data micro TLB
* The data micro TLB is a 32 entry fully-associative TLB that is used for data loads and stores. The cache
* entries have a 4KB and 1MB granularity of VA to PA mappings only.
* 5.2.3. Unified main TLB
* Misses from the instruction and data micro TLBs are handled by a unified main TLB. This is a 1024 entry
* 4-way set-associative structure. The main TLB supports all the VMSAv7 page sizes of 4K, 64K, 1MB and 16MB
* in addition to the LPAE page sizes of 2MB and 1GB.
*/
break;
case cpuinfo_uarch_cortex_a35:
/*
* ARM CortexA35 Processor Technical Reference Manual:
* A6.2 TLB Organization
* Micro TLB
* The first level of caching for the translation table information is a micro TLB of ten entries that
* is implemented on each of the instruction and data sides.
* Main TLB
* A unified main TLB handles misses from the micro TLBs. It has a 512-entry, 2-way, set-associative
* structure and supports all VMSAv8 block sizes, except 1GB. If it fetches a 1GB block, the TLB splits
* it into 512MB blocks and stores the appropriate block for the lookup.
*/
break;
case cpuinfo_uarch_cortex_a53:
/*
* ARM Cortex-A53 MPCore Processor Technical Reference Manual:
* 5.2.1. Micro TLB
* The first level of caching for the translation table information is a micro TLB of ten entries that is
* implemented on each of the instruction and data sides.
* 5.2.2. Main TLB
* A unified main TLB handles misses from the micro TLBs. This is a 512-entry, 4-way, set-associative
* structure. The main TLB supports all VMSAv8 block sizes, except 1GB. If a 1GB block is fetched, it is
* split into 512MB blocks and the appropriate block for the lookup stored.
*/
break;
case cpuinfo_uarch_cortex_a57:
/*
* ARM® Cortex-A57 MPCore Processor Technical Reference Manual:
* 5.2.1 L1 instruction TLB
* The L1 instruction TLB is a 48-entry fully-associative structure. This TLB caches entries of three
* different page sizes, natively 4KB, 64KB, and 1MB, of VA to PA mappings. If the page tables map the memory
* region to a larger granularity than 1MB, it only allocates one mapping for the particular 1MB region to
* which the current access corresponds.
* 5.2.2 L1 data TLB
* The L1 data TLB is a 32-entry fully-associative TLB that is used for data loads and stores. This TLB
* caches entries of three different page sizes, natively 4KB, 64KB, and 1MB, of VA to PA mappings.
* 5.2.3 L2 TLB
* Misses from the L1 instruction and data TLBs are handled by a unified L2 TLB. This is a 1024-entry 4-way
* set-associative structure. The L2 TLB supports the page sizes of 4K, 64K, 1MB and 16MB. It also supports
* page sizes of 2MB and 1GB for the long descriptor format translation in AArch32 state and in AArch64 state
* when using the 4KB translation granule. In addition, the L2 TLB supports the 512MB page map size defined
* for the AArch64 translations that use a 64KB translation granule.
*/
break;
}

362
3rdparty/cpuinfo/src/arm/uarch.c vendored Normal file
View File

@@ -0,0 +1,362 @@
#include <stdint.h>
#include <arm/api.h>
#include <arm/midr.h>
#include <cpuinfo/log.h>
void cpuinfo_arm_decode_vendor_uarch(
uint32_t midr,
#if CPUINFO_ARCH_ARM
bool has_vfpv4,
#endif /* CPUINFO_ARCH_ARM */
enum cpuinfo_vendor vendor[restrict static 1],
enum cpuinfo_uarch uarch[restrict static 1])
{
switch (midr_get_implementer(midr)) {
case 'A':
*vendor = cpuinfo_vendor_arm;
switch (midr_get_part(midr)) {
#if CPUINFO_ARCH_ARM
case 0xC05:
*uarch = cpuinfo_uarch_cortex_a5;
break;
case 0xC07:
*uarch = cpuinfo_uarch_cortex_a7;
break;
case 0xC08:
*uarch = cpuinfo_uarch_cortex_a8;
break;
case 0xC09:
*uarch = cpuinfo_uarch_cortex_a9;
break;
case 0xC0C:
*uarch = cpuinfo_uarch_cortex_a12;
break;
case 0xC0E:
*uarch = cpuinfo_uarch_cortex_a17;
break;
case 0xC0D:
/*
* Rockchip RK3288 only.
* Core information is ambiguous: some sources specify Cortex-A12, others - Cortex-A17.
* Assume it is Cortex-A12.
*/
*uarch = cpuinfo_uarch_cortex_a12;
break;
case 0xC0F:
*uarch = cpuinfo_uarch_cortex_a15;
break;
#endif /* CPUINFO_ARCH_ARM */
case 0xD01:
*uarch = cpuinfo_uarch_cortex_a32;
break;
case 0xD03:
*uarch = cpuinfo_uarch_cortex_a53;
break;
case 0xD04:
*uarch = cpuinfo_uarch_cortex_a35;
break;
case 0xD05:
// Note: use Variant, not Revision, field
*uarch = (midr & CPUINFO_ARM_MIDR_VARIANT_MASK) == 0 ?
cpuinfo_uarch_cortex_a55r0 : cpuinfo_uarch_cortex_a55;
break;
case 0xD06:
*uarch = cpuinfo_uarch_cortex_a65;
break;
case 0xD07:
*uarch = cpuinfo_uarch_cortex_a57;
break;
case 0xD08:
*uarch = cpuinfo_uarch_cortex_a72;
break;
case 0xD09:
*uarch = cpuinfo_uarch_cortex_a73;
break;
case 0xD0A:
*uarch = cpuinfo_uarch_cortex_a75;
break;
case 0xD0B:
*uarch = cpuinfo_uarch_cortex_a76;
break;
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 0xD0C:
*uarch = cpuinfo_uarch_neoverse_n1;
break;
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
case 0xD0D:
*uarch = cpuinfo_uarch_cortex_a77;
break;
case 0xD0E: /* Cortex-A76AE */
*uarch = cpuinfo_uarch_cortex_a76;
break;
case 0xD41: /* Cortex-A78 */
*uarch = cpuinfo_uarch_cortex_a78;
break;
case 0xD44: /* Cortex-X1 */
*uarch = cpuinfo_uarch_cortex_x1;
break;
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 0xD4A:
*uarch = cpuinfo_uarch_neoverse_e1;
break;
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
default:
switch (midr_get_part(midr) >> 8) {
#if CPUINFO_ARCH_ARM
case 7:
*uarch = cpuinfo_uarch_arm7;
break;
case 9:
*uarch = cpuinfo_uarch_arm9;
break;
case 11:
*uarch = cpuinfo_uarch_arm11;
break;
#endif /* CPUINFO_ARCH_ARM */
default:
cpuinfo_log_warning("unknown ARM CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
}
break;
case 'B':
*vendor = cpuinfo_vendor_broadcom;
switch (midr_get_part(midr)) {
case 0x00F:
*uarch = cpuinfo_uarch_brahma_b15;
break;
case 0x100:
*uarch = cpuinfo_uarch_brahma_b53;
break;
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 0x516:
/* Broadcom Vulkan was sold to Cavium before it reached the market, so we identify it as Cavium ThunderX2 */
*vendor = cpuinfo_vendor_cavium;
*uarch = cpuinfo_uarch_thunderx2;
break;
#endif
default:
cpuinfo_log_warning("unknown Broadcom CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 'C':
*vendor = cpuinfo_vendor_cavium;
switch (midr_get_part(midr)) {
case 0x0A0: /* ThunderX */
case 0x0A1: /* ThunderX 88XX */
case 0x0A2: /* ThunderX 81XX */
case 0x0A3: /* ThunderX 83XX */
*uarch = cpuinfo_uarch_thunderx;
break;
case 0x0AF: /* ThunderX2 99XX */
*uarch = cpuinfo_uarch_thunderx2;
break;
default:
cpuinfo_log_warning("unknown Cavium CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#endif
case 'H':
*vendor = cpuinfo_vendor_huawei;
switch (midr_get_part(midr)) {
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 0xD01: /* Kunpeng 920 series */
*uarch = cpuinfo_uarch_taishan_v110;
break;
#endif
case 0xD40: /* Kirin 980 Big/Medium cores -> Cortex-A76 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a76;
break;
default:
cpuinfo_log_warning("unknown Huawei CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#if CPUINFO_ARCH_ARM
case 'i':
*vendor = cpuinfo_vendor_intel;
switch (midr_get_part(midr) >> 8) {
case 2: /* PXA 210/25X/26X */
case 4: /* PXA 27X */
case 6: /* PXA 3XX */
*uarch = cpuinfo_uarch_xscale;
break;
default:
cpuinfo_log_warning("unknown Intel CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#endif /* CPUINFO_ARCH_ARM */
case 'N':
*vendor = cpuinfo_vendor_nvidia;
switch (midr_get_part(midr)) {
case 0x000:
*uarch = cpuinfo_uarch_denver;
break;
case 0x003:
*uarch = cpuinfo_uarch_denver2;
break;
case 0x004:
*uarch = cpuinfo_uarch_carmel;
break;
default:
cpuinfo_log_warning("unknown Nvidia CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#if !defined(__ANDROID__)
case 'P':
*vendor = cpuinfo_vendor_apm;
switch (midr_get_part(midr)) {
case 0x000:
*uarch = cpuinfo_uarch_xgene;
break;
default:
cpuinfo_log_warning("unknown Applied Micro CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#endif
case 'Q':
*vendor = cpuinfo_vendor_qualcomm;
switch (midr_get_part(midr)) {
#if CPUINFO_ARCH_ARM
case 0x00F:
/* Mostly Scorpions, but some Cortex A5 may report this value as well */
if (has_vfpv4) {
/* Unlike Scorpion, Cortex-A5 comes with VFPv4 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a5;
} else {
*uarch = cpuinfo_uarch_scorpion;
}
break;
case 0x02D: /* Dual-core Scorpions */
*uarch = cpuinfo_uarch_scorpion;
break;
case 0x04D:
/*
* Dual-core Krait:
* - r1p0 -> Krait 200
* - r1p4 -> Krait 200
* - r2p0 -> Krait 300
*/
case 0x06F:
/*
* Quad-core Krait:
* - r0p1 -> Krait 200
* - r0p2 -> Krait 200
* - r1p0 -> Krait 300
* - r2p0 -> Krait 400 (Snapdragon 800 MSMxxxx)
* - r2p1 -> Krait 400 (Snapdragon 801 MSMxxxxPRO)
* - r3p1 -> Krait 450
*/
*uarch = cpuinfo_uarch_krait;
break;
#endif /* CPUINFO_ARCH_ARM */
case 0x201: /* Qualcomm Snapdragon 821: Low-power Kryo "Silver" */
case 0x205: /* Qualcomm Snapdragon 820 & 821: High-performance Kryo "Gold" */
case 0x211: /* Qualcomm Snapdragon 820: Low-power Kryo "Silver" */
*uarch = cpuinfo_uarch_kryo;
break;
case 0x800: /* High-performance Kryo 260 (r10p2) / Kryo 280 (r10p1) "Gold" -> Cortex-A73 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a73;
break;
case 0x801: /* Low-power Kryo 260 / 280 "Silver" -> Cortex-A53 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a53;
break;
case 0x802: /* High-performance Kryo 385 "Gold" -> Cortex-A75 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a75;
break;
case 0x803: /* Low-power Kryo 385 "Silver" -> Cortex-A55r0 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a55r0;
break;
case 0x804: /* High-performance Kryo 485 "Gold" / "Gold Prime" -> Cortex-A76 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a76;
break;
case 0x805: /* Low-performance Kryo 485 "Silver" -> Cortex-A55 */
*vendor = cpuinfo_vendor_arm;
*uarch = cpuinfo_uarch_cortex_a55;
break;
#if CPUINFO_ARCH_ARM64 && !defined(__ANDROID__)
case 0xC00:
*uarch = cpuinfo_uarch_falkor;
break;
case 0xC01:
*uarch = cpuinfo_uarch_saphira;
break;
#endif /* CPUINFO_ARCH_ARM64 && !defined(__ANDROID__) */
default:
cpuinfo_log_warning("unknown Qualcomm CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
case 'S':
*vendor = cpuinfo_vendor_samsung;
switch (midr & (CPUINFO_ARM_MIDR_VARIANT_MASK | CPUINFO_ARM_MIDR_PART_MASK)) {
case 0x00100010:
/*
* Exynos 8890 MIDR = 0x531F0011, assume Exynos M1 has:
* - CPU variant 0x1
* - CPU part 0x001
*/
*uarch = cpuinfo_uarch_exynos_m1;
break;
case 0x00400010:
/*
* Exynos 8895 MIDR = 0x534F0010, assume Exynos M2 has:
* - CPU variant 0x4
* - CPU part 0x001
*/
*uarch = cpuinfo_uarch_exynos_m2;
break;
case 0x00100020:
/*
* Exynos 9810 MIDR = 0x531F0020, assume Exynos M3 has:
* - CPU variant 0x1
* - CPU part 0x002
*/
*uarch = cpuinfo_uarch_exynos_m3;
break;
case 0x00100030:
/*
* Exynos 9820 MIDR = 0x531F0030, assume Exynos M4 has:
* - CPU variant 0x1
* - CPU part 0x003
*/
*uarch = cpuinfo_uarch_exynos_m4;
break;
case 0x00100040:
/*
* Exynos 9820 MIDR = 0x531F0040, assume Exynos M5 has:
* - CPU variant 0x1
* - CPU part 0x004
*/
*uarch = cpuinfo_uarch_exynos_m5;
break;
default:
cpuinfo_log_warning("unknown Samsung CPU variant 0x%01"PRIx32" part 0x%03"PRIx32" ignored",
midr_get_variant(midr), midr_get_part(midr));
}
break;
#if CPUINFO_ARCH_ARM
case 'V':
*vendor = cpuinfo_vendor_marvell;
switch (midr_get_part(midr)) {
case 0x581: /* PJ4 / PJ4B */
case 0x584: /* PJ4B-MP / PJ4C */
*uarch = cpuinfo_uarch_pj4;
break;
default:
cpuinfo_log_warning("unknown Marvell CPU part 0x%03"PRIx32" ignored", midr_get_part(midr));
}
break;
#endif /* CPUINFO_ARCH_ARM */
default:
cpuinfo_log_warning("unknown CPU implementer '%c' (0x%02"PRIx32") with CPU part 0x%03"PRIx32" ignored",
(char) midr_get_implementer(midr), midr_get_implementer(midr), midr_get_part(midr));
}
}

18
3rdparty/cpuinfo/src/cache.c vendored Normal file
View File

@@ -0,0 +1,18 @@
#include <stddef.h>
#include <cpuinfo.h>
#include <cpuinfo/internal-api.h>
uint32_t cpuinfo_compute_max_cache_size(const struct cpuinfo_processor* processor) {
if (processor->cache.l4 != NULL) {
return processor->cache.l4->size;
} else if (processor->cache.l3 != NULL) {
return processor->cache.l3->size;
} else if (processor->cache.l2 != NULL) {
return processor->cache.l2->size;
} else if (processor->cache.l1d != NULL) {
return processor->cache.l1d->size;
}
return 0;
}

40
3rdparty/cpuinfo/src/cpuinfo/common.h vendored Normal file
View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#define CPUINFO_COUNT_OF(array) (sizeof(array) / sizeof(0[array]))
#if defined(__GNUC__)
#define CPUINFO_LIKELY(condition) (__builtin_expect(!!(condition), 1))
#define CPUINFO_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
#else
#define CPUINFO_LIKELY(condition) (!!(condition))
#define CPUINFO_UNLIKELY(condition) (!!(condition))
#endif
#ifndef CPUINFO_INTERNAL
#if defined(__ELF__)
#define CPUINFO_INTERNAL __attribute__((__visibility__("internal")))
#elif defined(__MACH__)
#define CPUINFO_INTERNAL __attribute__((__visibility__("hidden")))
#else
#define CPUINFO_INTERNAL
#endif
#endif
#ifndef CPUINFO_PRIVATE
#if defined(__ELF__)
#define CPUINFO_PRIVATE __attribute__((__visibility__("hidden")))
#elif defined(__MACH__)
#define CPUINFO_PRIVATE __attribute__((__visibility__("hidden")))
#else
#define CPUINFO_PRIVATE
#endif
#endif

View File

@@ -0,0 +1,62 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
#endif
#include <cpuinfo.h>
#include <cpuinfo/common.h>
enum cpuinfo_cache_level {
cpuinfo_cache_level_1i = 0,
cpuinfo_cache_level_1d = 1,
cpuinfo_cache_level_2 = 2,
cpuinfo_cache_level_3 = 3,
cpuinfo_cache_level_4 = 4,
cpuinfo_cache_level_max = 5,
};
extern CPUINFO_INTERNAL bool cpuinfo_is_initialized;
extern CPUINFO_INTERNAL struct cpuinfo_processor* cpuinfo_processors;
extern CPUINFO_INTERNAL struct cpuinfo_core* cpuinfo_cores;
extern CPUINFO_INTERNAL struct cpuinfo_cluster* cpuinfo_clusters;
extern CPUINFO_INTERNAL struct cpuinfo_package* cpuinfo_packages;
extern CPUINFO_INTERNAL struct cpuinfo_cache* cpuinfo_cache[cpuinfo_cache_level_max];
extern CPUINFO_INTERNAL uint32_t cpuinfo_processors_count;
extern CPUINFO_INTERNAL uint32_t cpuinfo_cores_count;
extern CPUINFO_INTERNAL uint32_t cpuinfo_clusters_count;
extern CPUINFO_INTERNAL uint32_t cpuinfo_packages_count;
extern CPUINFO_INTERNAL uint32_t cpuinfo_cache_count[cpuinfo_cache_level_max];
extern CPUINFO_INTERNAL uint32_t cpuinfo_max_cache_size;
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
extern CPUINFO_INTERNAL struct cpuinfo_uarch_info* cpuinfo_uarchs;
extern CPUINFO_INTERNAL uint32_t cpuinfo_uarchs_count;
#else
extern CPUINFO_INTERNAL struct cpuinfo_uarch_info cpuinfo_global_uarch;
#endif
#ifdef __linux__
extern CPUINFO_INTERNAL uint32_t cpuinfo_linux_cpu_max;
extern CPUINFO_INTERNAL const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map;
extern CPUINFO_INTERNAL const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map;
#endif
CPUINFO_PRIVATE void cpuinfo_x86_mach_init(void);
CPUINFO_PRIVATE void cpuinfo_x86_linux_init(void);
#if defined(_WIN32) || defined(__CYGWIN__)
CPUINFO_PRIVATE BOOL CALLBACK cpuinfo_x86_windows_init(PINIT_ONCE init_once, PVOID parameter, PVOID* context);
#endif
CPUINFO_PRIVATE void cpuinfo_arm_mach_init(void);
CPUINFO_PRIVATE void cpuinfo_arm_linux_init(void);
CPUINFO_PRIVATE void cpuinfo_emscripten_init(void);
CPUINFO_PRIVATE uint32_t cpuinfo_compute_max_cache_size(const struct cpuinfo_processor* processor);
typedef void (*cpuinfo_processor_callback)(uint32_t);

17
3rdparty/cpuinfo/src/cpuinfo/log.h vendored Normal file
View File

@@ -0,0 +1,17 @@
#pragma once
#include <inttypes.h>
#include <clog.h>
#define CPUINFO_LOG_DEBUG_PARSERS 0
#ifndef CPUINFO_LOG_LEVEL
#define CPUINFO_LOG_LEVEL CLOG_ERROR
#endif
CLOG_DEFINE_LOG_DEBUG(cpuinfo_log_debug, "cpuinfo", CPUINFO_LOG_LEVEL);
CLOG_DEFINE_LOG_INFO(cpuinfo_log_info, "cpuinfo", CPUINFO_LOG_LEVEL);
CLOG_DEFINE_LOG_WARNING(cpuinfo_log_warning, "cpuinfo", CPUINFO_LOG_LEVEL);
CLOG_DEFINE_LOG_ERROR(cpuinfo_log_error, "cpuinfo", CPUINFO_LOG_LEVEL);
CLOG_DEFINE_LOG_FATAL(cpuinfo_log_fatal, "cpuinfo", CPUINFO_LOG_LEVEL);

19
3rdparty/cpuinfo/src/cpuinfo/utils.h vendored Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <stdint.h>
inline static uint32_t bit_length(uint32_t n) {
const uint32_t n_minus_1 = n - 1;
if (n_minus_1 == 0) {
return 0;
} else {
#ifdef _MSC_VER
unsigned long bsr;
_BitScanReverse(&bsr, n_minus_1);
return bsr + 1;
#else
return 32 - __builtin_clz(n_minus_1);
#endif
}
}

277
3rdparty/cpuinfo/src/emscripten/init.c vendored Normal file
View File

@@ -0,0 +1,277 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <emscripten/threading.h>
#include <cpuinfo.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
static const volatile float infinity = INFINITY;
static struct cpuinfo_package static_package = { };
static struct cpuinfo_cache static_x86_l3 = {
.size = 2 * 1024 * 1024,
.associativity = 16,
.sets = 2048,
.partitions = 1,
.line_size = 64,
};
void cpuinfo_emscripten_init(void) {
struct cpuinfo_processor* processors = NULL;
struct cpuinfo_core* cores = NULL;
struct cpuinfo_cluster* clusters = NULL;
struct cpuinfo_cache* l1i = NULL;
struct cpuinfo_cache* l1d = NULL;
struct cpuinfo_cache* l2 = NULL;
const bool is_x86 = signbit(infinity - infinity);
int logical_cores_count = emscripten_num_logical_cores();
if (logical_cores_count <= 0) {
logical_cores_count = 1;
}
uint32_t processor_count = (uint32_t) logical_cores_count;
uint32_t core_count = processor_count;
uint32_t cluster_count = 1;
uint32_t big_cluster_core_count = core_count;
uint32_t processors_per_core = 1;
if (is_x86) {
if (processor_count % 2 == 0) {
processors_per_core = 2;
core_count = processor_count / 2;
big_cluster_core_count = core_count;
}
} else {
/* Assume ARM/ARM64 */
if (processor_count > 4) {
/* Assume big.LITTLE architecture */
cluster_count = 2;
big_cluster_core_count = processor_count >= 8 ? 4 : 2;
}
}
uint32_t l2_count = is_x86 ? core_count : cluster_count;
processors = calloc(processor_count, sizeof(struct cpuinfo_processor));
if (processors == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" logical processors",
processor_count * sizeof(struct cpuinfo_processor), processor_count);
goto cleanup;
}
cores = calloc(processor_count, sizeof(struct cpuinfo_core));
if (cores == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" cores",
processor_count * sizeof(struct cpuinfo_core), processor_count);
goto cleanup;
}
clusters = calloc(cluster_count, sizeof(struct cpuinfo_cluster));
if (clusters == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" clusters",
cluster_count * sizeof(struct cpuinfo_cluster), cluster_count);
goto cleanup;
}
l1i = calloc(core_count, sizeof(struct cpuinfo_cache));
if (l1i == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1I caches",
core_count * sizeof(struct cpuinfo_cache), core_count);
goto cleanup;
}
l1d = calloc(core_count, sizeof(struct cpuinfo_cache));
if (l1d == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L1D caches",
core_count * sizeof(struct cpuinfo_cache), core_count);
goto cleanup;
}
l2 = calloc(l2_count, sizeof(struct cpuinfo_cache));
if (l2 == NULL) {
cpuinfo_log_error("failed to allocate %zu bytes for descriptions of %"PRIu32" L2 caches",
l2_count * sizeof(struct cpuinfo_cache), l2_count);
goto cleanup;
}
static_package.processor_count = processor_count;
static_package.core_count = core_count;
static_package.cluster_count = cluster_count;
if (is_x86) {
strncpy(static_package.name, "x86 vCPU", CPUINFO_PACKAGE_NAME_MAX);
} else {
strncpy(static_package.name, "ARM vCPU", CPUINFO_PACKAGE_NAME_MAX);
}
for (uint32_t i = 0; i < core_count; i++) {
for (uint32_t j = 0; j < processors_per_core; j++) {
processors[i * processors_per_core + j] = (struct cpuinfo_processor) {
.smt_id = j,
.core = cores + i,
.cluster = clusters + (uint32_t) (i >= big_cluster_core_count),
.package = &static_package,
.cache.l1i = l1i + i,
.cache.l1d = l1d + i,
.cache.l2 = is_x86 ? l2 + i : l2 + (uint32_t) (i >= big_cluster_core_count),
.cache.l3 = is_x86 ? &static_x86_l3 : NULL,
};
}
cores[i] = (struct cpuinfo_core) {
.processor_start = i * processors_per_core,
.processor_count = processors_per_core,
.core_id = i,
.cluster = clusters + (uint32_t) (i >= big_cluster_core_count),
.package = &static_package,
.vendor = cpuinfo_vendor_unknown,
.uarch = cpuinfo_uarch_unknown,
.frequency = 0,
};
l1i[i] = (struct cpuinfo_cache) {
.size = 32 * 1024,
.associativity = 4,
.sets = 128,
.partitions = 1,
.line_size = 64,
.processor_start = i * processors_per_core,
.processor_count = processors_per_core,
};
l1d[i] = (struct cpuinfo_cache) {
.size = 32 * 1024,
.associativity = 4,
.sets = 128,
.partitions = 1,
.line_size = 64,
.processor_start = i * processors_per_core,
.processor_count = processors_per_core,
};
if (is_x86) {
l2[i] = (struct cpuinfo_cache) {
.size = 256 * 1024,
.associativity = 8,
.sets = 512,
.partitions = 1,
.line_size = 64,
.processor_start = i * processors_per_core,
.processor_count = processors_per_core,
};
}
}
if (is_x86) {
clusters[0] = (struct cpuinfo_cluster) {
.processor_start = 0,
.processor_count = processor_count,
.core_start = 0,
.core_count = core_count,
.cluster_id = 0,
.package = &static_package,
.vendor = cpuinfo_vendor_unknown,
.uarch = cpuinfo_uarch_unknown,
.frequency = 0,
};
static_x86_l3.processor_count = processor_count;
} else {
clusters[0] = (struct cpuinfo_cluster) {
.processor_start = 0,
.processor_count = big_cluster_core_count,
.core_start = 0,
.core_count = big_cluster_core_count,
.cluster_id = 0,
.package = &static_package,
.vendor = cpuinfo_vendor_unknown,
.uarch = cpuinfo_uarch_unknown,
.frequency = 0,
};
l2[0] = (struct cpuinfo_cache) {
.size = 1024 * 1024,
.associativity = 8,
.sets = 2048,
.partitions = 1,
.line_size = 64,
.processor_start = 0,
.processor_count = big_cluster_core_count,
};
if (cluster_count > 1) {
l2[1] = (struct cpuinfo_cache) {
.size = 256 * 1024,
.associativity = 8,
.sets = 512,
.partitions = 1,
.line_size = 64,
.processor_start = big_cluster_core_count,
.processor_count = processor_count - big_cluster_core_count,
};
clusters[1] = (struct cpuinfo_cluster) {
.processor_start = big_cluster_core_count,
.processor_count = processor_count - big_cluster_core_count,
.core_start = big_cluster_core_count,
.core_count = processor_count - big_cluster_core_count,
.cluster_id = 1,
.package = &static_package,
.vendor = cpuinfo_vendor_unknown,
.uarch = cpuinfo_uarch_unknown,
.frequency = 0,
};
}
}
/* Commit changes */
cpuinfo_cache[cpuinfo_cache_level_1i] = l1i;
cpuinfo_cache[cpuinfo_cache_level_1d] = l1d;
cpuinfo_cache[cpuinfo_cache_level_2] = l2;
if (is_x86) {
cpuinfo_cache[cpuinfo_cache_level_3] = &static_x86_l3;
}
cpuinfo_processors = processors;
cpuinfo_cores = cores;
cpuinfo_clusters = clusters;
cpuinfo_packages = &static_package;
cpuinfo_cache_count[cpuinfo_cache_level_1i] = processor_count;
cpuinfo_cache_count[cpuinfo_cache_level_1d] = processor_count;
cpuinfo_cache_count[cpuinfo_cache_level_2] = l2_count;
if (is_x86) {
cpuinfo_cache_count[cpuinfo_cache_level_3] = 1;
}
cpuinfo_global_uarch = (struct cpuinfo_uarch_info) {
.uarch = cpuinfo_uarch_unknown,
.processor_count = processor_count,
.core_count = core_count,
};
cpuinfo_processors_count = processor_count;
cpuinfo_cores_count = processor_count;
cpuinfo_clusters_count = cluster_count;
cpuinfo_packages_count = 1;
cpuinfo_max_cache_size = is_x86 ? 128 * 1024 * 1024 : 8 * 1024 * 1024;
cpuinfo_is_initialized = true;
processors = NULL;
cores = NULL;
clusters = NULL;
l1i = l1d = l2 = NULL;
cleanup:
free(processors);
free(cores);
free(clusters);
free(l1i);
free(l1d);
free(l2);
}

59
3rdparty/cpuinfo/src/init.c vendored Normal file
View File

@@ -0,0 +1,59 @@
#if defined(_WIN32) || defined(__CYGWIN__)
#include <windows.h>
#elif !defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__)
#include <pthread.h>
#endif
#include <cpuinfo.h>
#include <cpuinfo/internal-api.h>
#include <cpuinfo/log.h>
#ifdef __APPLE__
#include "TargetConditionals.h"
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
static INIT_ONCE init_guard = INIT_ONCE_STATIC_INIT;
#elif !defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__)
static pthread_once_t init_guard = PTHREAD_ONCE_INIT;
#else
static bool init_guard = false;
#endif
bool CPUINFO_ABI cpuinfo_initialize(void) {
#if CPUINFO_ARCH_X86 || CPUINFO_ARCH_X86_64
#if defined(__MACH__) && defined(__APPLE__)
pthread_once(&init_guard, &cpuinfo_x86_mach_init);
#elif defined(__linux__)
pthread_once(&init_guard, &cpuinfo_x86_linux_init);
#elif defined(_WIN32) || defined(__CYGWIN__)
InitOnceExecuteOnce(&init_guard, &cpuinfo_x86_windows_init, NULL, NULL);
#else
cpuinfo_log_error("operating system is not supported in cpuinfo");
#endif
#elif CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
#if defined(__linux__)
pthread_once(&init_guard, &cpuinfo_arm_linux_init);
#elif defined(__MACH__) && defined(__APPLE__)
pthread_once(&init_guard, &cpuinfo_arm_mach_init);
#else
cpuinfo_log_error("operating system is not supported in cpuinfo");
#endif
#elif CPUINFO_ARCH_ASMJS || CPUINFO_ARCH_WASM || CPUINFO_ARCH_WASMSIMD
#if defined(__EMSCRIPTEN_PTHREADS__)
pthread_once(&init_guard, &cpuinfo_emscripten_init);
#else
if (!init_guard) {
cpuinfo_emscripten_init();
}
init_guard = true;
#endif
#else
cpuinfo_log_error("processor architecture is not supported in cpuinfo");
#endif
return cpuinfo_is_initialized;
}
void CPUINFO_ABI cpuinfo_deinitialize(void) {
}

59
3rdparty/cpuinfo/src/linux/api.h vendored Normal file
View File

@@ -0,0 +1,59 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <cpuinfo.h>
#include <cpuinfo/common.h>
#define CPUINFO_LINUX_FLAG_PRESENT UINT32_C(0x00000001)
#define CPUINFO_LINUX_FLAG_POSSIBLE UINT32_C(0x00000002)
#define CPUINFO_LINUX_FLAG_MAX_FREQUENCY UINT32_C(0x00000004)
#define CPUINFO_LINUX_FLAG_MIN_FREQUENCY UINT32_C(0x00000008)
#define CPUINFO_LINUX_FLAG_SMT_ID UINT32_C(0x00000010)
#define CPUINFO_LINUX_FLAG_CORE_ID UINT32_C(0x00000020)
#define CPUINFO_LINUX_FLAG_PACKAGE_ID UINT32_C(0x00000040)
#define CPUINFO_LINUX_FLAG_APIC_ID UINT32_C(0x00000080)
#define CPUINFO_LINUX_FLAG_SMT_CLUSTER UINT32_C(0x00000100)
#define CPUINFO_LINUX_FLAG_CORE_CLUSTER UINT32_C(0x00000200)
#define CPUINFO_LINUX_FLAG_PACKAGE_CLUSTER UINT32_C(0x00000400)
#define CPUINFO_LINUX_FLAG_PROC_CPUINFO UINT32_C(0x00000800)
#define CPUINFO_LINUX_FLAG_VALID UINT32_C(0x00001000)
typedef bool (*cpuinfo_cpulist_callback)(uint32_t, uint32_t, void*);
CPUINFO_INTERNAL bool cpuinfo_linux_parse_cpulist(const char* filename, cpuinfo_cpulist_callback callback, void* context);
typedef bool (*cpuinfo_smallfile_callback)(const char*, const char*, void*);
CPUINFO_INTERNAL bool cpuinfo_linux_parse_small_file(const char* filename, size_t buffer_size, cpuinfo_smallfile_callback, void* context);
typedef bool (*cpuinfo_line_callback)(const char*, const char*, void*, uint64_t);
CPUINFO_INTERNAL bool cpuinfo_linux_parse_multiline_file(const char* filename, size_t buffer_size, cpuinfo_line_callback, void* context);
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_processors_count(void);
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_possible_processor(uint32_t max_processors_count);
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_max_present_processor(uint32_t max_processors_count);
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_processor_min_frequency(uint32_t processor);
CPUINFO_INTERNAL uint32_t cpuinfo_linux_get_processor_max_frequency(uint32_t processor);
CPUINFO_INTERNAL bool cpuinfo_linux_get_processor_package_id(uint32_t processor, uint32_t package_id[restrict static 1]);
CPUINFO_INTERNAL bool cpuinfo_linux_get_processor_core_id(uint32_t processor, uint32_t core_id[restrict static 1]);
CPUINFO_INTERNAL bool cpuinfo_linux_detect_possible_processors(uint32_t max_processors_count,
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t possible_flag);
CPUINFO_INTERNAL bool cpuinfo_linux_detect_present_processors(uint32_t max_processors_count,
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t present_flag);
typedef bool (*cpuinfo_siblings_callback)(uint32_t, uint32_t, uint32_t, void*);
CPUINFO_INTERNAL bool cpuinfo_linux_detect_core_siblings(
uint32_t max_processors_count,
uint32_t processor,
cpuinfo_siblings_callback callback,
void* context);
CPUINFO_INTERNAL bool cpuinfo_linux_detect_thread_siblings(
uint32_t max_processors_count,
uint32_t processor,
cpuinfo_siblings_callback callback,
void* context);
extern CPUINFO_INTERNAL const struct cpuinfo_processor** cpuinfo_linux_cpu_to_processor_map;
extern CPUINFO_INTERNAL const struct cpuinfo_core** cpuinfo_linux_cpu_to_core_map;

214
3rdparty/cpuinfo/src/linux/cpulist.c vendored Normal file
View File

@@ -0,0 +1,214 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
#endif
#include <linux/api.h>
#include <cpuinfo/log.h>
/*
* Size, in chars, of the on-stack buffer used for parsing cpu lists.
* This is also the limit on the length of a single entry
* (<cpu-number> or <cpu-number-start>-<cpu-number-end>)
* in the cpu list.
*/
#define BUFFER_SIZE 256
/* Locale-independent */
inline static bool is_whitespace(char c) {
switch (c) {
case ' ':
case '\t':
case '\n':
case '\r':
return true;
default:
return false;
}
}
inline static const char* parse_number(const char* string, const char* end, uint32_t number_ptr[restrict static 1]) {
uint32_t number = 0;
while (string != end) {
const uint32_t digit = (uint32_t) (*string) - (uint32_t) '0';
if (digit >= 10) {
break;
}
number = number * UINT32_C(10) + digit;
string += 1;
}
*number_ptr = number;
return string;
}
inline static bool parse_entry(const char* entry_start, const char* entry_end, cpuinfo_cpulist_callback callback, void* context) {
/* Skip whitespace at the beginning of an entry */
for (; entry_start != entry_end; entry_start++) {
if (!is_whitespace(*entry_start)) {
break;
}
}
/* Skip whitespace at the end of an entry */
for (; entry_end != entry_start; entry_end--) {
if (!is_whitespace(entry_end[-1])) {
break;
}
}
const size_t entry_length = (size_t) (entry_end - entry_start);
if (entry_length == 0) {
cpuinfo_log_warning("unexpected zero-length cpu list entry ignored");
return false;
}
#if CPUINFO_LOG_DEBUG_PARSERS
cpuinfo_log_debug("parse cpu list entry \"%.*s\" (%zu chars)", (int) entry_length, entry_start, entry_length);
#endif
uint32_t first_cpu, last_cpu;
const char* number_end = parse_number(entry_start, entry_end, &first_cpu);
if (number_end == entry_start) {
/* Failed to parse the number; ignore the entry */
cpuinfo_log_warning("invalid character '%c' in the cpu list entry \"%.*s\": entry is ignored",
entry_start[0], (int) entry_length, entry_start);
return false;
} else if (number_end == entry_end) {
/* Completely parsed the entry */
#if CPUINFO_LOG_DEBUG_PARSERS
cpuinfo_log_debug("cpulist: call callback with list_start = %"PRIu32", list_end = %"PRIu32,
first_cpu, first_cpu + 1);
#endif
return callback(first_cpu, first_cpu + 1, context);
}
/* Parse the second part of the entry */
if (*number_end != '-') {
cpuinfo_log_warning("invalid character '%c' in the cpu list entry \"%.*s\": entry is ignored",
*number_end, (int) entry_length, entry_start);
return false;
}
const char* number_start = number_end + 1;
number_end = parse_number(number_start, entry_end, &last_cpu);
if (number_end == number_start) {
/* Failed to parse the second number; ignore the entry */
cpuinfo_log_warning("invalid character '%c' in the cpu list entry \"%.*s\": entry is ignored",
*number_start, (int) entry_length, entry_start);
return false;
}
if (number_end != entry_end) {
/* Partially parsed the entry; ignore unparsed characters and continue with the parsed part */
cpuinfo_log_warning("ignored invalid characters \"%.*s\" at the end of cpu list entry \"%.*s\"",
(int) (entry_end - number_end), number_start, (int) entry_length, entry_start);
}
if (last_cpu < first_cpu) {
cpuinfo_log_warning("ignored cpu list entry \"%.*s\": invalid range %"PRIu32"-%"PRIu32,
(int) entry_length, entry_start, first_cpu, last_cpu);
return false;
}
/* Parsed both parts of the entry; update CPU set */
#if CPUINFO_LOG_DEBUG_PARSERS
cpuinfo_log_debug("cpulist: call callback with list_start = %"PRIu32", list_end = %"PRIu32,
first_cpu, last_cpu + 1);
#endif
return callback(first_cpu, last_cpu + 1, context);
}
bool cpuinfo_linux_parse_cpulist(const char* filename, cpuinfo_cpulist_callback callback, void* context) {
bool status = true;
int file = -1;
char buffer[BUFFER_SIZE];
#if CPUINFO_LOG_DEBUG_PARSERS
cpuinfo_log_debug("parsing cpu list from file %s", filename);
#endif
#if CPUINFO_MOCK
file = cpuinfo_mock_open(filename, O_RDONLY);
#else
file = open(filename, O_RDONLY);
#endif
if (file == -1) {
cpuinfo_log_info("failed to open %s: %s", filename, strerror(errno));
status = false;
goto cleanup;
}
size_t position = 0;
const char* buffer_end = &buffer[BUFFER_SIZE];
char* data_start = buffer;
ssize_t bytes_read;
do {
#if CPUINFO_MOCK
bytes_read = cpuinfo_mock_read(file, data_start, (size_t) (buffer_end - data_start));
#else
bytes_read = read(file, data_start, (size_t) (buffer_end - data_start));
#endif
if (bytes_read < 0) {
cpuinfo_log_info("failed to read file %s at position %zu: %s", filename, position, strerror(errno));
status = false;
goto cleanup;
}
position += (size_t) bytes_read;
const char* data_end = data_start + (size_t) bytes_read;
const char* entry_start = buffer;
if (bytes_read == 0) {
/* No more data in the file: process the remaining text in the buffer as a single entry */
const char* entry_end = data_end;
const bool entry_status = parse_entry(entry_start, entry_end, callback, context);
status &= entry_status;
} else {
const char* entry_end;
do {
/* Find the end of the entry, as indicated by a comma (',') */
for (entry_end = entry_start; entry_end != data_end; entry_end++) {
if (*entry_end == ',') {
break;
}
}
/*
* If we located separator at the end of the entry, parse it.
* Otherwise, there may be more data at the end; read the file once again.
*/
if (entry_end != data_end) {
const bool entry_status = parse_entry(entry_start, entry_end, callback, context);
status &= entry_status;
entry_start = entry_end + 1;
}
} while (entry_end != data_end);
/* Move remaining partial entry data at the end to the beginning of the buffer */
const size_t entry_length = (size_t) (entry_end - entry_start);
memmove(buffer, entry_start, entry_length);
data_start = &buffer[entry_length];
}
} while (bytes_read != 0);
cleanup:
if (file != -1) {
#if CPUINFO_MOCK
cpuinfo_mock_close(file);
#else
close(file);
#endif
file = -1;
}
return status;
}

105
3rdparty/cpuinfo/src/linux/mockfile.c vendored Normal file
View File

@@ -0,0 +1,105 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
#if !CPUINFO_MOCK
#error This file should be built only in mock mode
#endif
#include <cpuinfo-mock.h>
#include <arm/linux/api.h>
#include <arm/midr.h>
#include <cpuinfo/log.h>
static struct cpuinfo_mock_file* cpuinfo_mock_files = NULL;
static uint32_t cpuinfo_mock_file_count = 0;
void CPUINFO_ABI cpuinfo_mock_filesystem(struct cpuinfo_mock_file* files) {
cpuinfo_log_info("filesystem mocking enabled");
uint32_t file_count = 0;
while (files[file_count].path != NULL) {
/* Indicate that file is not opened */
files[file_count].offset = SIZE_MAX;
file_count += 1;
}
cpuinfo_mock_files = files;
cpuinfo_mock_file_count = file_count;
}
int CPUINFO_ABI cpuinfo_mock_open(const char* path, int oflag) {
if (cpuinfo_mock_files == NULL) {
cpuinfo_log_warning("cpuinfo_mock_open called without mock filesystem; redictering to open");
return open(path, oflag);
}
for (uint32_t i = 0; i < cpuinfo_mock_file_count; i++) {
if (strcmp(cpuinfo_mock_files[i].path, path) == 0) {
if (oflag != O_RDONLY) {
errno = EACCES;
return -1;
}
if (cpuinfo_mock_files[i].offset != SIZE_MAX) {
errno = ENFILE;
return -1;
}
cpuinfo_mock_files[i].offset = 0;
return (int) i;
}
}
errno = ENOENT;
return -1;
}
int CPUINFO_ABI cpuinfo_mock_close(int fd) {
if (cpuinfo_mock_files == NULL) {
cpuinfo_log_warning("cpuinfo_mock_close called without mock filesystem; redictering to close");
return close(fd);
}
if ((unsigned int) fd >= cpuinfo_mock_file_count) {
errno = EBADF;
return -1;
}
if (cpuinfo_mock_files[fd].offset == SIZE_MAX) {
errno = EBADF;
return -1;
}
cpuinfo_mock_files[fd].offset = SIZE_MAX;
return 0;
}
ssize_t CPUINFO_ABI cpuinfo_mock_read(int fd, void* buffer, size_t capacity) {
if (cpuinfo_mock_files == NULL) {
cpuinfo_log_warning("cpuinfo_mock_read called without mock filesystem; redictering to read");
return read(fd, buffer, capacity);
}
if ((unsigned int) fd >= cpuinfo_mock_file_count) {
errno = EBADF;
return -1;
}
if (cpuinfo_mock_files[fd].offset == SIZE_MAX) {
errno = EBADF;
return -1;
}
const size_t offset = cpuinfo_mock_files[fd].offset;
size_t count = cpuinfo_mock_files[fd].size - offset;
if (count > capacity) {
count = capacity;
}
memcpy(buffer, (void*) cpuinfo_mock_files[fd].content + offset, count);
cpuinfo_mock_files[fd].offset += count;
return (ssize_t) count;
}

106
3rdparty/cpuinfo/src/linux/multiline.c vendored Normal file
View File

@@ -0,0 +1,106 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <alloca.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
#endif
#include <linux/api.h>
#include <cpuinfo/log.h>
bool cpuinfo_linux_parse_multiline_file(const char* filename, size_t buffer_size, cpuinfo_line_callback callback, void* context)
{
int file = -1;
bool status = false;
char* buffer = (char*) alloca(buffer_size);
#if CPUINFO_MOCK
file = cpuinfo_mock_open(filename, O_RDONLY);
#else
file = open(filename, O_RDONLY);
#endif
if (file == -1) {
cpuinfo_log_info("failed to open %s: %s", filename, strerror(errno));
goto cleanup;
}
/* Only used for error reporting */
size_t position = 0;
uint64_t line_number = 1;
const char* buffer_end = &buffer[buffer_size];
char* data_start = buffer;
ssize_t bytes_read;
do {
#if CPUINFO_MOCK
bytes_read = cpuinfo_mock_read(file, data_start, (size_t) (buffer_end - data_start));
#else
bytes_read = read(file, data_start, (size_t) (buffer_end - data_start));
#endif
if (bytes_read < 0) {
cpuinfo_log_info("failed to read file %s at position %zu: %s",
filename, position, strerror(errno));
goto cleanup;
}
position += (size_t) bytes_read;
const char* data_end = data_start + (size_t) bytes_read;
const char* line_start = buffer;
if (bytes_read == 0) {
/* No more data in the file: process the remaining text in the buffer as a single entry */
const char* line_end = data_end;
if (!callback(line_start, line_end, context, line_number)) {
goto cleanup;
}
} else {
const char* line_end;
do {
/* Find the end of the entry, as indicated by newline character ('\n') */
for (line_end = line_start; line_end != data_end; line_end++) {
if (*line_end == '\n') {
break;
}
}
/*
* If we located separator at the end of the entry, parse it.
* Otherwise, there may be more data at the end; read the file once again.
*/
if (line_end != data_end) {
if (!callback(line_start, line_end, context, line_number++)) {
goto cleanup;
}
line_start = line_end + 1;
}
} while (line_end != data_end);
/* Move remaining partial line data at the end to the beginning of the buffer */
const size_t line_length = (size_t) (line_end - line_start);
memmove(buffer, line_start, line_length);
data_start = &buffer[line_length];
}
} while (bytes_read != 0);
/* Commit */
status = true;
cleanup:
if (file != -1) {
#if CPUINFO_MOCK
cpuinfo_mock_close(file);
#else
close(file);
#endif
file = -1;
}
return status;
}

406
3rdparty/cpuinfo/src/linux/processors.c vendored Normal file
View File

@@ -0,0 +1,406 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#if !defined(__ANDROID__)
/*
* sched.h is only used for CPU_SETSIZE constant.
* Android NDK headers before platform 21 do have this constant in sched.h
*/
#include <sched.h>
#endif
#include <linux/api.h>
#include <cpuinfo/log.h>
#define STRINGIFY(token) #token
#define KERNEL_MAX_FILENAME "/sys/devices/system/cpu/kernel_max"
#define KERNEL_MAX_FILESIZE 32
#define FREQUENCY_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/cpufreq/cpuinfo_max_freq"))
#define MAX_FREQUENCY_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/cpufreq/cpuinfo_max_freq"
#define MIN_FREQUENCY_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/cpufreq/cpuinfo_min_freq"
#define FREQUENCY_FILESIZE 32
#define PACKAGE_ID_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/physical_package_id"))
#define PACKAGE_ID_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/physical_package_id"
#define PACKAGE_ID_FILESIZE 32
#define CORE_ID_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/core_id"))
#define CORE_ID_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/core_id"
#define CORE_ID_FILESIZE 32
#define CORE_SIBLINGS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/core_siblings_list"))
#define CORE_SIBLINGS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/core_siblings_list"
#define THREAD_SIBLINGS_FILENAME_SIZE (sizeof("/sys/devices/system/cpu/cpu" STRINGIFY(UINT32_MAX) "/topology/thread_siblings_list"))
#define THREAD_SIBLINGS_FILENAME_FORMAT "/sys/devices/system/cpu/cpu%" PRIu32 "/topology/thread_siblings_list"
#define POSSIBLE_CPULIST_FILENAME "/sys/devices/system/cpu/possible"
#define PRESENT_CPULIST_FILENAME "/sys/devices/system/cpu/present"
inline static const char* parse_number(const char* start, const char* end, uint32_t number_ptr[restrict static 1]) {
uint32_t number = 0;
const char* parsed = start;
for (; parsed != end; parsed++) {
const uint32_t digit = (uint32_t) (uint8_t) (*parsed) - (uint32_t) '0';
if (digit >= 10) {
break;
}
number = number * UINT32_C(10) + digit;
}
*number_ptr = number;
return parsed;
}
/* Locale-independent */
inline static bool is_whitespace(char c) {
switch (c) {
case ' ':
case '\t':
case '\n':
case '\r':
return true;
default:
return false;
}
}
#if defined(__ANDROID__) && !defined(CPU_SETSIZE)
/*
* Android NDK headers before platform 21 do not define CPU_SETSIZE,
* so we hard-code its value, as defined in platform 21 headers
*/
#if defined(__LP64__)
static const uint32_t default_max_processors_count = 1024;
#else
static const uint32_t default_max_processors_count = 32;
#endif
#else
static const uint32_t default_max_processors_count = CPU_SETSIZE;
#endif
static bool uint32_parser(const char* text_start, const char* text_end, void* context) {
if (text_start == text_end) {
cpuinfo_log_error("failed to parse file %s: file is empty", KERNEL_MAX_FILENAME);
return false;
}
uint32_t kernel_max = 0;
const char* parsed_end = parse_number(text_start, text_end, &kernel_max);
if (parsed_end == text_start) {
cpuinfo_log_error("failed to parse file %s: \"%.*s\" is not an unsigned number",
KERNEL_MAX_FILENAME, (int) (text_end - text_start), text_start);
return false;
} else {
for (const char* char_ptr = parsed_end; char_ptr != text_end; char_ptr++) {
if (!is_whitespace(*char_ptr)) {
cpuinfo_log_warning("non-whitespace characters \"%.*s\" following number in file %s are ignored",
(int) (text_end - char_ptr), char_ptr, KERNEL_MAX_FILENAME);
break;
}
}
}
uint32_t* kernel_max_ptr = (uint32_t*) context;
*kernel_max_ptr = kernel_max;
return true;
}
uint32_t cpuinfo_linux_get_max_processors_count(void) {
uint32_t kernel_max;
if (cpuinfo_linux_parse_small_file(KERNEL_MAX_FILENAME, KERNEL_MAX_FILESIZE, uint32_parser, &kernel_max)) {
cpuinfo_log_debug("parsed kernel_max value of %"PRIu32" from %s", kernel_max, KERNEL_MAX_FILENAME);
if (kernel_max >= default_max_processors_count) {
cpuinfo_log_warning("kernel_max value of %"PRIu32" parsed from %s exceeds platform-default limit %"PRIu32,
kernel_max, KERNEL_MAX_FILENAME, default_max_processors_count - 1);
}
return kernel_max + 1;
} else {
cpuinfo_log_warning("using platform-default max processors count = %"PRIu32, default_max_processors_count);
return default_max_processors_count;
}
}
uint32_t cpuinfo_linux_get_processor_max_frequency(uint32_t processor) {
char max_frequency_filename[FREQUENCY_FILENAME_SIZE];
const int chars_formatted = snprintf(
max_frequency_filename, FREQUENCY_FILENAME_SIZE, MAX_FREQUENCY_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= FREQUENCY_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for max frequency of processor %"PRIu32, processor);
return 0;
}
uint32_t max_frequency;
if (cpuinfo_linux_parse_small_file(max_frequency_filename, FREQUENCY_FILESIZE, uint32_parser, &max_frequency)) {
cpuinfo_log_debug("parsed max frequency value of %"PRIu32" KHz for logical processor %"PRIu32" from %s",
max_frequency, processor, max_frequency_filename);
return max_frequency;
} else {
cpuinfo_log_warning("failed to parse max frequency for processor %"PRIu32" from %s",
processor, max_frequency_filename);
return 0;
}
}
uint32_t cpuinfo_linux_get_processor_min_frequency(uint32_t processor) {
char min_frequency_filename[FREQUENCY_FILENAME_SIZE];
const int chars_formatted = snprintf(
min_frequency_filename, FREQUENCY_FILENAME_SIZE, MIN_FREQUENCY_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= FREQUENCY_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for min frequency of processor %"PRIu32, processor);
return 0;
}
uint32_t min_frequency;
if (cpuinfo_linux_parse_small_file(min_frequency_filename, FREQUENCY_FILESIZE, uint32_parser, &min_frequency)) {
cpuinfo_log_debug("parsed min frequency value of %"PRIu32" KHz for logical processor %"PRIu32" from %s",
min_frequency, processor, min_frequency_filename);
return min_frequency;
} else {
/*
* This error is less severe than parsing max frequency, because min frequency is only useful for clustering,
* while max frequency is also needed for peak FLOPS calculation.
*/
cpuinfo_log_info("failed to parse min frequency for processor %"PRIu32" from %s",
processor, min_frequency_filename);
return 0;
}
}
bool cpuinfo_linux_get_processor_core_id(uint32_t processor, uint32_t core_id_ptr[restrict static 1]) {
char core_id_filename[PACKAGE_ID_FILENAME_SIZE];
const int chars_formatted = snprintf(
core_id_filename, CORE_ID_FILENAME_SIZE, CORE_ID_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= CORE_ID_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for core id of processor %"PRIu32, processor);
return 0;
}
uint32_t core_id;
if (cpuinfo_linux_parse_small_file(core_id_filename, CORE_ID_FILESIZE, uint32_parser, &core_id)) {
cpuinfo_log_debug("parsed core id value of %"PRIu32" for logical processor %"PRIu32" from %s",
core_id, processor, core_id_filename);
*core_id_ptr = core_id;
return true;
} else {
cpuinfo_log_info("failed to parse core id for processor %"PRIu32" from %s",
processor, core_id_filename);
return false;
}
}
bool cpuinfo_linux_get_processor_package_id(uint32_t processor, uint32_t package_id_ptr[restrict static 1]) {
char package_id_filename[PACKAGE_ID_FILENAME_SIZE];
const int chars_formatted = snprintf(
package_id_filename, PACKAGE_ID_FILENAME_SIZE, PACKAGE_ID_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= PACKAGE_ID_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for package id of processor %"PRIu32, processor);
return 0;
}
uint32_t package_id;
if (cpuinfo_linux_parse_small_file(package_id_filename, PACKAGE_ID_FILESIZE, uint32_parser, &package_id)) {
cpuinfo_log_debug("parsed package id value of %"PRIu32" for logical processor %"PRIu32" from %s",
package_id, processor, package_id_filename);
*package_id_ptr = package_id;
return true;
} else {
cpuinfo_log_info("failed to parse package id for processor %"PRIu32" from %s",
processor, package_id_filename);
return false;
}
}
static bool max_processor_number_parser(uint32_t processor_list_start, uint32_t processor_list_end, void* context) {
uint32_t* processor_number_ptr = (uint32_t*) context;
const uint32_t processor_list_last = processor_list_end - 1;
if (*processor_number_ptr < processor_list_last) {
*processor_number_ptr = processor_list_last;
}
return true;
}
uint32_t cpuinfo_linux_get_max_possible_processor(uint32_t max_processors_count) {
uint32_t max_possible_processor = 0;
if (!cpuinfo_linux_parse_cpulist(POSSIBLE_CPULIST_FILENAME, max_processor_number_parser, &max_possible_processor)) {
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
cpuinfo_log_error("failed to parse the list of possible processors in %s", POSSIBLE_CPULIST_FILENAME);
#else
cpuinfo_log_warning("failed to parse the list of possible processors in %s", POSSIBLE_CPULIST_FILENAME);
#endif
return UINT32_MAX;
}
if (max_possible_processor >= max_processors_count) {
cpuinfo_log_warning(
"maximum possible processor number %"PRIu32" exceeds system limit %"PRIu32": truncating to the latter",
max_possible_processor, max_processors_count - 1);
max_possible_processor = max_processors_count - 1;
}
return max_possible_processor;
}
uint32_t cpuinfo_linux_get_max_present_processor(uint32_t max_processors_count) {
uint32_t max_present_processor = 0;
if (!cpuinfo_linux_parse_cpulist(PRESENT_CPULIST_FILENAME, max_processor_number_parser, &max_present_processor)) {
#if CPUINFO_ARCH_ARM || CPUINFO_ARCH_ARM64
cpuinfo_log_error("failed to parse the list of present processors in %s", PRESENT_CPULIST_FILENAME);
#else
cpuinfo_log_warning("failed to parse the list of present processors in %s", PRESENT_CPULIST_FILENAME);
#endif
return UINT32_MAX;
}
if (max_present_processor >= max_processors_count) {
cpuinfo_log_warning(
"maximum present processor number %"PRIu32" exceeds system limit %"PRIu32": truncating to the latter",
max_present_processor, max_processors_count - 1);
max_present_processor = max_processors_count - 1;
}
return max_present_processor;
}
struct detect_processors_context {
uint32_t max_processors_count;
uint32_t* processor0_flags;
uint32_t processor_struct_size;
uint32_t detected_flag;
};
static bool detect_processor_parser(uint32_t processor_list_start, uint32_t processor_list_end, void* context) {
const uint32_t max_processors_count = ((struct detect_processors_context*) context)->max_processors_count;
const uint32_t* processor0_flags = ((struct detect_processors_context*) context)->processor0_flags;
const uint32_t processor_struct_size = ((struct detect_processors_context*) context)->processor_struct_size;
const uint32_t detected_flag = ((struct detect_processors_context*) context)->detected_flag;
for (uint32_t processor = processor_list_start; processor < processor_list_end; processor++) {
if (processor >= max_processors_count) {
break;
}
*((uint32_t*) ((uintptr_t) processor0_flags + processor_struct_size * processor)) |= detected_flag;
}
return true;
}
bool cpuinfo_linux_detect_possible_processors(uint32_t max_processors_count,
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t possible_flag)
{
struct detect_processors_context context = {
.max_processors_count = max_processors_count,
.processor0_flags = processor0_flags,
.processor_struct_size = processor_struct_size,
.detected_flag = possible_flag,
};
if (cpuinfo_linux_parse_cpulist(POSSIBLE_CPULIST_FILENAME, detect_processor_parser, &context)) {
return true;
} else {
cpuinfo_log_warning("failed to parse the list of possible processors in %s", POSSIBLE_CPULIST_FILENAME);
return false;
}
}
bool cpuinfo_linux_detect_present_processors(uint32_t max_processors_count,
uint32_t* processor0_flags, uint32_t processor_struct_size, uint32_t present_flag)
{
struct detect_processors_context context = {
.max_processors_count = max_processors_count,
.processor0_flags = processor0_flags,
.processor_struct_size = processor_struct_size,
.detected_flag = present_flag,
};
if (cpuinfo_linux_parse_cpulist(PRESENT_CPULIST_FILENAME, detect_processor_parser, &context)) {
return true;
} else {
cpuinfo_log_warning("failed to parse the list of present processors in %s", PRESENT_CPULIST_FILENAME);
return false;
}
}
struct siblings_context {
const char* group_name;
uint32_t max_processors_count;
uint32_t processor;
cpuinfo_siblings_callback callback;
void* callback_context;
};
static bool siblings_parser(uint32_t sibling_list_start, uint32_t sibling_list_end, struct siblings_context* context) {
const char* group_name = context->group_name;
const uint32_t max_processors_count = context->max_processors_count;
const uint32_t processor = context->processor;
if (sibling_list_end > max_processors_count) {
cpuinfo_log_warning("ignore %s siblings %"PRIu32"-%"PRIu32" of processor %"PRIu32,
group_name, max_processors_count, sibling_list_end - 1, processor);
sibling_list_end = max_processors_count;
}
return context->callback(processor, sibling_list_start, sibling_list_end, context->callback_context);
}
bool cpuinfo_linux_detect_core_siblings(
uint32_t max_processors_count,
uint32_t processor,
cpuinfo_siblings_callback callback,
void* context)
{
char core_siblings_filename[CORE_SIBLINGS_FILENAME_SIZE];
const int chars_formatted = snprintf(
core_siblings_filename, CORE_SIBLINGS_FILENAME_SIZE, CORE_SIBLINGS_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= CORE_SIBLINGS_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for core siblings of processor %"PRIu32, processor);
return false;
}
struct siblings_context siblings_context = {
.group_name = "package",
.max_processors_count = max_processors_count,
.processor = processor,
.callback = callback,
.callback_context = context,
};
if (cpuinfo_linux_parse_cpulist(core_siblings_filename,
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context))
{
return true;
} else {
cpuinfo_log_info("failed to parse the list of core siblings for processor %"PRIu32" from %s",
processor, core_siblings_filename);
return false;
}
}
bool cpuinfo_linux_detect_thread_siblings(
uint32_t max_processors_count,
uint32_t processor,
cpuinfo_siblings_callback callback,
void* context)
{
char thread_siblings_filename[THREAD_SIBLINGS_FILENAME_SIZE];
const int chars_formatted = snprintf(
thread_siblings_filename, THREAD_SIBLINGS_FILENAME_SIZE, THREAD_SIBLINGS_FILENAME_FORMAT, processor);
if ((unsigned int) chars_formatted >= THREAD_SIBLINGS_FILENAME_SIZE) {
cpuinfo_log_warning("failed to format filename for thread siblings of processor %"PRIu32, processor);
return false;
}
struct siblings_context siblings_context = {
.group_name = "core",
.max_processors_count = max_processors_count,
.processor = processor,
.callback = callback,
.callback_context = context,
};
if (cpuinfo_linux_parse_cpulist(thread_siblings_filename,
(cpuinfo_cpulist_callback) siblings_parser, &siblings_context))
{
return true;
} else {
cpuinfo_log_info("failed to parse the list of thread siblings for processor %"PRIu32" from %s",
processor, thread_siblings_filename);
return false;
}
}

70
3rdparty/cpuinfo/src/linux/smallfile.c vendored Normal file
View File

@@ -0,0 +1,70 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <alloca.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#if CPUINFO_MOCK
#include <cpuinfo-mock.h>
#endif
#include <linux/api.h>
#include <cpuinfo/log.h>
bool cpuinfo_linux_parse_small_file(const char* filename, size_t buffer_size, cpuinfo_smallfile_callback callback, void* context) {
int file = -1;
bool status = false;
char* buffer = (char*) alloca(buffer_size);
#if CPUINFO_LOG_DEBUG_PARSERS
cpuinfo_log_debug("parsing small file %s", filename);
#endif
#if CPUINFO_MOCK
file = cpuinfo_mock_open(filename, O_RDONLY);
#else
file = open(filename, O_RDONLY);
#endif
if (file == -1) {
cpuinfo_log_info("failed to open %s: %s", filename, strerror(errno));
goto cleanup;
}
size_t buffer_position = 0;
ssize_t bytes_read;
do {
#if CPUINFO_MOCK
bytes_read = cpuinfo_mock_read(file, &buffer[buffer_position], buffer_size - buffer_position);
#else
bytes_read = read(file, &buffer[buffer_position], buffer_size - buffer_position);
#endif
if (bytes_read < 0) {
cpuinfo_log_info("failed to read file %s at position %zu: %s", filename, buffer_position, strerror(errno));
goto cleanup;
}
buffer_position += (size_t) bytes_read;
if (buffer_position >= buffer_size) {
cpuinfo_log_error("failed to read file %s: insufficient buffer of size %zu", filename, buffer_size);
goto cleanup;
}
} while (bytes_read != 0);
status = callback(buffer, &buffer[buffer_position], context);
cleanup:
if (file != -1) {
#if CPUINFO_MOCK
cpuinfo_mock_close(file);
#else
close(file);
#endif
file = -1;
}
return status;
}

Some files were not shown because too many files have changed in this diff Show More